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/CfgVehicles.hpp b/addons/aircraft/CfgVehicles.hpp index e9fb90e61e..559b8dc2e1 100644 --- a/addons/aircraft/CfgVehicles.hpp +++ b/addons/aircraft/CfgVehicles.hpp @@ -95,29 +95,7 @@ class CfgVehicles { }; }; - class Heli_Attack_01_base_F: Helicopter_Base_F { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; - driverCanEject = 1; - - class Turrets: Turrets { - class MainTurret: MainTurret { - canEject = 1; - showHMD = 1; - weapons[] = {"ACE_gatling_20mm_Comanche","missiles_DAGR","missiles_ASRAAM"}; - magazines[] = {"ACE_500Rnd_20mm_shells_Comanche","4Rnd_AAA_missiles","24Rnd_PG_missiles"}; - }; - }; - - class AnimationSources: AnimationSources { - class Gatling { - weapon = "ACE_gatling_20mm_Comanche"; - }; - class Muzzle_flash { - weapon = "ACE_gatling_20mm_Comanche"; - }; - }; - }; + #include "Heli_Attack_01_base_F.hpp" class B_Heli_Attack_01_F: Heli_Attack_01_base_F {}; @@ -222,7 +200,7 @@ class CfgVehicles { lockDetectionSystem = 0; incomingMissileDetectionSystem = 16; driverCanEject = 1; - weapons[] = {"M134_minigun","missiles_DAR","CMFlareLauncher"}; + weapons[] = {"M134_minigun","missiles_DAR","CMFlareLauncher", "ACE_AIR_SAFETY" }; magazines[] = {"5000Rnd_762x51_Yellow_Belt","24Rnd_missiles","168Rnd_CMFlare_Chaff_Magazine"}; class Turrets: Turrets { diff --git a/addons/aircraft/CfgWeapons.hpp b/addons/aircraft/CfgWeapons.hpp index c5f22fc3a2..dc84c9f04a 100644 --- a/addons/aircraft/CfgWeapons.hpp +++ b/addons/aircraft/CfgWeapons.hpp @@ -4,6 +4,23 @@ class Mode_Burst; class Mode_FullAuto; class CfgWeapons { + + class RocketPods; + class ACE_AIR_SAFETY : RocketPods + { + CanLock = 0; + displayName = "SAFE"; + displayNameMagazine = "SAFE"; + shortNameMagazine = "SAFE"; + nameSound = "cannon"; + cursor = "EmptyCursor"; + cursorAim = "EmptyCursor"; + magazines[] = {"FakeMagazine"}; + burst = 0; + reloadTime = 0.01; + magazineReloadTime = 0.1; + }; + // Manual Switching Of Flare Mode class SmokeLauncher; class CMFlareLauncher: SmokeLauncher { @@ -37,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 new file mode 100644 index 0000000000..817b1dacaa --- /dev/null +++ b/addons/aircraft/Heli_Attack_01_base_F.hpp @@ -0,0 +1,979 @@ +class Heli_Attack_01_base_F: Helicopter_Base_F { + lockDetectionSystem = 12; + incomingMissileDetectionSystem = 16; + driverCanEject = 1; + + class MFD + { + class AirplaneHUD + { + class Bones{}; + class Draw{}; + topLeft = "HUD_top_left"; + topRight = "HUD_top_right"; + bottomLeft = "HUD_bottom_left"; + borderLeft = 0; + borderRight = 0; + borderTop = 0; + borderBottom = 0; + color[] = {0.15,1,0.15,1}; + enableParallax = 0; + helmetMountedDisplay = 1; + helmetPosition[] = {0,0,0}; + helmetRight[] = {0,0,0}; + helmetDown[] = {0,0,0}; + }; + class ACE_HUD_1 + { + topLeft = "HUD_top_left"; + topRight = "HUD_top_right"; + bottomLeft = "HUD_bottom_left"; + borderLeft = 0; + borderRight = 0; + borderTop = 0; + borderBottom = 0; + color[] = {0.15,1,0.15,1}; + enableParallax = 0; + class Bones + { + class GunnerAim + { + type = "vector"; + source = "weapon"; + pos0[] = {0.5,"0.9 - 0.04 + 0.012"}; + pos10[] = {"0.5 + 0.0111","0.9 - 0.04 + 0.012 + 0.0133"}; + }; + class Target + { + source = "target"; + type = "vector"; + pos0[] = {0.5,0.5}; + pos10[] = {0.85,0.85}; + }; + class Velocity + { + type = "vector"; + source = "velocity"; + pos0[] = {0.5,0.5}; + pos10[] = {0.65,0.65}; + }; + class Velocity_slip + { + type = "vector"; + source = "velocity"; + pos0[] = {0.5,0.845}; + pos10[] = {0.53,0.845}; + }; + class VspeedBone + { + type = "linear"; + source = "vspeed"; + sourceScale = 1; + min = -10; + max = 10; + minPos[] = {0.93,0.2}; + maxPos[] = {0.93,0.8}; + }; + class RadarAltitudeBone + { + type = "linear"; + source = "altitudeAGL"; + sourceScale = 1; + min = 0; + max = 60; + minPos[] = {0.965,0.2}; + maxPos[] = {0.965,0.8}; + }; + class HorizonBankRot + { + type = "rotational"; + source = "horizonBank"; + center[] = {0.5,0.5}; + min = -3.1416; + max = 3.1416; + minAngle = -180; + maxAngle = 180; + aspectRatio = 1; + }; + class ForwardVec + { + type = "vector"; + source = "forward"; + pos0[] = {0,0}; + pos10[] = {0.25,0.25}; + }; + class WeaponAim + { + type = "vector"; + source = "weapon"; + pos0[] = {0.5,0.5}; + pos10[] = {0.75,0.75}; + }; + class Level0 + { + type = "horizon"; + pos0[] = {0.5,0.5}; + pos10[] = {0.78,0.78}; + angle = 0; + }; + class LevelP5: Level0 + { + angle = 5; + }; + class LevelM5: Level0 + { + angle = -5; + }; + class LevelP10: Level0 + { + angle = 10; + }; + class LevelM10: Level0 + { + angle = -10; + }; + class LevelP15: Level0 + { + angle = 15; + }; + class LevelM15: Level0 + { + angle = -15; + }; + class LevelP20: Level0 + { + angle = 20; + }; + class LevelM20: Level0 + { + angle = -20; + }; + class LevelP25: Level0 + { + angle = 25; + }; + class LevelM25: Level0 + { + angle = -25; + }; + class LevelP30: Level0 + { + angle = 30; + }; + class LevelM30: Level0 + { + angle = -30; + }; + class LevelP35: Level0 + { + angle = 35; + }; + class LevelM35: Level0 + { + angle = -35; + }; + class LevelP40: Level0 + { + angle = 40; + }; + class LevelM40: Level0 + { + angle = -40; + }; + class LevelP45: Level0 + { + angle = 45; + }; + class LevelM45: Level0 + { + angle = -45; + }; + class LevelP50: Level0 + { + angle = 50; + }; + class LevelM50: Level0 + { + angle = -50; + }; + }; + class Draw + { + color[] = {0.18,1,0.18}; + alpha = 1; + condition = "on"; + class Horizont + { + clipTL[] = {0.15,0.15}; + clipBR[] = {0.85,0.85}; + class Dimmed + { + class Level0 + { + type = "line"; + points[] = {{ "Level0",{ -0.42,0 },1 },{ "Level0",{ -0.38,0 },1 },{ },{ "Level0",{ -0.37,0 },1 },{ "Level0",{ -0.33,0 },1 },{ },{ "Level0",{ -0.32,0 },1 },{ "Level0",{ -0.28,0 },1 },{ },{ "Level0",{ -0.27,0 },1 },{ "Level0",{ -0.23,0 },1 },{ },{ "Level0",{ -0.22,0 },1 },{ "Level0",{ -0.18,0 },1 },{ },{ "Level0",{ -0.17,0 },1 },{ "Level0",{ -0.13,0 },1 },{ },{ "Level0",{ -0.12,0 },1 },{ "Level0",{ -0.08,0 },1 },{ },{ "Level0",{ 0.42,0 },1 },{ "Level0",{ 0.38,0 },1 },{ },{ "Level0",{ 0.37,0 },1 },{ "Level0",{ 0.33,0 },1 },{ },{ "Level0",{ 0.32,0 },1 },{ "Level0",{ 0.28,0 },1 },{ },{ "Level0",{ 0.27,0 },1 },{ "Level0",{ 0.23,0 },1 },{ },{ "Level0",{ 0.22,0 },1 },{ "Level0",{ 0.18,0 },1 },{ },{ "Level0",{ 0.17,0 },1 },{ "Level0",{ 0.13,0 },1 },{ },{ "Level0",{ 0.12,0 },1 },{ "Level0",{ 0.08,0 },1 }}; + }; + }; + }; + class HorizonBankRot + { + type = "line"; + width = 3; + points[] = {{ "HorizonBankRot",{ 0,0.25 },1 },{ "HorizonBankRot",{ -0.01,0.23 },1 },{ "HorizonBankRot",{ 0.01,0.23 },1 },{ "HorizonBankRot",{ 0,0.25 },1 }}; + }; + class Static_HAD_BOX + { + clipTL[] = {0,1}; + clipBR[] = {1,0}; + type = "line"; + width = 5; + points[] = {{ { "0.5-0.1","0.9-0.04" },1 },{ { "0.5-0.1","0.9+0.04" },1 },{ { "0.5+0.1","0.9+0.04" },1 },{ { "0.5+0.1","0.9-0.04" },1 },{ { "0.5-0.1","0.9-0.04" },1 },{ },{ { "0.5-0.1","0.9-0.04+0.012" },1 },{ { "0.5-0.092","0.9-0.04+0.012" },1 },{ },{ { "0.5+0.1","0.9-0.04+0.012" },1 },{ { "0.5+0.092","0.9-0.04+0.012" },1 },{ },{ { 0.5,"0.9-0.04" },1 },{ { 0.5,"0.9-0.032" },1 },{ },{ { 0.5,"0.9+0.04" },1 },{ { 0.5,"0.9+0.032" },1 },{ }}; + }; + class Gunner_HAD + { + type = "line"; + width = 6; + points[] = {{ "GunnerAim",{ -0.015,-0.008 },1 },{ "GunnerAim",{ -0.015,0.008 },1 },{ "GunnerAim",{ 0.015,0.008 },1 },{ "GunnerAim",{ 0.015,-0.008 },1 },{ "GunnerAim",{ -0.015,-0.008 },1 }}; + }; + class Slip_ball_group + { + class Slip_bars + { + type = "line"; + width = 4; + points[] = {{ { "0.5-0.018","0.9-0.04" },1 },{ { "0.5-0.018","0.9-0.075" },1 },{ },{ { "0.5+0.018","0.9-0.04" },1 },{ { "0.5+0.018","0.9-0.075" },1 }}; + }; + class Slip_ball + { + type = "line"; + width = 6; + points[] = {{ "Velocity_slip",1,{ "0 * 0.75","-0.02 * 0.75" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.75","-0.01732 * 0.75" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.75","-0.0099999998 * 0.75" },1 },{ "Velocity_slip",1,{ "0.02 * 0.75","0 * 0.75" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.75","0.0099999998 * 0.75" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.75","0.01732 * 0.75" },1 },{ "Velocity_slip",1,{ "0 * 0.75","0.02 * 0.75" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.75","0.01732 * 0.75" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.75","0.0099999998 * 0.75" },1 },{ "Velocity_slip",1,{ "-0.02 * 0.75","0 * 0.75" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.75","-0.0099999998 * 0.75" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.75","-0.01732 * 0.75" },1 },{ "Velocity_slip",1,{ "0 * 0.75","-0.02 * 0.75" },1 },{ },{ "Velocity_slip",1,{ "0 * 0.6","-0.02 * 0.6" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.6","-0.01732 * 0.6" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.6","-0.0099999998 * 0.6" },1 },{ "Velocity_slip",1,{ "0.02 * 0.6","0 * 0.6" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.6","0.0099999998 * 0.6" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.6","0.01732 * 0.6" },1 },{ "Velocity_slip",1,{ "0 * 0.6","0.02 * 0.6" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.6","0.01732 * 0.6" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.6","0.0099999998 * 0.6" },1 },{ "Velocity_slip",1,{ "-0.02 * 0.6","0 * 0.6" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.6","-0.0099999998 * 0.6" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.6","-0.01732 * 0.6" },1 },{ "Velocity_slip",1,{ "0 * 0.6","-0.02 * 0.6" },1 },{ },{ "Velocity_slip",1,{ "0 * 0.5","-0.02 * 0.5" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.5","-0.01732 * 0.5" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.5","-0.0099999998 * 0.5" },1 },{ "Velocity_slip",1,{ "0.02 * 0.5","0 * 0.5" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.5","0.0099999998 * 0.5" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.5","0.01732 * 0.5" },1 },{ "Velocity_slip",1,{ "0 * 0.5","0.02 * 0.5" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.5","0.01732 * 0.5" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.5","0.0099999998 * 0.5" },1 },{ "Velocity_slip",1,{ "-0.02 * 0.5","0 * 0.5" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.5","-0.0099999998 * 0.5" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.5","-0.01732 * 0.5" },1 },{ "Velocity_slip",1,{ "0 * 0.5","-0.02 * 0.5" },1 },{ },{ "Velocity_slip",1,{ "0 * 0.4","-0.02 * 0.4" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.4","-0.01732 * 0.4" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.4","-0.0099999998 * 0.4" },1 },{ "Velocity_slip",1,{ "0.02 * 0.4","0 * 0.4" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.4","0.0099999998 * 0.4" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.4","0.01732 * 0.4" },1 },{ "Velocity_slip",1,{ "0 * 0.4","0.02 * 0.4" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.4","0.01732 * 0.4" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.4","0.0099999998 * 0.4" },1 },{ "Velocity_slip",1,{ "-0.02 * 0.4","0 * 0.4" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.4","-0.0099999998 * 0.4" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.4","-0.01732 * 0.4" },1 },{ "Velocity_slip",1,{ "0 * 0.4","-0.02 * 0.4" },1 },{ },{ "Velocity_slip",1,{ "0 * 0.30","-0.02 * 0.30" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.30","-0.01732 * 0.30" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.30","-0.0099999998 * 0.30" },1 },{ "Velocity_slip",1,{ "0.02 * 0.30","0 * 0.30" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.30","0.0099999998 * 0.30" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.30","0.01732 * 0.30" },1 },{ "Velocity_slip",1,{ "0 * 0.30","0.02 * 0.30" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.30","0.01732 * 0.30" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.30","0.0099999998 * 0.30" },1 },{ "Velocity_slip",1,{ "-0.02 * 0.30","0 * 0.30" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.30","-0.0099999998 * 0.30" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.30","-0.01732 * 0.30" },1 },{ "Velocity_slip",1,{ "0 * 0.30","-0.02 * 0.30" },1 },{ },{ "Velocity_slip",1,{ "0 * 0.20","-0.02 * 0.20" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.20","-0.01732 * 0.20" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.20","-0.0099999998 * 0.20" },1 },{ "Velocity_slip",1,{ "0.02 * 0.20","0 * 0.20" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.20","0.0099999998 * 0.20" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.20","0.01732 * 0.20" },1 },{ "Velocity_slip",1,{ "0 * 0.20","0.02 * 0.20" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.20","0.01732 * 0.20" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.20","0.0099999998 * 0.20" },1 },{ "Velocity_slip",1,{ "-0.02 * 0.20","0 * 0.20" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.20","-0.0099999998 * 0.20" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.20","-0.01732 * 0.20" },1 },{ "Velocity_slip",1,{ "0 * 0.20","-0.02 * 0.20" },1 },{ },{ "Velocity_slip",1,{ "0 * 0.1","-0.02 * 0.1" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.1","-0.01732 * 0.1" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.1","-0.0099999998 * 0.1" },1 },{ "Velocity_slip",1,{ "0.02 * 0.1","0 * 0.1" },1 },{ "Velocity_slip",1,{ "0.01732 * 0.1","0.0099999998 * 0.1" },1 },{ "Velocity_slip",1,{ "0.0099999998 * 0.1","0.01732 * 0.1" },1 },{ "Velocity_slip",1,{ "0 * 0.1","0.02 * 0.1" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.1","0.01732 * 0.1" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.1","0.0099999998 * 0.1" },1 },{ "Velocity_slip",1,{ "-0.02 * 0.1","0 * 0.1" },1 },{ "Velocity_slip",1,{ "-0.01732 * 0.1","-0.0099999998 * 0.1" },1 },{ "Velocity_slip",1,{ "-0.0099999998 * 0.1","-0.01732 * 0.1" },1 },{ "Velocity_slip",1,{ "0 * 0.1","-0.02 * 0.1" },1 }}; + }; + }; + class Centerline + { + type = "line"; + width = 5; + points[] = {{ { 0.5,0.48 },1 },{ { 0.5,0.45 },1 },{ },{ { 0.5,0.52 },1 },{ { 0.5,0.55 },1 },{ },{ { 0.48,0.5 },1 },{ { 0.45,0.5 },1 },{ },{ { 0.52,0.5 },1 },{ { 0.55,0.5 },1 },{ }}; + }; + class WeaponName + { + type = "text"; + source = "weapon"; + sourceScale = 1; + align = "right"; + scale = 1; + pos[] = {{ 0.61,0.86 },1}; + right[] = {{ 0.65,0.86 },1}; + down[] = {{ 0.61,0.9 },1}; + }; + class Ammo_GUN + { + type = "group"; + condition = "mgun"; + class Ammo_count_GUN + { + type = "text"; + source = "ammo"; + sourceScale = 1; + align = "right"; + scale = 1; + pos[] = {{ 0.61,0.89 },1}; + right[] = {{ 0.65,0.89 },1}; + down[] = {{ 0.61,0.93 },1}; + }; + }; + class Ammo_RKT + { + type = "group"; + condition = "rocket"; + class Ammo_count_RKT + { + type = "text"; + source = "ammo"; + sourceScale = 1; + align = "right"; + scale = 1; + pos[] = {{ 0.61,0.89 },1}; + right[] = {{ 0.65,0.89 },1}; + down[] = {{ 0.61,0.93 },1}; + }; + }; + class Ammo_AGM + { + type = "group"; + condition = "AAmissile"; + class Ammo_count_AGM + { + type = "text"; + source = "ammo"; + sourceScale = 1; + align = "right"; + scale = 1; + pos[] = {{ 0.61,0.89 },1}; + right[] = {{ 0.65,0.89 },1}; + down[] = {{ 0.61,0.93 },1}; + }; + }; + class Ammo_AAM + { + type = "group"; + condition = "ATmissile"; + class Ammo_count_AAM + { + type = "text"; + source = "ammo"; + sourceScale = 1; + align = "right"; + scale = 1; + pos[] = {{ 0.61,0.89 },1}; + right[] = {{ 0.65,0.89 },1}; + down[] = {{ 0.61,0.93 },1}; + }; + }; + class Ammo_Bomb + { + type = "group"; + condition = "Bomb"; + class Ammo_count_Bomb + { + type = "text"; + source = "ammo"; + sourceScale = 1; + align = "right"; + scale = 1; + pos[] = {{ 0.61,0.89 },1}; + right[] = {{ 0.65,0.89 },1}; + down[] = {{ 0.61,0.93 },1}; + }; + }; + class LightsGroup + { + type = "group"; + condition = "lights"; + class LightsText + { + type = "text"; + source = "static"; + text = "LIGHTS"; + align = "right"; + scale = 1; + pos[] = {{ 0.03,"0.53 + 0.055" },1}; + right[] = {{ 0.07,"0.53 + 0.055" },1}; + down[] = {{ 0.03,"0.53 + 0.095" },1}; + }; + }; + class CollisionLightsGroup + { + type = "group"; + condition = "collisionlights"; + class CollisionLightsText + { + type = "text"; + source = "static"; + text = "A-COL"; + align = "right"; + scale = 1; + pos[] = {{ 0.03,"0.53 + 0.105" },1}; + right[] = {{ 0.07,"0.53 + 0.105" },1}; + down[] = {{ 0.03,"0.53 + 0.145" },1}; + }; + }; + class GearGroup + { + type = "group"; + condition = "ils"; + class GearText + { + type = "text"; + source = "static"; + text = "GEAR"; + align = "right"; + scale = 1; + pos[] = {{ 0.03,"0.53 + 0.155" },1}; + right[] = {{ 0.07,"0.53 + 0.155" },1}; + down[] = {{ 0.03,"0.53 + 0.195" },1}; + }; + }; + class ATMissileTOFGroup + { + condition = "ATmissile"; + type = "group"; + class TOFtext + { + type = "text"; + align = "right"; + source = "static"; + text = "TOF="; + scale = 1; + pos[] = {{ 0.61,0.92 },1}; + right[] = {{ 0.65,0.92 },1}; + down[] = {{ 0.61,0.96 },1}; + }; + class TOFnumber + { + type = "text"; + source = "targetDist"; + sourcescale = 0.0025; + align = "right"; + scale = 1; + pos[] = {{ 0.69,0.92 },1}; + right[] = {{ 0.73,0.92 },1}; + down[] = {{ 0.69,0.96 },1}; + }; + }; + class LaserTOFGroup + { + condition = "Bomb"; + type = "group"; + class TOFtext + { + type = "text"; + align = "right"; + source = "static"; + text = "TOF="; + scale = 1; + pos[] = {{ 0.61,0.92 },1}; + right[] = {{ 0.65,0.92 },1}; + down[] = {{ 0.61,0.96 },1}; + }; + class TOFnumber + { + type = "text"; + source = "targetDist"; + sourcescale = 0.0025; + align = "right"; + scale = 1; + pos[] = {{ 0.69,0.92 },1}; + right[] = {{ 0.73,0.92 },1}; + down[] = {{ 0.69,0.96 },1}; + }; + }; + class RocketTOFGroup + { + condition = "Rocket"; + type = "group"; + class TOFtext + { + type = "text"; + align = "right"; + source = "static"; + text = "TOF="; + scale = 1; + pos[] = {{ 0.61,0.92 },1}; + right[] = {{ 0.65,0.92 },1}; + down[] = {{ 0.61,0.96 },1}; + }; + class TOFnumber + { + type = "text"; + source = "targetDist"; + sourcescale = 0.0025; + align = "right"; + scale = 1; + pos[] = {{ 0.69,0.92 },1}; + right[] = {{ 0.73,0.92 },1}; + down[] = {{ 0.69,0.96 },1}; + }; + }; + class RangeNumber + { + type = "text"; + source = "targetDist"; + sourceScale = 1; + align = "left"; + scale = 1; + pos[] = {{ 0.39,0.89 },1}; + right[] = {{ 0.43,0.89 },1}; + down[] = {{ 0.39,0.93 },1}; + }; + class RangeText + { + type = "text"; + source = "static"; + text = "RNG"; + align = "left"; + scale = 1; + pos[] = {{ 0.39,0.86 },1}; + right[] = {{ 0.43,0.86 },1}; + down[] = {{ 0.39,0.9 },1}; + }; + class SpeedNumber + { + type = "text"; + align = "right"; + scale = 1; + source = "speed"; + sourceScale = 3.6; + pos[] = {{ 0.03,0.475 },1}; + right[] = {{ 0.08,0.475 },1}; + down[] = {{ 0.03,0.525 },1}; + }; + class TorqueNumber + { + condition = "simulRTD"; + class Torque_number + { + type = "text"; + align = "left"; + scale = 1; + source = "rtdRotorTorque"; + sourceScale = 290; + pos[] = {{ 0.065,0.175 },1}; + right[] = {{ 0.115,0.175 },1}; + down[] = {{ 0.065,0.225 },1}; + }; + class Torquetext + { + type = "text"; + source = "static"; + text = "%"; + align = "right"; + scale = 1; + pos[] = {{ 0.07,0.175 },1}; + right[] = {{ 0.12,0.175 },1}; + down[] = {{ 0.07,0.225 },1}; + }; + }; + class AltNumber: SpeedNumber + { + align = "right"; + source = "altitudeAGL"; + sourceScale = 1; + pos[] = {{ 0.83,0.475 },1}; + right[] = {{ 0.88,0.475 },1}; + down[] = {{ 0.83,0.525 },1}; + }; + class ASLNumber + { + type = "text"; + source = "altitudeASL"; + sourceScale = 1; + align = "right"; + scale = 1; + pos[] = {{ 0.835,0.18 },1}; + right[] = {{ 0.875,0.18 },1}; + down[] = {{ 0.835,0.22 },1}; + }; + class VspeedScalePosta + { + type = "line"; + width = 5; + points[] = {{ { 0.98,0.2 },1 },{ { 1,0.2 },1 },{ },{ { 0.93,0.2 },1 },{ { 0.95,0.2 },1 },{ },{ { 0.98,0.35 },1 },{ { 1,0.35 },1 },{ },{ { 0.93,0.35 },1 },{ { 0.95,0.35 },1 },{ },{ { 0.94,0.38 },1 },{ { 0.95,0.38 },1 },{ },{ { 0.94,0.41 },1 },{ { 0.95,0.41 },1 },{ },{ { 0.94,0.44 },1 },{ { 0.95,0.44 },1 },{ },{ { 0.94,0.47 },1 },{ { 0.95,0.47 },1 },{ },{ { 0.98,0.5 },1 },{ { 1,0.5 },1 },{ },{ { 0.93,0.5 },1 },{ { 0.95,0.5 },1 },{ },{ { 0.94,0.53 },1 },{ { 0.95,0.53 },1 },{ },{ { 0.94,0.56 },1 },{ { 0.95,0.56 },1 },{ },{ { 0.94,0.59 },1 },{ { 0.95,0.59 },1 },{ },{ { 0.94,0.62 },1 },{ { 0.95,0.62 },1 },{ },{ { 0.98,0.65 },1 },{ { 1,0.65 },1 },{ },{ { 0.93,0.65 },1 },{ { 0.95,0.65 },1 },{ },{ { 0.99,0.68 },1 },{ { 0.98,0.68 },1 },{ },{ { 0.99,0.71 },1 },{ { 0.98,0.71 },1 },{ },{ { 0.99,0.74 },1 },{ { 0.98,0.74 },1 },{ },{ { 0.99,0.77 },1 },{ { 0.98,0.77 },1 },{ },{ { 0.98,0.8 },1 },{ { 1,0.8 },1 },{ },{ { 0.93,0.8 },1 },{ { 0.95,0.8 },1 },{ }}; + }; + class RadarAltitudeBand + { + clipTL[] = {0,0.2}; + clipBR[] = {1,0.8}; + hideValue = 201; + class radarbanda + { + type = "line"; + width = 17; + points[] = {{ "RadarAltitudeBone",{ 0,0 },1 },{ "RadarAltitudeBone",{ 0,0.6 },1 }}; + }; + }; + class VspeedBand + { + type = "line"; + width = 3; + points[] = {{ "VspeedBone",{ -0.01,0 },1 },{ "VspeedBone",{ -0.025,-0.015 },1 },{ "VspeedBone",{ -0.025,0.015 },1 },{ "VspeedBone",{ -0.01,0 },1 },{ }}; + }; + class HeadingNumber: SpeedNumber + { + source = "heading"; + sourceScale = 1; + align = "center"; + pos[] = {{ 0.5,0.045 },1}; + right[] = {{ 0.56,0.045 },1}; + down[] = {{ 0.5,"0.045 + 0.06" },1}; + }; + class Center_box + { + type = "line"; + width = 1.5; + points[] = {{ { 0.45,"0.02 + 0.085 - 0.06" },1 },{ { "0.45 + 0.10","0.02 + 0.085 - 0.06" },1 },{ { "0.45 + 0.10","0.02 + 0.085" },1 },{ { 0.45,"0.02 + 0.085" },1 },{ { 0.45,"0.02 + 0.085 - 0.06" },1 }}; + }; + class HeadingArrow + { + type = "line"; + width = 7; + points[] = {{ { "0.5","0.128 + 0.03" },1 },{ { 0.5,0.128 },1 }}; + }; + class HeadingScale_LEFT + { + clipTL[] = {0,0}; + clipBR[] = {0.45,1}; + class Heading_group + { + type = "scale"; + horizontal = 1; + source = "heading"; + sourceScale = 1; + width = 5; + top = 0.12; + center = 0.5; + bottom = 0.88; + lineXleft = "0.03 + 0.085"; + lineYright = "0.02 + 0.085"; + lineXleftMajor = "0.04 + 0.085"; + lineYrightMajor = "0.02 + 0.085"; + majorLineEach = 3; + numberEach = 3; + step = 10; + stepSize = "0.05"; + align = "center"; + scale = 1; + pos[] = {0.12,"0.0 + 0.065"}; + right[] = {0.16,"0.0 + 0.065"}; + down[] = {0.12,"0.04 + 0.065"}; + }; + }; + class HeadingScale_RIGHT + { + clipTL[] = {0.55,0}; + clipBR[] = {1,1}; + class Heading_group + { + type = "scale"; + horizontal = 1; + source = "heading"; + sourceScale = 1; + width = 5; + top = 0.12; + center = 0.5; + bottom = 0.88; + lineXleft = "0.03 + 0.085"; + lineYright = "0.02 + 0.085"; + lineXleftMajor = "0.04 + 0.085"; + lineYrightMajor = "0.02 + 0.085"; + majorLineEach = 3; + numberEach = 3; + step = 10; + stepSize = "0.05"; + align = "center"; + scale = 1; + pos[] = {0.12,"0.0 + 0.065"}; + right[] = {0.16,"0.0 + 0.065"}; + down[] = {0.12,"0.04 + 0.065"}; + }; + }; + class HeadingScale_BOTTOM + { + clipTL[] = {0.45,"0.02 + 0.085"}; + clipBR[] = {"0.45 + 0.10",1}; + class Heading_group + { + type = "scale"; + horizontal = 1; + source = "heading"; + sourceScale = 1; + width = 5; + top = 0.12; + center = 0.5; + bottom = 0.88; + lineXleft = "0.03 + 0.085"; + lineYright = "0.02 + 0.085"; + lineXleftMajor = "0.04 + 0.085"; + lineYrightMajor = "0.02 + 0.085"; + majorLineEach = 3; + numberEach = 3; + step = 10; + stepSize = "0.05"; + align = "center"; + scale = 1; + pos[] = {0.12,"0.0 + 0.065"}; + right[] = {0.16,"0.0 + 0.065"}; + down[] = {0.12,"0.04 + 0.065"}; + }; + }; + class Fuel_Text + { + type = "text"; + source = "static"; + text = "Fuel"; + align = "right"; + scale = 1; + pos[] = {{ 0.03,0.9 },1}; + right[] = {{ 0.07,0.9 },1}; + down[] = {{ 0.03,0.94 },1}; + }; + class Fuel_Number + { + type = "text"; + source = "fuel"; + sourceScale = 100; + align = "right"; + scale = 1; + pos[] = {{ 0.1,0.9 },1}; + right[] = {{ 0.14,0.9 },1}; + down[] = {{ 0.1,0.94 },1}; + }; + }; + helmetMountedDisplay = 1; + helmetPosition[] = {-0.04,0.04,0.1}; + helmetRight[] = {0.08,0,0}; + helmetDown[] = {0,-0.08,0}; + }; + class ACE_HUD_2 + { + topLeft = "HUD_top_left"; + topRight = "HUD_top_right"; + bottomLeft = "HUD_bottom_left"; + borderLeft = 0; + borderRight = 0; + borderTop = 0; + borderBottom = 0; + color[] = {0.15,1,0.15,1}; + enableParallax = 0; + class Bones + { + class Velocity + { + type = "vector"; + source = "velocity"; + pos0[] = {0.5,0.5}; + pos10[] = {0.75,0.75}; + }; + class ForwardVec1 + { + type = "vector"; + source = "forward"; + pos0[] = {0,0}; + pos10[] = {0.25,0.25}; + }; + class ForwardVec + { + type = "vector"; + source = "forward"; + pos0[] = {0,0}; + pos10[] = {0.253,0.253}; + }; + class WeaponAim + { + type = "vector"; + source = "weapon"; + pos0[] = {0.5,0.5}; + pos10[] = {0.753,0.753}; + }; + class WeaponAim1 + { + type = "vector"; + source = "weapon"; + pos0[] = {0,0}; + pos10[] = {0.253,0.23}; + }; + class Target + { + type = "vector"; + source = "target"; + pos0[] = {0.5,0.5}; + pos10[] = {0.753,0.753}; + }; + class RadarContact + { + type = "fixed"; + pos[] = {0,0}; + }; + }; + class Draw + { + color[] = {0.18,1,0.18}; + alpha = 1; + condition = "on"; + class PlaneMovementCrosshair + { + type = "line"; + width = 7; + points[] = {{ "ForwardVec1",1,"Velocity",1,{ 0,-0.02 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0.01,-0.01732 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0.01732,-0.01 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0.02,0 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0.01732,0.01 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0.01,0.01732 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0,0.02 },1 },{ "ForwardVec1",1,"Velocity",1,{ -0.01,0.01732 },1 },{ "ForwardVec1",1,"Velocity",1,{ -0.01732,0.01 },1 },{ "ForwardVec1",1,"Velocity",1,{ -0.02,0 },1 },{ "ForwardVec1",1,"Velocity",1,{ -0.01732,-0.01 },1 },{ "ForwardVec1",1,"Velocity",1,{ -0.01,-0.01732 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0,-0.02 },1 },{ },{ "ForwardVec1",1,"Velocity",1,{ 0.04,0 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0.02,0 },1 },{ },{ "ForwardVec1",1,"Velocity",1,{ -0.04,0 },1 },{ "ForwardVec1",1,"Velocity",1,{ -0.02,0 },1 },{ },{ "ForwardVec1",1,"Velocity",1,{ 0,-0.04 },1 },{ "ForwardVec1",1,"Velocity",1,{ 0,-0.02 },1 }}; + }; + class Gunner_AIM + { + type = "group"; + class Circle + { + type = "line"; + width = 6; + points[] = {{ "ForwardVec",1,"WeaponAim",1,{ 0,-0.015 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0,-0.03 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ 0,-0.0325 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0,-0.0475 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ 0,0.015 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0,0.03 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ 0,0.0325 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0,0.0475 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ -0.015,0 },1 },{ "ForwardVec",1,"WeaponAim",1,{ -0.03,0 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ -0.0325,0 },1 },{ "ForwardVec",1,"WeaponAim",1,{ -0.0475,0 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ 0.015,0 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0.03,0 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ 0.0325,0 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0.0475,0 },1 }}; + }; + }; + class GunCross + { + condition = "mgun"; + class Circle + { + type = "line"; + width = 9; + points[] = {{ "ForwardVec",1,"WeaponAim",1,{ 0,-0.05 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0,-0.015 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ 0,0.015 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0,0.05 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ -0.05,0 },1 },{ "ForwardVec",1,"WeaponAim",1,{ -0.015,0 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ 0.015,0 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0.05,0 },1 },{ }}; + }; + }; + class RocketCross + { + condition = "rocket"; + width = 6; + class Circle + { + type = "line"; + width = 6; + points[] = {{ "ForwardVec",1,"WeaponAim",1,{ -0.05,-0.08 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0.05,-0.08 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ 0,-0.08 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0,0.08 },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ -0.05,0.08 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0.05,0.08 },1 },{ }}; + }; + }; + class AT_Aim + { + condition = "ATmissile"; + width = 2; + class Circle + { + type = "line"; + width = 2; + points[] = {{ "ForwardVec",1,"WeaponAim",1,{ -0.1,-0.1 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0.1,-0.1 },1 },{ "ForwardVec",1,"WeaponAim",1,{ 0.1,0.1 },1 },{ "ForwardVec",1,"WeaponAim",1,{ -0.1,0.1 },1 },{ "ForwardVec",1,"WeaponAim",1,{ -0.1,-0.1 },1 }}; + }; + }; + class AA_aim + { + condition = "AAmissile"; + class Circle + { + type = "line"; + width = 2.5; + points[] = {{ "ForwardVec",1,"WeaponAim",1,{ "0 / 4","-0.248559 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.0434 / 4","-0.244781 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.0855 / 4","-0.233571 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.125 / 4","-0.215252 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.1607 / 4","-0.190396 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.1915 / 4","-0.159774 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.2165 / 4","-0.12428 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.234925 / 4","-0.0850072 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.2462 / 4","-0.0431499 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.25 / 4","0 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.2462 / 4","0.0431499 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.234925 / 4","0.0850072 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.2165 / 4","0.12428 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.1915 / 4","0.159774 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.1607 / 4","0.190396 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.125 / 4","0.215252 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.0855 / 4","0.233571 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.0434 / 4","0.244781 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0 / 4","0.248559 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.0434 / 4","0.244781 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.0855 / 4","0.233571 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.125 / 4","0.215252 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.1607 / 4","0.190396 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.1915 / 4","0.159774 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.2165 / 4","0.12428 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.234925 / 4","0.0850072 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.2462 / 4","0.0431499 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.25 / 4","0 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.2462 / 4","-0.0431499 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.234925 / 4","-0.0850072 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.2165 / 4","-0.12428 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.1915 / 4","-0.159774 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.1607 / 4","-0.190396 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.125 / 4","-0.215252 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.0855 / 4","-0.233571 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.0434 / 4","-0.244781 / 4" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0 / 4","-0.248559 / 4" },1 },{ },{ "ForwardVec",1,"WeaponAim",1,{ "0 / 2","-0.248559 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.0434 / 2","-0.244781 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.0855 / 2","-0.233571 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.125 / 2","-0.215252 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.1607 / 2","-0.190396 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.1915 / 2","-0.159774 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.2165 / 2","-0.12428 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.234925 / 2","-0.0850072 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.2462 / 2","-0.0431499 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.25 / 2","0 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.2462 / 2","0.0431499 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.234925 / 2","0.0850072 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.2165 / 2","0.12428 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.1915 / 2","0.159774 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.1607 / 2","0.190396 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.125 / 2","0.215252 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.0855 / 2","0.233571 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0.0434 / 2","0.244781 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0 / 2","0.248559 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.0434 / 2","0.244781 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.0855 / 2","0.233571 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.125 / 2","0.215252 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.1607 / 2","0.190396 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.1915 / 2","0.159774 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.2165 / 2","0.12428 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.234925 / 2","0.0850072 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.2462 / 2","0.0431499 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.25 / 2","0 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.2462 / 2","-0.0431499 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.234925 / 2","-0.0850072 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.2165 / 2","-0.12428 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.1915 / 2","-0.159774 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.1607 / 2","-0.190396 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.125 / 2","-0.215252 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.0855 / 2","-0.233571 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "-0.0434 / 2","-0.244781 / 2" },1 },{ "ForwardVec",1,"WeaponAim",1,{ "0 / 2","-0.248559 / 2" },1 }}; + }; + }; + class TargetACQ + { + type = "line"; + width = 2; + points[] = {{ "ForwardVec",1,"target",{ 0,-0.06 },1 },{ "ForwardVec",1,"target",{ 0,-0.055 },1 },{ },{ "ForwardVec",1,"target",{ 0,-0.05 },1 },{ "ForwardVec",1,"target",{ 0,-0.045 },1 },{ },{ "ForwardVec",1,"target",{ 0,-0.04 },1 },{ "ForwardVec",1,"target",{ 0,-0.035 },1 },{ },{ "ForwardVec",1,"target",{ 0,-0.03 },1 },{ "ForwardVec",1,"target",{ 0,-0.025 },1 },{ },{ "ForwardVec",1,"target",{ 0,-0.02 },1 },{ "ForwardVec",1,"target",{ 0,-0.015 },1 },{ },{ "ForwardVec",1,"target",{ 0,-0.01 },1 },{ "ForwardVec",1,"target",{ 0,-0.005 },1 },{ },{ "ForwardVec",1,"target",{ 0,0 },1 },{ "ForwardVec",1,"target",{ 0,0 },1 },{ },{ "ForwardVec",1,"target",{ 0,0.06 },1 },{ "ForwardVec",1,"target",{ 0,0.055 },1 },{ },{ "ForwardVec",1,"target",{ 0,0.05 },1 },{ "ForwardVec",1,"target",{ 0,0.045 },1 },{ },{ "ForwardVec",1,"target",{ 0,0.04 },1 },{ "ForwardVec",1,"target",{ 0,0.035 },1 },{ },{ "ForwardVec",1,"target",{ 0,0.03 },1 },{ "ForwardVec",1,"target",{ 0,0.025 },1 },{ },{ "ForwardVec",1,"target",{ 0,0.02 },1 },{ "ForwardVec",1,"target",{ 0,0.015 },1 },{ },{ "ForwardVec",1,"target",{ 0,0.01 },1 },{ "ForwardVec",1,"target",{ 0,0.005 },1 },{ },{ "ForwardVec",1,"target",{ -0.06,0 },1 },{ "ForwardVec",1,"target",{ -0.055,0 },1 },{ },{ "ForwardVec",1,"target",{ -0.05,0 },1 },{ "ForwardVec",1,"target",{ -0.045,0 },1 },{ },{ "ForwardVec",1,"target",{ -0.04,0 },1 },{ "ForwardVec",1,"target",{ -0.035,0 },1 },{ },{ "ForwardVec",1,"target",{ -0.03,0 },1 },{ "ForwardVec",1,"target",{ -0.025,0 },1 },{ },{ "ForwardVec",1,"target",{ -0.02,0 },1 },{ "ForwardVec",1,"target",{ -0.015,0 },1 },{ },{ "ForwardVec",1,"target",{ -0.01,0 },1 },{ "ForwardVec",1,"target",{ -0.005,0 },1 },{ },{ "ForwardVec",1,"target",{ 0.06,0 },1 },{ "ForwardVec",1,"target",{ 0.055,0 },1 },{ },{ "ForwardVec",1,"target",{ 0.05,0 },1 },{ "ForwardVec",1,"target",{ 0.045,0 },1 },{ },{ "ForwardVec",1,"target",{ 0.04,0 },1 },{ "ForwardVec",1,"target",{ 0.035,0 },1 },{ },{ "ForwardVec",1,"target",{ 0.03,0 },1 },{ "ForwardVec",1,"target",{ 0.025,0 },1 },{ },{ "ForwardVec",1,"target",{ 0.02,0 },1 },{ "ForwardVec",1,"target",{ 0.015,0 },1 },{ },{ "ForwardVec",1,"target",{ 0.01,0 },1 },{ "ForwardVec",1,"target",{ 0.005,0 },1 },{ }}; + }; + class RadarTargets + { + type = "radar"; + pos0[] = {0.5,0.5}; + pos10[] = {0.753,0.753}; + width = 2.5; + points[] = {{ "ForwardVec",1,"RadarContact",{ -0.01,-0.01 },1 },{ "ForwardVec",1,"RadarContact",{ 0.01,-0.01 },1 },{ "ForwardVec",1,"RadarContact",{ 0.01,0.01 },1 },{ "ForwardVec",1,"RadarContact",{ -0.01,0.01 },1 },{ "ForwardVec",1,"RadarContact",{ -0.01,-0.01 },1 }}; + }; + }; + helmetMountedDisplay = 1; + helmetPosition[] = {-0.035,0.035,0.1}; + helmetRight[] = {0.07,0,0}; + helmetDown[] = {0,-0.07,0}; + }; + }; + + class Turrets: Turrets { + class MainTurret: MainTurret { + 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; + startEngine = 0; + minElev = -51; + maxElev = 9; + initElev = 6; + minTurn = -120; + maxTurn = 120; + initTurn = 0; + + class OpticsIn + { + class Wide + { + 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","NVG","Ti"}; + thermalMode[] = {0,1}; + gunnerOpticsColor[] = {0,0,0,1}; + directionStabilized = 1; + horizontallyStabilized = 1; + gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_wide_F"; + }; + class Medium: Wide + { + opticsDisplayName = "M"; + initFov = 0.093; + minFov = 0.093; + maxFov = 0.093; + gunnerOpticsColor[] = {0,0,0,1}; + 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}; + directionStabilized = 1; + horizontallyStabilized = 1; + gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_narrow_F"; + + }; + class Narrower: Wide + { + 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 + { + class Monocular + { + initAngleX = 0; + minAngleX = -30; + maxAngleX = 30; + initAngleY = 0; + minAngleY = -100; + maxAngleY = 100; + initFov = 1.1; + minFov = 0.133; + maxFov = 1.1; + visionMode[] = {"Normal","NVG"}; + gunnerOpticsModel = ""; + gunnerOpticsEffect[] = {}; + hideUnitInfo = 1; + }; + }; + }; + }; + + class AnimationSources: AnimationSources { + class Gatling { + weapon = "ACE_gatling_20mm_Comanche"; + }; + class Muzzle_flash { + weapon = "ACE_gatling_20mm_Comanche"; + }; + }; +}; \ No newline at end of file diff --git a/addons/aircraft/README.md b/addons/aircraft/README.md index b212d311b9..1049493f45 100644 --- a/addons/aircraft/README.md +++ b/addons/aircraft/README.md @@ -3,6 +3,7 @@ ace_aircraft Changes to air weaponry, flightmodels and HUDs. +* Contributations by Kimi (geraldbolso1899) for HUD updates ## Maintainers @@ -10,3 +11,4 @@ The people responsible for merging changes to this component or answering potent - [KoffeinFlummi](https://github.com/KoffeinFlummi) - [commy2](https://github.com/commy2) +- [jaynus](https://github.com/walterpearce) \ No newline at end of file diff --git a/addons/aircraft/RscInGameUI.hpp b/addons/aircraft/RscInGameUI.hpp new file mode 100644 index 0000000000..620d895d9e --- /dev/null +++ b/addons/aircraft/RscInGameUI.hpp @@ -0,0 +1,581 @@ +class RscControlsGroup; +class RscText; +class RangeText: RscText{}; +class RscPicture; +class RscOpticsText; +class RscIGProgress; +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_IGUI_elements_group","CA_VehicleToggles"}; + class VScrollbar; + class HScrollbar; + class CA_IGUI_elements_group: RscControlsGroup + { + idc = 170; + class VScrollbar: VScrollbar + { + width = 0; + }; + class HScrollbar: HScrollbar + { + height = 0; + }; + x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))"; + y = "0 * (0.025 * SafezoneH) + (SafezoneY)"; + w = "53.5 * (0.01875 * SafezoneH)"; + h = "40 * (0.025 * SafezoneH)"; + class controls + { + class CA_Distance: RscText + { + idc = 151; + style = 2; + sizeEx = "0.0295*SafezoneH"; + shadow = 0; + font = "EtelkaMonospacePro"; + x = "24.78 * (0.01875 * SafezoneH)"; + y = "30.88 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; + }; + class CA_Speed: RangeText + { + idc = 188; + style = 2; + sizeEx = "0.0295*SafezoneH"; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "120"; + x = "14.78 * (0.01875 * SafezoneH)"; + y = "30.88 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; + }; + class CA_Alt: RangeText + { + idc = 189; + style = 2; + sizeEx = "0.0295*SafezoneH"; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "3825"; + x = "34.78 * (0.01875 * SafezoneH)"; + y = "30.88 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; + }; + class CA_VisionMode: RscText + { + idc = 152; + style = 0; + sizeEx = "0.0295*SafezoneH"; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "VIS"; + x = "12.58 * (0.01875 * SafezoneH)"; + y = "8 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; + }; + class CA_FlirMode: RscText + { + idc = 153; + style = 0; + sizeEx = "0.0295*SafezoneH"; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "BHOT"; + x = "15.78 * (0.01875 * SafezoneH)"; + y = "8 * (0.025 * SafezoneH)"; + w = "4.5 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; + }; + class ValueGrid: RangeText + { + idc = 172; + font = "EtelkaMonospacePro"; + style = 2; + sizeEx = "0.0295*SafezoneH"; + shadow = 0; + x = "12.20 * (0.01875 * SafezoneH)"; + y = "3.5 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class TextTADS: RangeText + { + idc = 1010; + text = "TADS"; + font = "EtelkaMonospacePro"; + style = 2; + shadow = 0; + x = "12.30 * (0.01875 * SafezoneH)"; + y = "5 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; + }; + class ValueTime: RangeText + { + idc = 190; + text = "20:28:35"; + font = "EtelkaMonospacePro"; + style = 2; + sizeEx = "0.0295*SafezoneH"; + shadow = 0; + x = "12.1 * (0.01875 * SafezoneH)"; + y = "6.5 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class CA_Laser: RscText + { + idc = 158; + style = "0x30 + 0x800"; + sizeEx = "0.038*SafezoneH"; + shadow = 0; + font = "EtelkaMonospacePro"; + text = PATHTOF(data\Helo_LaserON.paa); + x = "20.45 * (0.01875 * SafezoneH)"; + y = "14.1 * (0.025 * SafezoneH)"; + w = "12.5 * (0.01875 * SafezoneH)"; + h = "12 * (0.025 * SafezoneH)"; + }; + class CA_Heading: RscText + { + idc = 156; + style = 0; + sizeEx = "0.038*SafezoneH"; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "023"; + x = "24.83 * (0.01875 * SafezoneH)"; + y = "6 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; + }; + }; + }; + }; + class Rsc_ACE_Helo_UI_01: RscUnitInfo + { + controls[] = {"WeaponInfoControlsGroupRight","CA_TextFlaresMode","CA_TextFlares","CA_VehicleToggles","CA_Radar"}; + }; + class Rsc_ACE_Helo_UI_02: RscUnitInfo + { + controls[] = {"CA_TextFlaresMode","CA_TextFlares","CA_VehicleToggles","CA_Radar"}; + }; + class Rsc_ACE_Drones_UI_Turret: RscUnitInfo + { + idd = 300; + controls[] = {"CA_Zeroing","CA_IGUI_elements_group","CA_VehicleToggles"}; + class CA_IGUI_elements_group: RscControlsGroup + { + idc = 170; + class VScrollbar: VScrollbar + { + width = 0; + }; + class HScrollbar: HScrollbar + { + height = 0; + }; + x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))"; + y = "0 * (0.025 * SafezoneH) + (SafezoneY)"; + w = "53.5 * (0.01875 * SafezoneH)"; + h = "40 * (0.025 * SafezoneH)"; + class controls + { + class CA_Distance: RscText + { + idc = 151; + style = 2; + sizeEx = "0.0295*SafezoneH"; + shadow = 0; + font = "EtelkaMonospacePro"; + x = "24.78 * (0.01875 * SafezoneH)"; + y = "30.88 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; + }; + class CA_Speed: RangeText + { + idc = 188; + style = 2; + sizeEx = "0.0295*SafezoneH"; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "120"; + x = "14.78 * (0.01875 * SafezoneH)"; + y = "30.88 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; + }; + class CA_Alt: RangeText + { + idc = 189; + style = 2; + sizeEx = "0.0295*SafezoneH"; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "3825"; + x = "34.78 * (0.01875 * SafezoneH)"; + y = "30.88 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; + }; + class ValueTime: RangeText + { + idc = 190; + text = "20:28:35"; + font = "EtelkaMonospacePro"; + style = 2; + sizeEx = "0.0295*SafezoneH"; + shadow = 0; + x = "1.75 * (0.01875 * SafezoneH)"; + y = "10.5 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class CA_VisionMode: RscText + { + idc = 152; + style = 0; + sizeEx = "0.0295*SafezoneH"; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "VIS"; + align = "right"; + x = "2.6 * (0.01875 * SafezoneH)"; + y = "12.0 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.0 * (0.025 * SafezoneH)"; + }; + class CA_FlirMode: RscText + { + idc = 153; + style = 0; + sizeEx = "0.0295*SafezoneH"; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "BHOT"; + align = "right"; + x = "6.18 * (0.01875 * SafezoneH)"; + y = "12.0 * (0.025 * SafezoneH)"; + w = "4.5 * (0.01875 * SafezoneH)"; + h = "1.0 * (0.025 * SafezoneH)"; + }; + class TgT_Grid_text: RangeText + { + idc = 1005; + text = "TGT:"; + font = "EtelkaMonospacePro"; + style = 2; + sizeEx = "0.0295*SafezoneH"; + shadow = 0; + x = "1.20 * (0.01875 * SafezoneH)"; + y = "13.5 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class TGT_ValueGrid: RangeText + { + idc = 172; + font = "EtelkaMonospacePro"; + colorText[] = {0.706,0.0745,0.0196,0.8}; + style = 2; + sizeEx = "0.0295*SafezoneH"; + shadow = 0; + x = "5.20 * (0.01875 * SafezoneH)"; + y = "13.5 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class OWN_Grid_text: RangeText + { + idc = 1005; + text = "OWN:"; + font = "EtelkaMonospacePro"; + style = 2; + sizeEx = "0.0295*SafezoneH"; + shadow = 0; + x = "1.20 * (0.01875 * SafezoneH)"; + y = "15 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class OWN_ValueGrid: RangeText + { + idc = 171; + font = "EtelkaMonospacePro"; + colorText[] = {0.15,1,0.15,0.8}; + style = 2; + sizeEx = "0.0295*SafezoneH"; + shadow = 0; + x = "5.20 * (0.01875 * SafezoneH)"; + y = "15 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class CA_Laser: RscText + { + idc = 158; + style = "0x30 + 0x800"; + sizeEx = "0.038*SafezoneH"; + shadow = 0; + align = "right"; + font = "EtelkaMonospacePro"; + text = PATHTOF(data\Helo_LaserON.paa); + x = "20.45 * (0.01875 * SafezoneH)"; + y = "14.1 * (0.025 * SafezoneH)"; + w = "12.5 * (0.01875 * SafezoneH)"; + h = "12 * (0.025 * SafezoneH)"; + }; + class CA_Heading: RscText + { + idc = 156; + style = 0; + sizeEx = "0.038*SafezoneH"; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "023"; + align = "right"; + x = "25 * (0.01875 * SafezoneH)"; + y = "5 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; + }; + }; + }; + }; + class Rsc_ACE_Drones_UI_Pilots: RscUnitInfo + { + idd = 300; + controls[] = {"WeaponInfoControlsGroupRight","CA_BackgroundVehicle","CA_BackgroundVehicleTitle","CA_BackgroundVehicleTitleDark","CA_BackgroundFuel","CA_Vehicle","CA_VehicleRole","CA_HitZones","CA_SpeedBackground","CA_SpeedUnits","CA_Speed","CA_ValueFuel","CA_AltBackground","CA_AltUnits","CA_Alt","CA_VehicleToggles","CA_Radar","DriverOpticsGroup"}; + class DriverOpticsGroup: RscControlsGroup + { + idc = 392; + class VScrollbar: VScrollbar + { + width = 0; + }; + class HScrollbar: HScrollbar + { + height = 0; + }; + x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))"; + y = "0 * (0.025 * SafezoneH) + (SafezoneY)"; + w = "53.5 * (0.01875 * SafezoneH)"; + h = "40 * (0.025 * SafezoneH)"; + class controls + { + class TextGrid: RscText + { + style = 0; + sizeEx = "0.02*SafezoneH"; + shadow = 0; + font = "EtelkaMonospacePro"; + idc = 1005; + text = "GRID:"; + x = "5.8 * (0.01875 * SafezoneH)"; + y = "31.8 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class ValueGrid: TextGrid + { + idc = 189; + text = "382546"; + x = "10.3 * (0.01875 * SafezoneH)"; + y = "31.8 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class TextTime: TextGrid + { + idc = 1010; + text = "TIME [UTC]:"; + x = "5.8 * (0.01875 * SafezoneH)"; + y = "32.6 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class ValueTime: TextGrid + { + idc = 101; + text = "20:28:35"; + x = "10 * (0.01875 * SafezoneH)"; + y = "32.6 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class TextMag: TextGrid + { + idc = 1011; + text = "CAM MAG:"; + x = "5.8 * (0.01875 * SafezoneH)"; + y = "7 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class OpticsZoom: TextGrid + { + idc = 192; + text = "28x"; + x = "10.3 * (0.01875 * SafezoneH)"; + y = "7 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class BorderLineSpdTop: RscPicture + { + idc = 1203; + text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\border_line_ca.paa"; + x = "3.343 * (0.01875 * SafezoneH)"; + y = "12.4 * (0.025 * SafezoneH)"; + w = "3 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class BorderLineSpdBottom: RscPicture + { + idc = 1207; + text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\border_line_ca.paa"; + x = "3.343 * (0.01875 * SafezoneH)"; + y = "26.5 * (0.025 * SafezoneH)"; + w = "3 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class BorderLineAltTop: RscPicture + { + idc = 1205; + text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\border_line_ca.paa"; + x = "47.16 * (0.01875 * SafezoneH)"; + y = "12.4 * (0.025 * SafezoneH)"; + w = "3 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class BorderLineAltBottom: RscPicture + { + idc = 1206; + text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\border_line_ca.paa"; + x = "47.16 * (0.01875 * SafezoneH)"; + y = "26.5 * (0.025 * SafezoneH)"; + w = "3 * (0.01875 * SafezoneH)"; + h = "1 * (0.025 * SafezoneH)"; + }; + class TextSpd: TextGrid + { + idc = 1004; + text = "SPD"; + x = "4.8 * (0.01875 * SafezoneH)"; + y = "11.8 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; + }; + class SpeedValueBorder: RscPicture + { + idc = 1200; + text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\altimeter_value_ca.paa"; + x = "6.3 * (0.01875 * SafezoneH)"; + y = "19 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "2 * (0.025 * SafezoneH)"; + }; + class CA_Speed: TextGrid + { + idc = 190; + sizeEx = "0.03*SafezoneH"; + text = "120"; + x = "7.5 * (0.01875 * SafezoneH)"; + y = "19.5 * (0.025 * SafezoneH)"; + w = "6 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; + }; + class AnalogueSpeed: RscLadderPicture + { + idc = 384; + topValue = 1312; + bottomValue = -345; + visibleRange = -1; + text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\UAVspeedLadder_ca.paa"; + x = "1.5 * (0.01875 * SafezoneH)"; + y = "13 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "14 * (0.025 * SafezoneH)"; + }; + class TextAlt: TextGrid + { + idc = 1006; + text = "ALT"; + x = "46.9 * (0.01875 * SafezoneH)"; + y = "11.8 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; + }; + class AltValueBorder: RscPicture + { + idc = 1201; + text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\airspeed_value_ca.paa"; + x = "42.25 * (0.01875 * SafezoneH)"; + y = "19 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "2 * (0.025 * SafezoneH)"; + }; + class CA_Alt: TextGrid + { + idc = 191; + sizeEx = "0.03*SafezoneH"; + style = 1; + text = "3825"; + x = "43 * (0.01875 * SafezoneH)"; + y = "19.5 * (0.025 * SafezoneH)"; + w = "3.2 * (0.01875 * SafezoneH)"; + h = "1.2 * (0.025 * SafezoneH)"; + }; + class AnalogueAlt: RscLadderPicture + { + idc = 385; + topValue = 14430; + bottomValue = -2110; + visibleRange = -1; + text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\UAValtLadder_ca.paa"; + x = "47 * (0.01875 * SafezoneH)"; + y = "13 * (0.025 * SafezoneH)"; + w = "2.5 * (0.01875 * SafezoneH)"; + h = "14 * (0.025 * SafezoneH)"; + }; + class AnalogueHorizon: RscLadderPicture + { + idc = 383; + topValue = 90; + bottomValue = -90; + visibleRange = -1; + text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\horizon_ladder_ca.paa"; + x = "16.75 * (0.01875 * SafezoneH)"; + y = "5 * (0.025 * SafezoneH)"; + w = "20 * (0.01875 * SafezoneH)"; + h = "30 * (0.025 * SafezoneH)"; + }; + class HorizonCenter: RscPicture + { + idc = 1202; + text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\horizon_aircraft_ca.paa"; + x = "24.75 * (0.01875 * SafezoneH)"; + y = "19 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "2 * (0.025 * SafezoneH)"; + }; + }; + }; + }; +}; \ No newline at end of file diff --git a/addons/aircraft/config.cpp b/addons/aircraft/config.cpp index 86135c4bc9..2ce2d0dc10 100644 --- a/addons/aircraft/config.cpp +++ b/addons/aircraft/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - author[] = {"KoffeinFlummi","Crusty","commy2"}; + author[] = {"KoffeinFlummi","Crusty","commy2","jaynus","Kimi"}; authorUrl = "https://github.com/KoffeinFlummi/"; VERSION_CONFIG; }; @@ -16,3 +16,4 @@ class CfgPatches { #include "CfgMagazines.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" +#include "RscInGameUI.hpp" \ No newline at end of file diff --git a/addons/aircraft/data/Helo_LaserON.paa b/addons/aircraft/data/Helo_LaserON.paa new file mode 100644 index 0000000000..3a3459e699 Binary files /dev/null and b/addons/aircraft/data/Helo_LaserON.paa differ diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index a8b73052dc..3703514fb6 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -94,7 +94,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment _unit removeAction _actionID; if (GVAR(placeAction) == 1) then { - _startingPosition = _tempObject modelToWorld [0,0,0]; + _startingPosition = _tempObject modelToWorldVisual [0,0,0]; [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _startingPosition] call FUNC(placeApprove); }; deleteVehicle _tempObject; diff --git a/addons/attach/functions/fnc_canAttach.sqf b/addons/attach/functions/fnc_canAttach.sqf index 966794b32f..d0930dc069 100644 --- a/addons/attach/functions/fnc_canAttach.sqf +++ b/addons/attach/functions/fnc_canAttach.sqf @@ -25,6 +25,6 @@ _itemName = [_args, 0, ""] call CBA_fnc_defaultParam; _attachLimit = [6, 1] select (_player == _attachToVehicle); _attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; -_playerPos = (ACE_player modelToWorld (ACE_player selectionPosition "pilot")); +_playerPos = (ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot")); (canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemName in ((itemsWithMagazines _player) + [""])}; diff --git a/addons/attach/functions/fnc_placeApprove.sqf b/addons/attach/functions/fnc_placeApprove.sqf index 576721cf59..60c5e3a9bf 100644 --- a/addons/attach/functions/fnc_placeApprove.sqf +++ b/addons/attach/functions/fnc_placeApprove.sqf @@ -45,7 +45,7 @@ while {(_closeInMax - _closeInMin) > 0.01} do { // systemChat format ["Trying %1 from %2 start %3", _closeInDistance, [_closeInMax, _closeInMin], _startDistanceFromCenter]; _endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance); _endPosTestOffset set [2, (_startingOffset select 2)]; - _endPosTest = _attachToVehicle modelToWorld _endPosTestOffset; + _endPosTest = _attachToVehicle modelToWorldVisual _endPosTestOffset; _doesIntersect = false; { 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/backpacks/functions/fnc_backpackOpened.sqf b/addons/backpacks/functions/fnc_backpackOpened.sqf index 186202027f..1894d68f23 100644 --- a/addons/backpacks/functions/fnc_backpackOpened.sqf +++ b/addons/backpacks/functions/fnc_backpackOpened.sqf @@ -37,7 +37,7 @@ _sounds = [ QUOTE(PATHTO_R(sounds\zip_out.wav)) ]; -_position = _target modelToWorld (_target selectionPosition "Spine3"); +_position = _target modelToWorldVisual (_target selectionPosition "Spine3"); _position = _position call EFUNC(common,positionToASL); playSound3D [ diff --git a/addons/ballistics/CfgAmmo.hpp b/addons/ballistics/CfgAmmo.hpp new file mode 100644 index 0000000000..79f99c33a4 --- /dev/null +++ b/addons/ballistics/CfgAmmo.hpp @@ -0,0 +1,20 @@ +class CfgAmmo { + class BulletCore; + + class BulletBase: BulletCore { + timeToLive = 15; // Default: 6, doubleplusgood all munition range. + }; + + class B_20mm : BulletBase { + timeToLive = 30; + }; + class B_25mm : BulletBase { + timeToLive = 30; + }; + class B_35mm_AA : BulletBase { + timeToLive = 30; + }; + class B_30mm_AP : BulletBase { + timeToLive = 30; + }; +}; \ No newline at end of file diff --git a/addons/ballistics/config.cpp b/addons/ballistics/config.cpp index c526b0f7d4..4b9944364c 100644 --- a/addons/ballistics/config.cpp +++ b/addons/ballistics/config.cpp @@ -14,3 +14,4 @@ class CfgPatches { #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" +#include "CfgAmmo.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/captives/functions/fnc_handleOnUnconscious.sqf b/addons/captives/functions/fnc_handleOnUnconscious.sqf index 1924b6bb47..9aa4856204 100644 --- a/addons/captives/functions/fnc_handleOnUnconscious.sqf +++ b/addons/captives/functions/fnc_handleOnUnconscious.sqf @@ -18,9 +18,6 @@ EXPLODE_2_PVT(_this,_unit,_isUnconc); -diag_log "handleOnUnconscious"; -diag_log _this; -diag_log _unit; if (!local _unit) exitWith {}; if (_isUnconc) then { diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 345bc7873c..95a639b943 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -73,6 +73,16 @@ PREP(getStringFromMissionSQM); PREP(getTargetAzimuthAndInclination); PREP(getTargetDistance); PREP(getTargetObject); +PREP(getTurnedOnLights); +PREP(getTurretCommander); +PREP(getTurretConfigPath); +PREP(getTurretCopilot); +PREP(getTurretGunner); +PREP(getTurretIndex); +PREP(getTurrets); +PREP(getTurretsFFV); +PREP(getTurretsOther); +PREP(getTurretDirection); PREP(getUavControlPosition); PREP(getVehicleCargo); PREP(getVehicleCodriver); @@ -102,6 +112,7 @@ PREP(isModLoaded); PREP(isPlayer); PREP(isTurnedOut); PREP(letterToCode); +PREP(lightIntensityFromObject); PREP(loadPerson); PREP(loadPersonLocal); PREP(loadSettingsFromProfile); @@ -113,6 +124,7 @@ PREP(moveToTempGroup); PREP(muteUnit); PREP(numberToDigits); PREP(numberToDigitsString); +PREP(numberToString); PREP(onAnswerRequest); PREP(onLoadRscDisplayChannel); PREP(owned); @@ -179,6 +191,8 @@ PREP(getConfigGunner); PREP(getConfigCommander); PREP(getHitPoints); PREP(getHitPointsWithSelections); +PREP(getReflectorsWithSelections); +PREP(getLightProperties); 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_addToInventory.sqf b/addons/common/functions/fnc_addToInventory.sqf index 4e088525fc..b28d864df8 100644 --- a/addons/common/functions/fnc_addToInventory.sqf +++ b/addons/common/functions/fnc_addToInventory.sqf @@ -57,7 +57,7 @@ switch ((_type select 0)) do { }; } else { _addedToPlayer = false; - _pos = _unit modelToWorld [0,1,0.05]; + _pos = _unit modelToWorldVisual [0,1,0.05]; _unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"]; _unit addWeaponCargoGlobal [_classname,1]; _unit setPosATL _pos; @@ -73,7 +73,7 @@ switch ((_type select 0)) do { }; } else { _addedToPlayer = false; - _pos = _unit modelToWorld [0,1,0.05]; + _pos = _unit modelToWorldVisual [0,1,0.05]; _unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"]; _unit addMagazineCargoGlobal [_classname, 1]; _unit setPosATL _pos; @@ -89,7 +89,7 @@ switch ((_type select 0)) do { }; } else { _addedToPlayer = false; - _pos = _unit modelToWorld [0,1,0.05]; + _pos = _unit modelToWorldVisual [0,1,0.05]; _unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"]; _unit addItemCargoGlobal [_classname,1]; _unit setPosATL _pos; 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_canGetInPosition.sqf b/addons/common/functions/fnc_canGetInPosition.sqf index 5ac4c527fd..f4337b6171 100644 --- a/addons/common/functions/fnc_canGetInPosition.sqf +++ b/addons/common/functions/fnc_canGetInPosition.sqf @@ -242,10 +242,10 @@ _fnc_isInRange = { private ["_unitPosition", "_distance"]; _unitPosition = getPos _unit; - _distance = _unitPosition distance (_vehicle modelToWorld _selectionPosition); + _distance = _unitPosition distance (_vehicle modelToWorldVisual _selectionPosition); if (!isNil "_selectionPosition2") then { - _distance = _distance min (_unitPosition distance (_vehicle modelToWorld _selectionPosition2)); + _distance = _distance min (_unitPosition distance (_vehicle modelToWorldVisual _selectionPosition2)); }; _distance < _radius 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_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_getTurretDirection.sqf b/addons/common/functions/fnc_getTurretDirection.sqf new file mode 100644 index 0000000000..fb265bf545 --- /dev/null +++ b/addons/common/functions/fnc_getTurretDirection.sqf @@ -0,0 +1,37 @@ +/* + * Author: jaynus + * + * Get the absolute turret direction for FOV/PIP turret. + * + * Argument: + * 0: Vehicle (Object) + * 1: Turret Position + * + * Return value: + * [position, direction] + */ +#include "script_component.hpp" + +EXPLODE_2_PVT(_this,_vehicle,_position); +private ["_turrets", "_turret", "_config", "_turret", "_povPos", "_povDir", "_gunBeginPos", "_gunEndPos", "_pov"]; + +_turret = [_vehicle, _position] call CBA_fnc_getTurret; +_pov = getText (_turret >> "memoryPointGunnerOptics"); +_gunBeg = getText (_turret >> "gunBeg"); +_gunEnd = getText (_turret >> "gunEnd"); +TRACE_3("", _pov, _gunBeg, _gunEnd); + +// Pull the PIP pov or barrel direction, depending on how the model is set up +_povPos = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition _pov ) ); +_povDir = [0,0,0]; + +if(_pov == "pip0_pos") then { + _pipDir = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition "pip0_dir" ) ); + _povDir = _pipDir vectorDiff _povPos; +} else { + _gunBeginPos = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition _gunBeg ) ); + _gunEndPos = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition _gunEnd ) ); + _povDir = _gunBeginPos vectorDiff _gunEndPos; +}; + +[_povPos, _povDir] \ No newline at end of file diff --git a/addons/common/functions/fnc_inWater.sqf b/addons/common/functions/fnc_inWater.sqf index ea511d388d..2fdede1737 100644 --- a/addons/common/functions/fnc_inWater.sqf +++ b/addons/common/functions/fnc_inWater.sqf @@ -14,7 +14,7 @@ private ["_unit","_return","_aslPos"]; _unit = _this select 0; _return = false; if ((surfaceIsWater getPos _unit)) then { - _aslPos = _unit modelToWorld (_unit selectionPosition "head"); + _aslPos = _unit modelToWorldVisual (_unit selectionPosition "head"); if ((_aslPos select 2) <= 0) then { _return = true; }; diff --git a/addons/common/functions/fnc_lightIntensityFromObject.sqf b/addons/common/functions/fnc_lightIntensityFromObject.sqf new file mode 100644 index 0000000000..cf9e215403 --- /dev/null +++ b/addons/common/functions/fnc_lightIntensityFromObject.sqf @@ -0,0 +1,56 @@ +/* + * 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 ["_lights", "_lightLevel"]; + +_lights = [_lightSource] call FUNC(getTurnedOnLights); + +_lightLevel = 0; + +{ + 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_loadSettingsOnServer.sqf b/addons/common/functions/fnc_loadSettingsOnServer.sqf index 2548c44bec..9255d047b3 100644 --- a/addons/common/functions/fnc_loadSettingsOnServer.sqf +++ b/addons/common/functions/fnc_loadSettingsOnServer.sqf @@ -15,52 +15,38 @@ GVAR(settings) = []; -// Load settings from main config -_countOptions = count (configFile >> "ACE_Settings"); -for "_index" from 0 to (_countOptions - 1) do { - _optionEntry = (configFile >> "ACE_Settings") select _index; +_parseConfigForSettings = { + private ["_config", "_countOptions", "_optionEntry", "_index"]; - [_optionEntry] call FUNC(setSettingFromConfig); -}; -// Check if all settings should be forced -if (GVAR(forceAllSettings)) then { - { - _x set [6, true]; - } forEach GVAR(settings); -}; - -// @todo -// Load settings from server userconfig only if the ACE_ServerSettings is loaded -/*if (isClass (configFile >> "CfgPatches" >> "ACE_ServerSettings")) then { - DFUNC(serverUserConfig) = compile preprocessFileLineNumbers "\userconfig\ACE\ACE_Settings.hpp"; - if !(isNil DFUNC(serverUserConfig)) then { - [] call FUNC(serverUserConfig); + _config = _this select 0; + _countOptions = count _config; + for "_index" from 0 to (_countOptions - 1) do { + _optionEntry = _config select _index; + [_optionEntry] call FUNC(setSettingFromConfig); }; // Check if all settings should be forced if (GVAR(forceAllSettings)) then { { - if !(missionNamespace getVariable format ["%1_forced", _x]) then { - missionNamespace setVariable format ["%1_forced", _x, true]; - publicVariable format ["%1_forced", _name]; - }; - } forEach GVAR(settingsList); + _x set [6, true]; + } forEach GVAR(settings); }; -};*/ - -// Load settings from mission config -_countOptions = count (missionConfigFile >> "ACE_Settings"); -for "_index" from 0 to (_countOptions - 1) do { - _optionEntry = (missionConfigFile >> "ACE_Settings") select _index; - - [_optionEntry] call FUNC(setSettingFromConfig); -}; -// Check if all settings should be forced -if (GVAR(forceAllSettings)) then { - { - _x set [6, true]; - } forEach GVAR(settings); }; +// Order is this way because: +// ACE_Settings should never force any setting by default. Loading it first ensures that all settings from ACE_Settings exist. +// This way, ACE_ServerSettings will override ACE_Settings, even if no force is used. +// Mission settings will override the server config settings, if no force is used. +// This ensures that all settings are of their correct type, in case an outdated or corrupt server config is used , as well as have their correct localized display name and description + +// Regular config +[configFile >> "ACE_Settings"] call _parseConfigForSettings; + +// Server config +[configFile >> "ACE_ServerSettings"] call _parseConfigForSettings; + +// mission side settings +[missionConfigFile >> "ACE_Settings"] call _parseConfigForSettings; + // Publish all settings data publicVariable QGVAR(settings); // Publish all setting values 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_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index 2037dfc3f0..ee72dc9aa7 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -36,7 +36,7 @@ if (_target isKindOf "CAManBase") then { // add height offset of model private "_offset"; - _offset = (_target modelToWorld [0, 0, 0] select 2) - (_unit modelToWorld [0, 0, 0] select 2); + _offset = (_target modelToWorldVisual [0, 0, 0] select 2) - (_unit modelToWorldVisual [0, 0, 0] select 2); _position = _position vectorAdd [0, 0, _offset]; diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index f614af9548..35f8687ed0 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -25,7 +25,7 @@ _direction = _target getVariable [QGVAR(dragDirection), 0]; // add height offset of model private "_offset"; -_offset = (_target modelToWorld [0, 0, 0] select 2) - (_unit modelToWorld [0, 0, 0] select 2); +_offset = (_target modelToWorldVisual [0, 0, 0] select 2) - (_unit modelToWorldVisual [0, 0, 0] select 2); _position = _position vectorAdd [0, 0, _offset]; 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/dragging/functions/fnc_handleScrollWheel.sqf b/addons/dragging/functions/fnc_handleScrollWheel.sqf index 0782e64db7..96f46413bc 100644 --- a/addons/dragging/functions/fnc_handleScrollWheel.sqf +++ b/addons/dragging/functions/fnc_handleScrollWheel.sqf @@ -36,7 +36,7 @@ if (_carriedItem isKindOf "CAManBase") exitWith {false}; private ["_position", "_maxHeight"]; _position = getPosATL _carriedItem; -_maxHeight = (_unit ModelToWorld [0,0,0]) select 2; +_maxHeight = (_unit modelToWorldVisual [0,0,0]) select 2; _position set [2, ((_position select 2) + _scrollAmount min (_maxHeight + 1.5)) max _maxHeight]; 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_dialingPhone.sqf b/addons/explosives/functions/fnc_dialingPhone.sqf index d3c429c9fc..fa992a9cac 100644 --- a/addons/explosives/functions/fnc_dialingPhone.sqf +++ b/addons/explosives/functions/fnc_dialingPhone.sqf @@ -19,7 +19,7 @@ #include "script_component.hpp" EXPLODE_4_PVT(_this select 0,_unit,_i,_arr,_code); if ((_i mod 4) == 0) then { - playSound3D [QUOTE(PATHTO_R(Data\Audio\DialTone.wss)), objNull, false, (_unit ModelToWorld [0,0.2,2]), 15,1,2.5]; + playSound3D [QUOTE(PATHTO_R(Data\Audio\DialTone.wss)), objNull, false, (_unit modelToWorldVisual [0,0.2,2]), 15,1,2.5]; }; ctrlSetText [1400,format["Calling%1",_arr select (_i - 4)]]; 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 1e1ac44bdf..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 modelToWorld [0,0.5, 0.1], 134, - * "SatchelCharge_Remote_Mag", "Command", []] call ACE_Explosives_fnc_placeExplosive; + * _explosive = [player, player modelToWorldVisual [0,0.5, 0.1], 134, + * "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/XEH_clientInit.sqf b/addons/fcs/XEH_clientInit.sqf index 17faa70f17..094a49faeb 100644 --- a/addons/fcs/XEH_clientInit.sqf +++ b/addons/fcs/XEH_clientInit.sqf @@ -5,3 +5,6 @@ GVAR(time) = 0; GVAR(position) = [0,0,0]; #include "initKeybinds.sqf" + +// Register event for global updates +[QGVAR(forceUpdate), FUNC(onForceUpdate)] call ace_common_fnc_addEventHandler; \ No newline at end of file diff --git a/addons/fcs/XEH_preInit.sqf b/addons/fcs/XEH_preInit.sqf index 78a2fd091c..8fdc43df11 100644 --- a/addons/fcs/XEH_preInit.sqf +++ b/addons/fcs/XEH_preInit.sqf @@ -10,6 +10,7 @@ PREP(firedEH); PREP(getAngle); PREP(getRange); PREP(handleAirBurstAmmunitionPFH); +PREP(onForceUpdate); PREP(keyDown); PREP(keyUp); PREP(reset); 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 d33bd08893..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"]; +private ["_vehicle", "_turret", "_turretConfig", "_distance", "_magazines", "_showHint", "_playSound"]; _vehicle = _this select 0; _turret = _this select 1; @@ -46,7 +46,9 @@ if (_weaponDirection isEqualTo [0,0,0]) then { // dummy value for non main turr _angleTarget = asin (_weaponDirection select 2); if (count _this > 2) then { - _distance = _this select 2; + if((_this select 2) > -1) then { + _distance = _this select 2; + }; }; if (!(isNil QGVAR(backgroundCalculation)) and {!(scriptDone GVAR(backgroundCalculation))}) then { @@ -160,4 +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); -[format ["%1: %2", localize "STR_ACE_FCS_ZeroedTo", _distance]] call EFUNC(common,displayTextStructured); +_showHint = false; +if( (count _this) > 3) then { + _showHint = _this select 3; +}; + +_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 new file mode 100644 index 0000000000..6f477fd3f6 --- /dev/null +++ b/addons/fcs/functions/fnc_onForceUpdate.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" + +if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; +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, 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_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf index 077a9239f0..9a20962a8f 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -28,24 +28,22 @@ if((count _this) > 2) then { _pos = _this select 2; } else { if(typeName (_actionData select 7) == "ARRAY") then { - _pos = _object modelToWorld (_actionData select 7); + _pos = _object modelToWorldVisual (_actionData select 7); } else { if ((_actionData select 7) == "weapon") then { // Craft a suitable position for weapon interaction _weaponDir = _object weaponDirection currentWeapon _object; _ref = _weaponDir call EFUNC(common,createOrthonormalReference); - _pos = (_object modelToWorld (_object selectionPosition "righthand")) vectorAdd ((_ref select 2) vectorMultiply 0.1); + _pos = (_object modelToWorldVisual (_object selectionPosition "righthand")) vectorAdd ((_ref select 2) vectorMultiply 0.1); } else { - _pos = _object modelToWorld (_object selectionPosition (_actionData select 7)); + _pos = _object modelToWorldVisual (_object selectionPosition (_actionData select 7)); }; }; - // Compensate for movement during the frame to get rid of jittering - _pos = _pos vectorAdd ((visiblePositionASL _object) vectorDiff (getPosASL _object)); }; // For non-self actions, exit if the action is too far away if (GVAR(openedMenuType) == 0 && vehicle ACE_player == ACE_player && - {(ACE_player modelToWorld (ACE_player selectionPosition "pilot")) distance _pos >= _distance}) exitWith {false}; + {(ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot")) distance _pos >= _distance}) exitWith {false}; // Exit if the action is behind you _sPos = if (count _pos != 2) then { 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/CfgEventhandlers.hpp b/addons/laser/CfgEventhandlers.hpp index 1fcfc0244f..bad89fd048 100644 --- a/addons/laser/CfgEventhandlers.hpp +++ b/addons/laser/CfgEventhandlers.hpp @@ -1,11 +1,11 @@ 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)); + }; }; diff --git a/addons/laser/CfgVehicles.hpp b/addons/laser/CfgVehicles.hpp index 1c5887bd38..07b8055f0e 100644 --- a/addons/laser/CfgVehicles.hpp +++ b/addons/laser/CfgVehicles.hpp @@ -1,9 +1,9 @@ class CfgVehicles { - class All; + class All; - class LaserTarget: All { - class EventHandlers { - init = QUOTE(_this call FUNC(laser_init)); - }; - }; + class LaserTarget: All { + class EventHandlers { + init = QUOTE(_this call FUNC(laser_init)); + }; + }; }; \ No newline at end of file diff --git a/addons/laser/XEH_pre_init.sqf b/addons/laser/XEH_pre_init.sqf index 8a4b3166b8..8b39c429b6 100644 --- a/addons/laser/XEH_pre_init.sqf +++ b/addons/laser/XEH_pre_init.sqf @@ -14,7 +14,7 @@ PREP(translateToWeaponSpace); PREP(laser_init); -GVAR(laser) = nil; // a single hud draws 1 laser at a time +GVAR(laser) = nil; // a single hud draws 1 laser at a time PREP(laserTargetPFH); diff --git a/addons/laser/config.cpp b/addons/laser/config.cpp index 711bd743b6..4b209b866e 100644 --- a/addons/laser/config.cpp +++ b/addons/laser/config.cpp @@ -1,13 +1,13 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { "ace_common" }; - VERSION_CONFIG; - }; + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { "ace_common" }; + VERSION_CONFIG; + }; }; #include "CfgEventhandlers.hpp" diff --git a/addons/laser/functions/fnc_checkLos.sqf b/addons/laser/functions/fnc_checkLos.sqf index f0df153887..9888642a80 100644 --- a/addons/laser/functions/fnc_checkLos.sqf +++ b/addons/laser/functions/fnc_checkLos.sqf @@ -7,7 +7,7 @@ _designator = _this select 2; _seeker = _this select 3; _spacing = 100; if((count _this) > 4) then { - _spacing = _this select 4; + _spacing = _this select 4; }; _return = true; @@ -21,11 +21,11 @@ _pos2 = [(_pos2 select 0) + _x, (_pos2 select 1) + _y, (_pos2 select 2) + _z]; // player sideChat format["new los check"]; if(terrainIntersect [_pos2, _pos1]) then { - _return = false; + _return = false; } else { - if(lineIntersects [_pos2, _pos1]) then { // should take as arguments and add to this command objects to exclude - target and observer - // player sideChat format["with: %1", lineIntersectsWith [_pos1, _pos2]]; - _return = false; - }; + if(lineIntersects [_pos2, _pos1]) then { // should take as arguments and add to this command objects to exclude - target and observer + // player sideChat format["with: %1", lineIntersectsWith [_pos1, _pos2]]; + _return = false; + }; }; _return; \ No newline at end of file diff --git a/addons/laser/functions/fnc_findLaserDesignator.sqf b/addons/laser/functions/fnc_findLaserDesignator.sqf index 8a2e4caf29..d10e221501 100644 --- a/addons/laser/functions/fnc_findLaserDesignator.sqf +++ b/addons/laser/functions/fnc_findLaserDesignator.sqf @@ -1,70 +1,70 @@ #include "script_component.hpp" private ["_missile", "_headingPitch", "_found", "_vectorTo", "_polarTo", "_dir", "_vertOk", "_horzOk", "_fov", - "_closestDistance", "_pos1", "_pos2", "_disCheck", "_currentTarget", "_potentialTargets", "_offset", "_vector"]; + "_closestDistance", "_pos1", "_pos2", "_disCheck", "_currentTarget", "_potentialTargets", "_offset", "_vector"]; _missile = _this select 0; _laserCode = _this select 1; _fov = if (count _this > 2) then {_this select 2} else {75}; _vector = if (count _this > 3) then {_this select 3} else {vectorDir _missile}; _offset = if (count _this > 4) then {_this select 4} else {[0,0,0]}; -_headingPitch = _vector call CBA_fnc_vect2polar; +_headingPitch = _vector call CBA_fnc_vect2polar; _currentTarget = nil; _found = false; LOG("Searching lasers"); if(!(isNil "ACE_LASERS")) then { - _potentialTargets = []; - TRACE_1("", ACE_LASERS); - - { - if(!(isNull _x)) then { - _sensorPos = ATLtoASL(_missile modelToWorld _offset); - _vectorTo = [_sensorPos, ([_x] call FUNC(getPosASL))] call BIS_fnc_vectorFromXToY; - _polarTo = _vectorTo call CBA_fnc_vect2polar; - _dir = _polarTo select 1; - _dir = _dir - (_headingPitch select 1); - - TRACE_4("Calc", _sensorPos, _vectorTo, _polarTo, _dir); - - if (_dir < 0) then {_dir = _dir + 360}; - if (_dir > 360) then {_dir = _dir - 360}; - _vertOk = false; - _horzOk = false; - if(_dir < _fov || {_dir > (360-_fov)}) then { - _horzOk = true; - }; - if(abs((abs(_polarTo select 2))-(abs(_headingPitch select 2))) < _fov) then { - _vertOk = true; - }; - - TRACE_2("Results", _vertOk, _horzOk); - - if(_vertOk && {_horzOk}) then { - // Does the laser currently have our current code, if we have one? - _targetCode = _x getVariable ["ACE_LASERTARGET_CODE", ACE_DEFAULT_LASER_CODE]; - TRACE_1("Target in sight, checking code", _targetCode, _laserCode); - if(_targetCode == _laserCode) then { - _potentialTargets set[(count _potentialTargets), _x]; - }; - }; - }; - - } forEach ACE_LASERS; - - TRACE_1("", _potentialTargets); - - _closestDistance = 100000; - { - _pos1 = (getPosASL _missile); - _pos2 = ([_x] call FUNC(getPosASL)); - _disCheck = _pos1 distance _pos2; - // shouldn't this bail out when a valid target is found instead of iterating over all potential targets ? - if(_disCheck < _closestDistance && {[_pos1, _pos2, _x, _missile] call FUNC(checkLos)}) then { - _found = true; - _currentTarget = _x; - _closestDistance = _disCheck; - }; - } forEach _potentialTargets; + _potentialTargets = []; + TRACE_1("", ACE_LASERS); + + { + if(!(isNull _x)) then { + _sensorPos = ATLtoASL(_missile modelToWorldVisual _offset); + _vectorTo = [_sensorPos, ([_x] call FUNC(getPosASL))] call BIS_fnc_vectorFromXToY; + _polarTo = _vectorTo call CBA_fnc_vect2polar; + _dir = _polarTo select 1; + _dir = _dir - (_headingPitch select 1); + + TRACE_4("Calc", _sensorPos, _vectorTo, _polarTo, _dir); + + if (_dir < 0) then {_dir = _dir + 360}; + if (_dir > 360) then {_dir = _dir - 360}; + _vertOk = false; + _horzOk = false; + if(_dir < _fov || {_dir > (360-_fov)}) then { + _horzOk = true; + }; + if(abs((abs(_polarTo select 2))-(abs(_headingPitch select 2))) < _fov) then { + _vertOk = true; + }; + + TRACE_2("Results", _vertOk, _horzOk); + + if(_vertOk && {_horzOk}) then { + // Does the laser currently have our current code, if we have one? + _targetCode = _x getVariable ["ACE_LASERTARGET_CODE", ACE_DEFAULT_LASER_CODE]; + TRACE_1("Target in sight, checking code", _targetCode, _laserCode); + if(_targetCode == _laserCode) then { + _potentialTargets set[(count _potentialTargets), _x]; + }; + }; + }; + + } forEach ACE_LASERS; + + TRACE_1("", _potentialTargets); + + _closestDistance = 100000; + { + _pos1 = (getPosASL _missile); + _pos2 = ([_x] call FUNC(getPosASL)); + _disCheck = _pos1 distance _pos2; + // shouldn't this bail out when a valid target is found instead of iterating over all potential targets ? + if(_disCheck < _closestDistance && {[_pos1, _pos2, _x, _missile] call FUNC(checkLos)}) then { + _found = true; + _currentTarget = _x; + _closestDistance = _disCheck; + }; + } forEach _potentialTargets; }; [_found, _currentTarget] \ No newline at end of file diff --git a/addons/laser/functions/fnc_findStrongestRay.sqf b/addons/laser/functions/fnc_findStrongestRay.sqf index db85ce8b3d..e4238361cb 100644 --- a/addons/laser/functions/fnc_findStrongestRay.sqf +++ b/addons/laser/functions/fnc_findStrongestRay.sqf @@ -7,43 +7,43 @@ _outliers = []; _spot = []; _testPos = (_list select 0) select 0; { - _samplePos = _x select 0; - if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then { - if(_samplePos distance _testPos < 2) then { - _spot pushBack _samplePos; - } else { - _outliers pushBack _samplePos; - }; - }; + _samplePos = _x select 0; + if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then { + if(_samplePos distance _testPos < 2) then { + _spot pushBack _samplePos; + } else { + _outliers pushBack _samplePos; + }; + }; } forEach _list; _spots pushBack _spot; if(count _outliers > 0) then { - for "_i" from 1 to 3 do { - _remainingSpots = _outliers; - _outliers = []; - _spot = []; - _testPos = (_remainingSpots select 0); - { - _samplePos = _x; - if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then { - if(_samplePos distance _testPos < 2) then { - _spot pushBack _samplePos; - } else { - _outliers pushBack _samplePos; - }; - }; - } forEach _remainingSpots; - _spots pushBack _spot; - }; + for "_i" from 1 to 3 do { + _remainingSpots = _outliers; + _outliers = []; + _spot = []; + _testPos = (_remainingSpots select 0); + { + _samplePos = _x; + if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then { + if(_samplePos distance _testPos < 2) then { + _spot pushBack _samplePos; + } else { + _outliers pushBack _samplePos; + }; + }; + } forEach _remainingSpots; + _spots pushBack _spot; + }; }; _largest = 0; _largestSpot = []; { - if((count _x) > _largest) then { - _largest = (count _x); - _largestSpot = _x; - }; + if((count _x) > _largest) then { + _largest = (count _x); + _largestSpot = _x; + }; } forEach _spots; // player sideChat format["g: %1", _spots]; _largestSpot select (random (floor(count _largestSpot))); \ No newline at end of file diff --git a/addons/laser/functions/fnc_laserTargetPFH.sqf b/addons/laser/functions/fnc_laserTargetPFH.sqf index bf526f464e..bdab413685 100644 --- a/addons/laser/functions/fnc_laserTargetPFH.sqf +++ b/addons/laser/functions/fnc_laserTargetPFH.sqf @@ -6,8 +6,8 @@ _args = _this select 0; _laserTarget = _args select 0; if(isNull _laserTarget || !alive player) exitWith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - REM(ACE_LASERS, _laserTarget); + [(_this select 1)] call cba_fnc_removePerFrameHandler; + REM(ACE_LASERS, _laserTarget); }; _end = diag_tickTime; @@ -18,8 +18,8 @@ _pos = [_laserTarget] call FUNC(getPosASL); drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLtoATL _pos), 0.75, 0.75, 0, "", 0.5, 0.025, "TahomaB"]; { - drawLine3D [ASLtoATL (_x select 0), ASLtoATL (_x select 1), (_x select 2)]; - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", (_x select 2), ASLtoATL (_x select 1), 0.75, 0.75, 0, "", 0.5, 0.025, "TahomaB"]; + drawLine3D [ASLtoATL (_x select 0), ASLtoATL (_x select 1), (_x select 2)]; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", (_x select 2), ASLtoATL (_x select 1), 0.75, 0.75, 0, "", 0.5, 0.025, "TahomaB"]; } forEach DRAW_LINES; DRAW_LINES = []; #endif diff --git a/addons/laser/functions/fnc_laser_init.sqf b/addons/laser/functions/fnc_laser_init.sqf index 4c6b0b5f2a..9fcb439032 100644 --- a/addons/laser/functions/fnc_laser_init.sqf +++ b/addons/laser/functions/fnc_laser_init.sqf @@ -16,10 +16,10 @@ REM(ACE_LASERS, objNull); if(!(local _laserTarget)) exitWith { }; // The target is local, so its on this client if(!isDedicated) then { - _laserTarget setVariable ["ACE_LASERTARGET_SHOOTER", player, true]; - - [FUNC(laserTargetPFH), 0, [_laserTarget, player]] call cba_fnc_addPerFrameHandler; + _laserTarget setVariable ["ACE_LASERTARGET_SHOOTER", player, true]; + + [FUNC(laserTargetPFH), 0, [_laserTarget, player]] call cba_fnc_addPerFrameHandler; } else { - // server side ownership of laser - //_laserTarget setVariable ["ACE_LASERTARGET_SHOOTER", nil, false]; + // server side ownership of laser + //_laserTarget setVariable ["ACE_LASERTARGET_SHOOTER", nil, false]; }; diff --git a/addons/laser/functions/fnc_shootCone.sqf b/addons/laser/functions/fnc_shootCone.sqf index 8d2d7fef66..e33edd10bc 100644 --- a/addons/laser/functions/fnc_shootCone.sqf +++ b/addons/laser/functions/fnc_shootCone.sqf @@ -17,50 +17,50 @@ _vecRotateMap = [_cp, _p1, _p2] call FUNC(rotateVectLineGetMap); _result = [_pos, _vec] call FUNC(shootRay); _resultPos = _result select 0; if(!isNil "_resultPos") then { - _distance = _result select 1; - if(_distance < _shortestReturn) then { - _shortestReturn = _distance; - }; - if(_distance > _longestReturn) then { - _longestReturn = _distance; - }; - _resultPositions set[(count _resultPositions), _result]; + _distance = _result select 1; + if(_distance < _shortestReturn) then { + _shortestReturn = _distance; + }; + if(_distance > _longestReturn) then { + _longestReturn = _distance; + }; + _resultPositions set[(count _resultPositions), _result]; #ifdef DEBUG_MODE_FULL - DRAW_LINES set[(count DRAW_LINES), [_pos, _resultPos, [0, 1, 0, 1]]]; + DRAW_LINES set[(count DRAW_LINES), [_pos, _resultPos, [0, 1, 0, 1]]]; #endif }; _count = 8; _pos2 = [ - (_pos select 0)+((_vec select 0)*1000), - (_pos select 1)+((_vec select 1)*1000), - (_pos select 2)+((_vec select 2)*1000) - ]; + (_pos select 0)+((_vec select 0)*1000), + (_pos select 1)+((_vec select 1)*1000), + (_pos select 2)+((_vec select 2)*1000) + ]; { - for "_i" from 0 to ceil(_count*_x) do { - _radOffset = random 360; - _offset = [_vecRotateMap, (((360/_count)*_i)+_radOffset) mod 360] call FUNC(rotateVectLine); - _offsetPos = [ - (_pos2 select 0)+((_offset select 0)*(_divergence*_x)), - (_pos2 select 1)+((_offset select 1)*(_divergence*_x)), - (_pos2 select 2)+((_offset select 2)*(_divergence*_x)) - ]; - _offsetVector = [_pos, _offsetPos] call BIS_fnc_vectorFromXtoY; - _result = [_pos, _offsetVector] call FUNC(shootRay); - _resultPos = _result select 0; - if(!isNil "_resultPos") then { - _distance = _result select 1; - if(_distance < _shortestReturn) then { - _shortestReturn = _distance; - }; - if(_distance > _longestReturn) then { - _longestReturn = _distance; - }; - _resultPositions set[(count _resultPositions), _result]; + for "_i" from 0 to ceil(_count*_x) do { + _radOffset = random 360; + _offset = [_vecRotateMap, (((360/_count)*_i)+_radOffset) mod 360] call FUNC(rotateVectLine); + _offsetPos = [ + (_pos2 select 0)+((_offset select 0)*(_divergence*_x)), + (_pos2 select 1)+((_offset select 1)*(_divergence*_x)), + (_pos2 select 2)+((_offset select 2)*(_divergence*_x)) + ]; + _offsetVector = [_pos, _offsetPos] call BIS_fnc_vectorFromXtoY; + _result = [_pos, _offsetVector] call FUNC(shootRay); + _resultPos = _result select 0; + if(!isNil "_resultPos") then { + _distance = _result select 1; + if(_distance < _shortestReturn) then { + _shortestReturn = _distance; + }; + if(_distance > _longestReturn) then { + _longestReturn = _distance; + }; + _resultPositions set[(count _resultPositions), _result]; #ifdef DEBUG_MODE_FULL - DRAW_LINES set[(count DRAW_LINES), [_pos, _resultPos, [0, 1, 0, 1]]]; + DRAW_LINES set[(count DRAW_LINES), [_pos, _resultPos, [0, 1, 0, 1]]]; #endif - }; - }; + }; + }; } forEach [1,0.5,0.25]; [_longestReturn, _shortestReturn, _resultPositions]; \ No newline at end of file diff --git a/addons/laser/functions/fnc_shootRay.sqf b/addons/laser/functions/fnc_shootRay.sqf index 768194e351..62847d16b6 100644 --- a/addons/laser/functions/fnc_shootRay.sqf +++ b/addons/laser/functions/fnc_shootRay.sqf @@ -9,22 +9,22 @@ _resultPos = nil; _fidelity = [1000,100,10,1,0.1]; _lastPos = +_pos; { - scopeName "mainSearch"; - for "_i" from 1 to 10 do { - _nextPos = [ - (_lastPos select 0)+((_vec select 0)*_x), - (_lastPos select 1)+((_vec select 1)*_x), - (_lastPos select 2)+((_vec select 2)*_x) - ]; - - if(lineIntersects [_lastPos, _nextPos] || terrainIntersectASL [_lastPos, _nextPos]) then { - _resultPos = _lastPos; - breakTo "mainSearch"; - } else { - _distance = _distance + _x; - _lastPos = _nextPos; - }; - }; + scopeName "mainSearch"; + for "_i" from 1 to 10 do { + _nextPos = [ + (_lastPos select 0)+((_vec select 0)*_x), + (_lastPos select 1)+((_vec select 1)*_x), + (_lastPos select 2)+((_vec select 2)*_x) + ]; + + if(lineIntersects [_lastPos, _nextPos] || terrainIntersectASL [_lastPos, _nextPos]) then { + _resultPos = _lastPos; + breakTo "mainSearch"; + } else { + _distance = _distance + _x; + _lastPos = _nextPos; + }; + }; } forEach _fidelity; [_resultPos, _distance]; \ No newline at end of file diff --git a/addons/laser/functions/fnc_translateToWeaponSpace.sqf b/addons/laser/functions/fnc_translateToWeaponSpace.sqf index 406d81b145..2c7dc5e6da 100644 --- a/addons/laser/functions/fnc_translateToWeaponSpace.sqf +++ b/addons/laser/functions/fnc_translateToWeaponSpace.sqf @@ -14,9 +14,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/laser/script_component.hpp b/addons/laser/script_component.hpp index afca689204..2be1e9e14b 100644 --- a/addons/laser/script_component.hpp +++ b/addons/laser/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_LASER - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_LASER - #define DEBUG_SETTINGS DEBUG_SETTINGS_LASER + #define DEBUG_SETTINGS DEBUG_SETTINGS_LASER #endif #include "\z\ace\Addons\main\script_macros.hpp" diff --git a/addons/laser_selfdesignate/CfgEventhandlers.hpp b/addons/laser_selfdesignate/CfgEventhandlers.hpp index ea33d05bcb..4cef7be4a3 100644 --- a/addons/laser_selfdesignate/CfgEventhandlers.hpp +++ b/addons/laser_selfdesignate/CfgEventhandlers.hpp @@ -10,18 +10,10 @@ class Extended_PostInit_EventHandlers { }; }; -class Extended_GetIn_EventHandlers { - class B_Heli_Attack_01_F { +class Extended_Init_EventHandlers { + class Helicopter { class ADDON { - getIn = QUOTE(call FUNC(onGetin)); + init = QUOTE(_this call DFUNC(initDesignatorActions)); }; }; -}; - -class Extended_GetOut_EventHandlers { - class B_Heli_Attack_01_F { - class ADDON { - getOut = QUOTE(call FUNC(onGetout)); - }; - }; -}; +}; \ No newline at end of file diff --git a/addons/laser_selfdesignate/CfgVehicles.hpp b/addons/laser_selfdesignate/CfgVehicles.hpp index 5b2fdd7d28..1c30e3d1e7 100644 --- a/addons/laser_selfdesignate/CfgVehicles.hpp +++ b/addons/laser_selfdesignate/CfgVehicles.hpp @@ -23,7 +23,8 @@ class CfgVehicles { class B_Heli_Attack_01_F: Heli_Attack_01_base_F { class Turrets: Turrets { class MainTurret: MainTurret { - stabilizedInAxes = 4; // This stablizes the turret a bit more for laser designation + GVAR(Enabled) = 1; // Enable laser self-designation + stabilizedInAxes = 4; // This stablizes the turret a bit more for laser designation }; }; }; diff --git a/addons/laser_selfdesignate/XEH_pre_init.sqf b/addons/laser_selfdesignate/XEH_pre_init.sqf index 4e98fce7ec..a8d4b1779d 100644 --- a/addons/laser_selfdesignate/XEH_pre_init.sqf +++ b/addons/laser_selfdesignate/XEH_pre_init.sqf @@ -1,12 +1,11 @@ #include "script_component.hpp" -PREP(onGetIn); -PREP(onGetOut); - +PREP(initDesignatorActions); PREP(laserHudDesignateOn); PREP(laserHudDesignateOff); +PREP(unitTurretHasDesignator); GVAR(laser) = nil; -GVAR(laserActive) = false; +GVAR(laserActive) = false; -FUNC(getPosASL) = {visiblePositionASL (_this select 0)}; \ No newline at end of file +FUNC(getPosASL) = {visiblePositionASL (_this select 0)}; diff --git a/addons/laser_selfdesignate/config.cpp b/addons/laser_selfdesignate/config.cpp index e19e438da0..ff9c269989 100644 --- a/addons/laser_selfdesignate/config.cpp +++ b/addons/laser_selfdesignate/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_main", "ace_laser"}; + requiredAddons[] = {"ace_interaction", "ace_laser"}; version = VERSION; }; }; diff --git a/addons/laser_selfdesignate/functions/fnc_initDesignatorActions.sqf b/addons/laser_selfdesignate/functions/fnc_initDesignatorActions.sqf new file mode 100644 index 0000000000..af361425aa --- /dev/null +++ b/addons/laser_selfdesignate/functions/fnc_initDesignatorActions.sqf @@ -0,0 +1,57 @@ +/* + * Author: esteldunedain + * Initializes the actions for turning on/off the laser for vehicles that have them + * + * Argument: + * 0: Vehicle + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +EXPLODE_1_PVT(_this,_vehicle); + +// Add action to class if it is not already done +private ["_type", "_initializedClasses"]; +_type = typeOf _vehicle; +_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"]; + _turretConfig = [configFile >> "CfgVehicles" >> _type, _x] call EFUNC(common,getTurretConfigPath); + + if (getNumber (_turretConfig >> QGVAR(Enabled)) == 1) exitWith { + // @todo: Add the state variables to the vehicle, instead of to the client + // e.g.: _vehicle setVariable [format ["%1_%2", QGVAR(laserActive), _x], false]; + + // Add actions + _onAction = [QGVAR(LaserOn), localize "STR_ACE_Laser_SelfDesignate_DesignatorOn", "", + { + // Statement + _this call FUNC(laserHudDesignateOn) + }, + { + // Condition + !GVAR(laserActive) && {[ACE_player] call FUNC(unitTurretHasDesignator)} + }] call EFUNC(interact_menu,createAction); + + _offAction = [QGVAR(LaserOff), localize "STR_ACE_Laser_SelfDesignate_DesignatorOff", "", + { + // Statement + _this call FUNC(laserHudDesignateOff) + }, + { + // Condition + GVAR(laserActive) && {[ACE_player] call FUNC(unitTurretHasDesignator)} + }] call EFUNC(interact_menu,createAction); + + [_type, 1, ["ACE_SelfActions"], _onAction] call EFUNC(interact_menu,addActionToClass); + [_type, 1, ["ACE_SelfActions"], _offAction] call EFUNC(interact_menu,addActionToClass); + }; +} forEach allTurrets _vehicle; diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf index 088f3d9303..2f4c437d28 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf @@ -1,15 +1,15 @@ #include "script_component.hpp" if(isNil QGVAR(laser)) exitWith { - false + false }; if(!local GVAR(laser)) then { - false + false }; _handle = GVAR(laser) getVariable ["ACE_PFH_HANDLE", nil]; if(!isNil "_handle") then { - [_handle] call cba_fnc_removePerFrameHandler; + [_handle] call cba_fnc_removePerFrameHandler; }; REM(ACE_LASERS, GVAR(laser)); diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf index bac440c853..f0fdc8458f 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf @@ -3,88 +3,109 @@ TRACE_1("enter", _this); +#define FCS_UPDATE_DELAY 1 + FUNC(magnitude) = { - _this distance [0, 0, 0] + _this distance [0, 0, 0] }; FUNC(mat_normalize3d) = { - private ["_mag"]; - PARAMS_3(_vx,_vy,_vz); + private ["_mag"]; + PARAMS_3(_vx,_vy,_vz); - _mag = _this call FUNC(magnitude); - if (_mag == 0) then {_mag = 1}; - [(_vx/_mag), (_vy/_mag), (_vz/_mag)] + _mag = _this call FUNC(magnitude); + if (_mag == 0) then {_mag = 1}; + [(_vx/_mag), (_vy/_mag), (_vz/_mag)] }; FUNC(laserHudDesignatePFH) = { - _args = _this select 0; - _laserTarget = _args select 0; - _shooter = _args select 1; - - _vehicle = vehicle _shooter; - _weapon = currentWeapon _vehicle; - - if(!alive _shooter || isNull _vehicle || isNull _laserTarget || !GVAR(laserActive) ) exitWith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; - - // Retrieve the gunner and turret memory point information - _gunnerInfo = [_vehicle, _weapon] call CBA_fnc_getFirer; - - _turret = [_vehicle, _gunnerInfo select 1] call CBA_fnc_getTurret; - _pov = getText (_turret >> "memoryPointGunnerOptics"); - _gunBeg = getText (_turret >> "gunBeg"); - _gunEnd = getText (_turret >> "gunEnd"); - TRACE_3("", _pov, _gunBeg, _gunEnd); + private["_args", "_laserTarget", "_shooter", "_vehicle", "_weapon", "_gunnerInfo", "_turret", "_pov", "_gunBeg", "_gunEnd", "_povPos", "_povDir", "_result", "_resultPositions", "_firstResult", "_forceUpdateTime"]; + _args = _this select 0; + _laserTarget = _args select 0; + _shooter = _args select 1; + + if( (count _args) < 3) then { + _args set[2, diag_tickTime + FCS_UPDATE_DELAY]; + }; + _forceUpdateTime = _args select 2; + + _vehicle = vehicle _shooter; + _weapon = currentWeapon _vehicle; + + TRACE_1("", _args); + + if(!alive _shooter || isNull _vehicle || isNull _laserTarget || !GVAR(laserActive) ) exitWith { + [] call FUNC(laserHudDesignateOff); + }; + if(!([ACE_player] call FUNC(unitTurretHasDesignator)) ) exitWith { + [] call FUNC(laserHudDesignateOff); + }; + + // Retrieve the gunner and turret memory point information + _gunnerInfo = [_vehicle, _weapon] call CBA_fnc_getFirer; + _turretInfo = [_vehicle, _gunnerInfo select 1] call EFUNC(common,getTurretDirection); + _povPos = _turretInfo select 0; + _povDir = _turretInfo select 1; + + + + _result = [_povPos, _povDir] call EFUNC(laser,shootCone); + if((count _result) > 0) then { + _resultPositions = _result select 2; - // Pull the PIP pov or barrel direction, depending on how the model is set up - _povPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _pov ) ); - _povDir = [0,0,0]; - if(_pov == "pip0_pos") then { - _pipDir = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition "pip0_dir" ) ); - _povDir = [_povPos, _pipDir] call BIS_fnc_vectorDiff; - } else { - _gunBeginPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _gunBeg ) ); - _gunEndPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _gunEnd ) ); - _povDir = [_gunEndPos, _gunBeginPos] call BIS_fnc_vectorDiff; - }; - - TRACE_4("", _povDir, _povPos, _gunBeginPos, _gunEndPos); - - _result = [_povPos, _povDir] call EFUNC(laser,shootCone); - - if((count _result) > 0) then { - _resultPositions = _result select 2; - - if((count _resultPositions) > 0) then { - _firstResult = _resultPositions select 0; - _pos = _firstResult select 0; - - // If the laser has moved less than a half meter, then dont move it. - // Just regular use of lasers will commonly make them move this much, - // but not across multiple close frames. - // This loses accuracy a little, but saves position updates per frame. - //if( ((getPosASL _laserTarget) distance _pos) > 0.5) then { - _laserTarget setPosATL (ASLToATL _pos); - //}; + if((count _resultPositions) > 0) then { + _firstResult = _resultPositions select 0; + _pos = _firstResult select 0; + + // If the laser has moved less than a half meter, then dont move it. + // Just regular use of lasers will commonly make them move this much, + // but not across multiple close frames. + // This loses accuracy a little, but saves position updates per frame. + TRACE_5("", diag_tickTime, _forceUpdateTime, getPosASL _laserTarget, _pos, ((getPosASL _laserTarget) distance _pos)); + + if(diag_tickTime > _forceUpdateTime) then { + TRACE_1("FCS Update", ""); + ["ace_fcs_forceUpdate", []] call ace_common_fnc_localEvent; + }; + + if( (_laserTarget distance _pos) > 0.1) then { + TRACE_1("LaserPos Update", ""); + _laserTarget setPosATL (ASLToATL _pos); + }; + + if(diag_tickTime > _forceUpdateTime) then { + _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], ASLToATL _pos, 0.75, 0.75, 0, "", 0.5, 0.025, "TahomaB"]; + 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"]; + + { + private["_position"]; + _position = _x select 0; + drawLine3d [ASLToATL _povPos, ASLToATL _position, [0,0,1,1] ]; + } forEach _resultPositions; #endif - }; - }; + }; + }; + + _this set[0, _args]; }; +private "_laserTarget"; +private "_handle"; + if(isNil QGVAR(laser)) then { - _laserTarget = "LaserTarget" createVehicle (getpos player); - - GVAR(laserActive) = true; - - _handle = [FUNC(laserHudDesignatePFH), 0, [_laserTarget, player]] call cba_fnc_addPerFrameHandler; - _laserTarget setVariable ["ACE_PFH_HANDLE", _handle, false]; - - GVAR(laser) = _laserTarget; + + _laserTarget = "LaserTargetW" createVehicle (getpos player); + + GVAR(laserActive) = true; + + _handle = [FUNC(laserHudDesignatePFH), 0.1, [_laserTarget, player]] call cba_fnc_addPerFrameHandler; + _laserTarget setVariable ["ACE_PFH_HANDLE", _handle, false]; + + GVAR(laser) = _laserTarget; } else { - [] call FUNC(laserHudDesignateOff); - [] call FUNC(laserHudDesignateOn); + [] call FUNC(laserHudDesignateOff); + [] call FUNC(laserHudDesignateOn); }; diff --git a/addons/laser_selfdesignate/functions/fnc_onGetin.sqf b/addons/laser_selfdesignate/functions/fnc_onGetin.sqf deleted file mode 100644 index d6f555c02f..0000000000 --- a/addons/laser_selfdesignate/functions/fnc_onGetin.sqf +++ /dev/null @@ -1,13 +0,0 @@ -#define DEBUG_MODE_FULL -#include "script_component.hpp" -// TODO: we should do this differently eventually -private["_onActionId", "_offActionId"]; -TRACE_1("ENTER", _this); - -// TODO: THIS SHOULD NOT BE ACTIONS EVENTUALLY - -_onActionId = player addAction ["Laser Designator On", { _this call FUNC(laserHudDesignateOn) }, [], 1, false, false, "", QUOTE( (gunner (vehicle player)) == player && !GVAR(laserActive))]; -player setVariable[QGVAR(onActionId), _onActionId, false]; - -_offActionId = player addAction ["Laser Designator Off", { _this call FUNC(laserHudDesignateOff) }, [], 1, false, false, "", QUOTE( (gunner (vehicle player)) == player && GVAR(laserActive))]; -player setVariable[QGVAR(offActionId), _offActionId, false]; \ No newline at end of file diff --git a/addons/laser_selfdesignate/functions/fnc_onGetout.sqf b/addons/laser_selfdesignate/functions/fnc_onGetout.sqf deleted file mode 100644 index 2a32403c19..0000000000 --- a/addons/laser_selfdesignate/functions/fnc_onGetout.sqf +++ /dev/null @@ -1,10 +0,0 @@ -#include "script_component.hpp" - -_onActionId = player getVariable[QGVAR(onActionId), -1]; -_offActionId = player getVariable[QGVAR(offActionId), -1]; - -player removeAction _onActionId; -player removeAction _offActionId; - -player setVariable[QGVAR(onActionId), -1, false]; -player setVariable[QGVAR(offActionId), -1, false]; \ No newline at end of file diff --git a/addons/laser_selfdesignate/functions/fnc_unitTurretHasDesignator.sqf b/addons/laser_selfdesignate/functions/fnc_unitTurretHasDesignator.sqf new file mode 100644 index 0000000000..291deb5015 --- /dev/null +++ b/addons/laser_selfdesignate/functions/fnc_unitTurretHasDesignator.sqf @@ -0,0 +1,21 @@ +/* + * Author: esteldunedain + * Checks if the turret occupied by the given unit has a laser designator + * + * Argument: + * 0: Unit + * + * Return value: + * Has designator? + */ +#include "script_component.hpp" + +EXPLODE_1_PVT(_this,_unit); + +// Get the player turret path +private ["_turret","_config","_turretConfig"]; +_turret = [_unit] call EFUNC(common,getTurretIndex); +_config = configFile >> "CfgVehicles" >> typeOf vehicle _unit; +_turretConfig = [_config, _turret] call EFUNC(common,getTurretConfigPath); + +getNumber (_turretConfig >> QGVAR(Enabled)) > 0 diff --git a/addons/laser_selfdesignate/script_component.hpp b/addons/laser_selfdesignate/script_component.hpp index c9742423df..46e9c48d2f 100644 --- a/addons/laser_selfdesignate/script_component.hpp +++ b/addons/laser_selfdesignate/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_LASER_SELFDESIGNATE - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_LASER_SELFDESIGNATE - #define DEBUG_SETTINGS DEBUG_SETTINGS_LASER_SELFDESIGNATE + #define DEBUG_SETTINGS DEBUG_SETTINGS_LASER_SELFDESIGNATE #endif #include "\z\ace\Addons\main\script_macros.hpp" diff --git a/addons/laser_selfdesignate/stringtable.xml b/addons/laser_selfdesignate/stringtable.xml new file mode 100644 index 0000000000..70f8912cfe --- /dev/null +++ b/addons/laser_selfdesignate/stringtable.xml @@ -0,0 +1,12 @@ + + + + + + Laser<br/>Designator On + + + Laser<br/>Designator Off + + + \ No newline at end of file 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/functions/fnc_drawLaserpoint.sqf b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf index 969607f987..31be95099a 100644 --- a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf +++ b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf @@ -3,7 +3,7 @@ EXPLODE_3_PVT(_this,_unit,_range,_isGreen); -_p0Pos = _unit modelToWorld (_unit selectionPosition "righthand"); +_p0Pos = _unit modelToWorldVisual (_unit selectionPosition "righthand"); // Convert _p0Pos to ASL _p0 = + _p0Pos; 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 855653718a..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)); @@ -265,7 +253,7 @@ class ACE_Medical_Actions { condition = "((_this select 1) getvariable ['ACE_medical_inCardiacArrest', false])"; callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR)); callbackFailure = ""; - callbackProgress = "((_this select 1) getvariable ['ACE_medical_inCardiacArrest', false])"; + callbackProgress = "(((_this select 0) select 1) getvariable ['ACE_medical_inCardiacArrest', false])"; animationPatient = ""; animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; animationCaller = "AinvPknlMstpSlayWnonDnon_medic"; @@ -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 51ad3533f6..0af12c0a37 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -16,13 +16,12 @@ class ACE_Settings { }; class GVAR(enableOverdosing) { typeName = "BOOL"; - value = true; + value = 1; }; class GVAR(bleedingCoefficient) { typeName = "SCALAR"; value = 1; }; - class GVAR(enableAirway) { typeName = "BOOL"; value = false; @@ -37,11 +36,11 @@ class ACE_Settings { }; class GVAR(enableVehicleCrashes) { typeName = "BOOL"; - value = true; + value = 1; }; class GVAR(enableScreams) { typeName = "BOOL"; - value = true; + value = 1; }; class GVAR(playerDamageThreshold) { typeName = "SCALAR"; @@ -58,7 +57,7 @@ class ACE_Settings { }; class GVAR(preventInstaDeath) { typeName = "BOOL"; - value = false; + value = 0; }; class GVAR(maxReviveTime) { typeName = "SCALAR"; @@ -70,7 +69,7 @@ class ACE_Settings { }; class GVAR(allowDeadBodyMovement) { typeName = "BOOL"; - value = false; + value = 0; }; class GVAR(allowLitterCreation) { typeName = "BOOL"; @@ -83,17 +82,35 @@ class ACE_Settings { class GVAR(medicSetting_PAK) { typeName = "SCALAR"; value = 1; + values[] = {"Anyone", "Medics only", "Doctors only"}; }; class GVAR(medicSetting_SurgicalKit) { typeName = "SCALAR"; value = 1; + values[] = {"Anyone", "Medics only", "Doctors only"}; }; class GVAR(consumeItem_PAK) { typeName = "SCALAR"; value = 0; + values[] = {"No", "Yes"}; }; class GVAR(consumeItem_SurgicalKit) { typeName = "SCALAR"; 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 0c05532073..13c54dfe37 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -128,6 +128,12 @@ class CfgVehicles { typeName = "NUMBER"; defaultValue = 1; }; + class keepLocalSettingsSynced { + displayName = "Sync status"; + description = "Keep unit status synced. Recommended on."; + typeName = "BOOL"; + defaultValue = 1; + }; }; class ModuleDescription { description = "Provides a medical system for both players and AI."; @@ -135,7 +141,7 @@ class CfgVehicles { }; }; - class ACE_moduleTreatmentConfiguration: ACE_Module { + class ACE_moduleTreatmentSettings: ACE_Module { scope = 2; displayName = "Treatment Settings [ACE]"; icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); @@ -198,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 { @@ -208,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 { @@ -216,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 { @@ -591,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 @@ -850,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/CfgWeapons.hpp b/addons/medical/CfgWeapons.hpp index 670cfcb34c..6545464ea9 100644 --- a/addons/medical/CfgWeapons.hpp +++ b/addons/medical/CfgWeapons.hpp @@ -10,14 +10,12 @@ class CfgWeapons { type = 0; class ItemInfo: InventoryFirstAidKitItem_Base_F { mass = 4; - type = 201; }; }; class Medikit: ItemCore { type = 0; class ItemInfo: MedikitItem { mass = 60; - type = 201; }; }; @@ -31,11 +29,10 @@ class CfgWeapons { descriptionShort = $STR_ACE_MEDICAL_BANDAGE_BASIC_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_BANDAGE_BASIC_DESC_USE; class ItemInfo: InventoryItem_Base_F { - mass=1; - type=201; + mass = 1; }; }; - class ACE_packingBandage: ItemCore { + class ACE_packingBandage: ACE_ItemCore { scope = 2; value = 1; count = 1; @@ -46,11 +43,10 @@ class CfgWeapons { descriptionShort = $STR_ACE_MEDICAL_PACKING_BANDAGE_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_PACKING_BANDAGE_DESC_USE; class ItemInfo: InventoryItem_Base_F { - mass=1; - type=201; + mass = 1; }; }; - class ACE_elasticBandage: ItemCore { + class ACE_elasticBandage: ACE_ItemCore { scope = 2; value = 1; count = 1; @@ -61,11 +57,10 @@ class CfgWeapons { descriptionShort = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DESC_USE; class ItemInfo: InventoryItem_Base_F { - mass=1; - type=201; + mass = 1; }; }; - class ACE_tourniquet: ItemCore { + class ACE_tourniquet: ACE_ItemCore { scope = 2; value = 1; count = 1; @@ -76,11 +71,10 @@ class CfgWeapons { descriptionShort = $STR_ACE_MEDICAL_TOURNIQUET_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_TOURNIQUET_DESC_USE; class ItemInfo: InventoryItem_Base_F { - mass=1; - type=201; + mass = 1; }; }; - class ACE_morphine: ItemCore { + class ACE_morphine: ACE_ItemCore { scope = 2; value = 1; count = 1; @@ -91,11 +85,10 @@ class CfgWeapons { descriptionShort = $STR_ACE_MEDICAL_MORPHINE_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_MORPHINE_DESC_USE; class ItemInfo: InventoryItem_Base_F { - mass=1; - type=201; + mass = 1; }; }; - class ACE_atropine: ItemCore { + class ACE_atropine: ACE_ItemCore { scope = 2; value = 1; count = 1; @@ -106,11 +99,11 @@ class CfgWeapons { descriptionShort = $STR_ACE_MEDICAL_ATROPINE_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_ATROPINE_DESC_USE; class ItemInfo: InventoryItem_Base_F { - mass=1; - type=201; + mass = 1; + }; }; - class ACE_epinephrine: ItemCore { + class ACE_epinephrine: ACE_ItemCore { scope = 2; value = 1; count = 1; @@ -121,11 +114,10 @@ class CfgWeapons { descriptionShort = $STR_ACE_MEDICAL_EPINEPHRINE_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_EPINEPHRINE_DESC_USE; class ItemInfo: InventoryItem_Base_F { - mass=1; - type=201; + mass = 1; }; }; - class ACE_plasmaIV: ItemCore { + class ACE_plasmaIV: ACE_ItemCore { scope = 2; value = 1; count = 1; @@ -135,24 +127,21 @@ class CfgWeapons { descriptionUse = $STR_ACE_MEDICAL_PLASMA_IV_DESC_USE; class ItemInfo: InventoryItem_Base_F { mass = 10; - type = 201; }; }; class ACE_plasmaIV_500: ACE_plasmaIV { displayName = $STR_ACE_MEDICAL_PLASMA_IV_500; class ItemInfo: InventoryItem_Base_F { mass = 5; - type = 201; }; }; class ACE_plasmaIV_250: ACE_plasmaIV { displayName = $STR_ACE_MEDICAL_PLASMA_IV_250; class ItemInfo: InventoryItem_Base_F { mass = 2.5; - type = 201; }; }; - class ACE_bloodIV: ItemCore { + class ACE_bloodIV: ACE_ItemCore { scope = 2; value = 1; count = 1; @@ -163,24 +152,21 @@ class CfgWeapons { descriptionUse = $STR_ACE_MEDICAL_BLOOD_IV_DESC_USE; class ItemInfo: InventoryItem_Base_F { mass = 10; - type = 201; }; }; class ACE_bloodIV_500: ACE_bloodIV { displayName = $STR_ACE_MEDICAL_BLOOD_IV_500; class ItemInfo: InventoryItem_Base_F { mass = 5; - type = 201; }; }; class ACE_bloodIV_250: ACE_bloodIV { displayName = $STR_ACE_MEDICAL_BLOOD_IV_250; class ItemInfo: InventoryItem_Base_F { mass = 2.5; - type = 201; }; }; - class ACE_salineIV: ItemCore { + class ACE_salineIV: ACE_ItemCore { scope = 2; value = 1; count = 1; @@ -190,24 +176,21 @@ class CfgWeapons { descriptionUse = $STR_ACE_MEDICAL_SALINE_IV_DESC_USE; class ItemInfo: InventoryItem_Base_F { mass = 10; - type = 201; }; }; class ACE_salineIV_500: ACE_salineIV { displayName = $STR_ACE_MEDICAL_SALINE_IV_500; class ItemInfo: InventoryItem_Base_F { mass = 2.5; - type = 201; }; }; class ACE_salineIV_250: ACE_salineIV { displayName = $STR_ACE_MEDICAL_SALINE_IV_250; class ItemInfo: InventoryItem_Base_F { mass = 2.5; - type = 201; }; }; - class ACE_quikclot: ItemCore { + class ACE_quikclot: ACE_ItemCore { scope = 2; value = 1; count = 1; @@ -218,25 +201,22 @@ class CfgWeapons { descriptionUse = $STR_ACE_MEDICAL_QUIKCLOT_DESC_USE; class ItemInfo: InventoryItem_Base_F { mass = 1; - type = 201; }; }; - class ACE_personalAidKit: ItemCore { + class ACE_personalAidKit: ACE_ItemCore { scope = 2; value = 1; count = 1; type = 16; displayName = $STR_ACE_MEDICAL_AID_KIT_DISPLAY; picture = QUOTE(PATHTOF(ui\items\personal_aid_kit.paa)); - //model = QUOTE(PATHTOF(equipment\Personal-aidkits\MTP.p3d)); descriptionShort = $STR_ACE_MEDICAL_AID_KIT_DESC_SHORT; descriptionUse = $STR_ACE_MEDICAL_AID_KIT_DESC_USE; class ItemInfo: InventoryItem_Base_F { mass = 2; - type = 201; }; }; - class ACE_surgicalKit: ItemCore { + class ACE_surgicalKit: ACE_ItemCore { scope=2; displayName= $STR_ACE_MEDICAL_SURGICALKIT_DISPLAY; model = QUOTE(PATHTOF(data\surgical_kit.p3d)); @@ -245,10 +225,9 @@ class CfgWeapons { descriptionUse = $STR_ACE_MEDICAL_SURGICALKIT_DESC_USE; class ItemInfo: InventoryItem_Base_F { mass = 5; - type = 201; }; }; - class ACE_bodyBag: ItemCore { + class ACE_bodyBag: ACE_ItemCore { scope=2; displayName= $STR_ACE_MEDICAL_BODYBAG_DISPLAY; model = QUOTE(PATHTOF(data\bodybagItem.p3d)); @@ -257,7 +236,6 @@ class CfgWeapons { descriptionUse = $STR_ACE_MEDICAL_BODYBAG_DESC_USE; class ItemInfo: InventoryItem_Base_F { mass = 15; - type = 201; }; }; }; 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 c51fecc608..56056de0c6 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -45,6 +45,7 @@ PREP(handleDamage_wounds); PREP(handleUnitVitals); PREP(handleKilled); PREP(handleLocal); +PREP(handleBandageOpening); PREP(hasItem); PREP(hasItems); PREP(hasMedicalEnabled); @@ -53,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 9cd3bf1bed..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 = [_unit] call EFUNC(common,getName); -if (alive _unit) then { - // force kill the unit. - [_unit, true] call FUNC(setDead); +_nameOfUnit = [_target] call EFUNC(common,getName); +if (alive _target) then { + [_target, true] call FUNC(setDead); }; -_onPosition = getPos _unit; -deleteVehicle _unit; -_bodyBagCreated = createVehicle ["ACE_bodyBag", _onPosition, [], 0, "NONE"]; +_onPosition = getPos _target; +deleteVehicle _target; +_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], QEFUNC(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_createLitter.sqf b/addons/medical/functions/fnc_createLitter.sqf index 8df56ad1fb..570c6d63d3 100644 --- a/addons/medical/functions/fnc_createLitter.sqf +++ b/addons/medical/functions/fnc_createLitter.sqf @@ -24,6 +24,7 @@ _className = _this select 3; _usersOfItems = _this select 5; if !(GVAR(allowLitterCreation)) exitwith {}; +if (vehicle _caller != _caller || vehicle _target != _target) exitwith {}; _config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className); if (GVAR(level) >= 2) then { diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index b155a7b1ef..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,13 +56,25 @@ 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 { _genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_PAIN", [1, 1, 1, 1]]; }; + _totalIvVolume = 0; + { + private "_value"; + _value = _target getvariable _x; + if !(isnil "_value") then { + _totalIvVolume = _totalIvVolume + (_target getvariable [_x, 0]); + }; + }foreach GVAR(IVBags); + if (_totalIvVolume >= 1) then { + _genericMessages pushback [format[localize "STR_ACE_MEDICAL_receivingIvVolume", floor _totalIvVolume], [1, 1, 1, 1]]; + }; + _selectionBloodLoss = [0,0,0,0,0,0]; if (GVAR(level) >= 2) then { _openWounds = _target getvariable [QGVAR(openWounds), []]; @@ -74,24 +88,45 @@ if (_show) then { if (_amountOf > 0) then { if (_amountOf >= 1) then { // TODO localization - _allInjuryTexts pushback format["%2x %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6, _amountOf]; + _allInjuryTexts pushback [format["%2x %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6, _amountOf], [1,1,1,1]]; } else { // TODO localization - _allInjuryTexts pushback format["Partial %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6]; + _allInjuryTexts pushback [format["Partial %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6], [1,1,1,1]]; }; }; }; }foreach _openWounds; + + _bandagedwounds = _target getvariable [QGVAR(bandagedWounds), []]; + { + _amountOf = _x select 3; + // Find how much this bodypart is bleeding + //if (_selectionBloodLoss select (_x select 2) == 0) then { + // _selectionBloodLoss set [(_x select 2), (_selectionBloodLoss select (_x select 2)) + (15 * ((_x select 4) * _amountOf))]; + //}; + if (GVAR(currentSelectedSelectionN) == (_x select 2)) then { + // Collect the text to be displayed for this injury [ Select injury class type definition - select the classname DisplayName (6th), amount of injuries for this] + if (_amountOf > 0) then { + if (_amountOf >= 1) then { + // TODO localization + _allInjuryTexts pushback [format["[B] %2x %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6, _amountOf], [1,0.5,0.5,1]]; + } else { + // TODO localization + _allInjuryTexts pushback [format["[B] Partial %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6], [1,0.5,0.5,1]]; + }; + }; + }; + }foreach _bandagedwounds; } else { { _selectionBloodLoss set [_forEachIndex, _target getHitPointDamage _x]; if (_target getHitPointDamage _x > 0.1) then { // @todo localize - _allInjuryTexts pushBack format ["%1 %2", + _allInjuryTexts pushBack [format ["%1 %2", ["Lightly wounded", "Heavily wounded"] select (_target getHitPointDamage _x > 0.5), ["head", "torso", "left arm", "right arm", "left leg", "right leg"] select _forEachIndex - ]; + ], [1,1,1,1]]; }; } forEach ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; }; @@ -125,7 +160,8 @@ if (_show) then { _lbCtrl lbSetColor [_foreachIndex, _x select 1]; }foreach _genericMessages; { - _lbCtrl lbAdd _x; + _lbCtrl lbAdd (_x select 0); + _lbCtrl lbSetColor [_foreachIndex, _x select 1]; }foreach _allInjuryTexts; if (count _allInjuryTexts == 0) then { _lbCtrl lbAdd "No injuries on this bodypart.."; @@ -158,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 95e6713d9a..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}; @@ -43,28 +42,27 @@ if (_show) then { _lbCtrl = (_display displayCtrl 200); lbClear _lbCtrl; - _log = _target getvariable ["myVariableTESTKOEAKJR", []]; + _log = _target getvariable [QGVAR(triageCard), []]; { - // [_message,_moment,_type, _arguments] - _message = _x select 0; - _moment = _x select 1; - _arguments = _x select 3; - if (isLocalized _message) then { - _message = localize _message; - }; - - { - if (typeName _x == "STRING" && {isLocalized _x}) then { - _arguments set [_foreachIndex, localize _x]; + _item = _x select 0; + _amount = _x select 1; + _message = _item; + if (isClass(configFile >> "CfgWeapons" >> _item)) then { + _message = getText(configFile >> "CfgWeapons" >> _item >> "DisplayName"); + } else { + if (isLocalized _message) then { + _message = localize _message; }; - }foreach _arguments; - _message = format([_message] + _arguments); - _lbCtrl lbAdd format["%1 %2", _moment, _message]; + }; + _triageCardTexts pushback format["%1x - %2", _amount, _message]; }foreach _log; if (count _triageCardTexts == 0) then { _lbCtrl lbAdd "No entries on this triage card.."; }; + { + _lbCtrl lbAdd _x; + }foreach _triageCardTexts; _triageStatus = [_target] call FUNC(getTriageStatus); (_display displayCtrl 2000) ctrlSetText (_triageStatus select 0); 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_getBloodLoss.sqf b/addons/medical/functions/fnc_getBloodLoss.sqf index 4f070e2546..6418d425e8 100644 --- a/addons/medical/functions/fnc_getBloodLoss.sqf +++ b/addons/medical/functions/fnc_getBloodLoss.sqf @@ -13,6 +13,8 @@ #include "script_component.hpp" +#define BLOODLOSSRATE_BASIC 0.4 + private ["_totalBloodLoss","_tourniquets","_openWounds", "_value", "_cardiacOutput", "_internalWounds"]; // TODO Only use this calculation if medium or higher, otherwise use vanilla calculations (for basic medical). _totalBloodLoss = 0; @@ -40,6 +42,6 @@ if (GVAR(level) >= 2) then { // cap the blood loss to be no greater as the current cardiac output //(_totalBloodLoss min _cardiacOutput); } else { - // TODO basic medical + _totalBloodLoss = BLOODLOSSRATE_BASIC * (damage _this); }; _totalBloodLoss * (GVAR(bleedingCoefficient) max 0); diff --git a/addons/medical/functions/fnc_getBloodVolumeChange.sqf b/addons/medical/functions/fnc_getBloodVolumeChange.sqf index b031ae4585..f94c5d5b7b 100644 --- a/addons/medical/functions/fnc_getBloodVolumeChange.sqf +++ b/addons/medical/functions/fnc_getBloodVolumeChange.sqf @@ -44,6 +44,12 @@ if (_bloodVolume < 100.0) then { _unit setvariable [_x,_ivVolume]; }; }foreach GVAR(IVBags); +} else { + { + if ((_unit getvariable [_x, 0]) > 0) then { + _unit setvariable [_x, 0]; // lets get rid of exessive IV volume + }; + }foreach GVAR(IVBags); }; _bloodVolumeChange; diff --git a/addons/medical/functions/fnc_handleBandageOpening.sqf b/addons/medical/functions/fnc_handleBandageOpening.sqf new file mode 100644 index 0000000000..b4e40984ae --- /dev/null +++ b/addons/medical/functions/fnc_handleBandageOpening.sqf @@ -0,0 +1,118 @@ +/* + * Author: Glowbal + * Handles the bandage of a patient. + * + * Arguments: + * 0: The target + * 1: The impact + * 2: Selection part number + * 3: Injury index + * 4: Injury + * 5: Used Bandage type + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_target", "_impact", "_part", "_injuryIndex", "_injury", "_bandage", "_classID", "_className", "_reopeningChance", "_reopeningMinDelay", "_reopeningMaxDelay", "_config", "_woundTreatmentConfig", "_bandagedWounds", "_exist", "_injuryId", "_existingInjury", "_delay", "_openWounds", "_selectedInjury"]; +_target = _this select 0; +_impact = _this select 1; +_part = _this select 2; +_injuryIndex = _this select 3; +_injury = _this select 4; +_bandage = _this select 5; + +_classID = _injury select 1; +_className = GVAR(woundClassNames) select _classID; + +// default, just in case.. +_reopeningChance = 0.1; +_reopeningMinDelay = 120; +_reopeningMaxDelay = 200; + +// Get the default values for the used bandage +_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; +}; + +if (isClass (_config >> _className)) then { + _woundTreatmentConfig = (_config >> _className); + if (isNumber (_woundTreatmentConfig >> "reopeningChance")) then { + _reopeningChance = getNumber (_woundTreatmentConfig >> "reopeningChance"); + }; + if (isNumber (_woundTreatmentConfig >> "reopeningMinDelay")) then { + _reopeningMinDelay = getNumber (_woundTreatmentConfig >> "reopeningMinDelay"); + }; + if (isNumber (_woundTreatmentConfig >> "reopeningMaxDelay")) then { + _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]; + }; +}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]; +}; +_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; + + 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); +}; 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_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index 992ccdc3f2..fc13e19d29 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -22,7 +22,7 @@ _unit setVariable [QGVAR(lastMomentVitalsHandled), time]; if (_interval == 0) exitWith {}; _lastTimeValuesSynced = _unit getvariable [QGVAR(lastMomentValuesSynced), 0]; -_syncValues = time - _lastTimeValuesSynced >= (10 + floor(random(10))); +_syncValues = (time - _lastTimeValuesSynced >= (10 + floor(random(10))) && GVAR(keepLocalSettingsSynced)); if (_syncValues) then { _unit setvariable [QGVAR(lastMomentValuesSynced), time]; }; @@ -167,4 +167,15 @@ if (GVAR(level) >= 2) then { [_unit] call FUNC(setCardiacArrest); }; }; + + // syncing any remaining values + if (_syncValues) then { + { + private "_value"; + _value = _unit getvariable _x; + if !(isnil "_value") then { + _unit setvariable [_x,(_unit getvariable [_x, 0]), true]; + }; + }foreach GVAR(IVBags); + }; }; diff --git a/addons/medical/functions/fnc_init.sqf b/addons/medical/functions/fnc_init.sqf index fc74711a30..ed8301b6b2 100644 --- a/addons/medical/functions/fnc_init.sqf +++ b/addons/medical/functions/fnc_init.sqf @@ -26,6 +26,7 @@ _unit setvariable [QGVAR(tourniquets), [0,0,0,0,0,0], true]; // wounds and injuries _unit setvariable [QGVAR(openWounds), [], true]; +_unit setvariable [QGVAR(bandagedWounds), [], true]; _unit setVariable [QGVAR(internalWounds), [], true]; // vitals diff --git a/addons/medical/functions/fnc_isInMedicalFacility.sqf b/addons/medical/functions/fnc_isInMedicalFacility.sqf index b1521b288b..bed660a46a 100644 --- a/addons/medical/functions/fnc_isInMedicalFacility.sqf +++ b/addons/medical/functions/fnc_isInMedicalFacility.sqf @@ -37,7 +37,7 @@ _medicalFacility = "USMC_WarfareBFieldhHospital" ]; -_objects = (lineIntersectsWith [_unit modelToWorld [0, 0, (_eyePos select 2)], _unit modelToWorld [0, 0, (_eyePos select 2) +10], _unit]); +_objects = (lineIntersectsWith [_unit modelToWorldVisual [0, 0, (_eyePos select 2)], _unit modelToWorldVisual [0, 0, (_eyePos select 2) +10], _unit]); { if (((typeOf _x) in _medicalFacility) || (_x getVariable [QGVAR(isMedicalFacility),false])) exitwith { _isInBuilding = true; 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_moduleMedicalSettings.sqf b/addons/medical/functions/fnc_moduleMedicalSettings.sqf index 4fa90ae267..34dd063a4d 100644 --- a/addons/medical/functions/fnc_moduleMedicalSettings.sqf +++ b/addons/medical/functions/fnc_moduleMedicalSettings.sqf @@ -34,3 +34,4 @@ if !(_activated) exitWith {}; [_logic, QGVAR(enableUnsconsiousnessAI), "enableUnsconsiousnessAI"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(preventInstaDeath), "preventInstaDeath"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(bleedingCoefficient), "bleedingCoefficient"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(keepLocalSettingsSynced), "keepLocalSettingsSynced"] call EFUNC(common,readSettingFromModule); 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_setCardiacArrest.sqf b/addons/medical/functions/fnc_setCardiacArrest.sqf index 6ae9fe1079..cebf968898 100644 --- a/addons/medical/functions/fnc_setCardiacArrest.sqf +++ b/addons/medical/functions/fnc_setCardiacArrest.sqf @@ -26,7 +26,6 @@ _unit setvariable [QGVAR(heartRate), 0]; [_unit, true] call FUNC(setUnconscious); _timeInCardiacArrest = 120 + round(random(600)); -systemChat format["Unit went cardiac arrest; hr: %1", _unit getvariable [QGVAR(heartRate), -1]]; [{ private ["_args","_unit","_startTime","_timeInCardiacArrest","_heartRate"]; _args = _this select 0; @@ -36,7 +35,6 @@ systemChat format["Unit went cardiac arrest; hr: %1", _unit getvariable [QGVAR(h _heartRate = _unit getvariable [QGVAR(heartRate), 0]; if (_heartRate > 0 || !alive _unit) exitwith { - systemChat format["Unit no longer cardiac arrest; hr: %1", _unit getvariable [QGVAR(heartRate), -1]]; [(_this select 1)] call cba_fnc_removePerFrameHandler; _unit setvariable [QGVAR(inCardiacArrest), nil,true]; }; 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_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index c003f48ead..0eaa8b4fa8 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -10,7 +10,7 @@ * Return Value: * Succesful treatment started * - * Public: Yes + * Public: No */ #include "script_component.hpp" @@ -82,18 +82,17 @@ if (_effectivenessFound == -1) exitwith {}; // Seems everything is patched up on // TODO refactor this part // Find the impact this bandage has and reduce the amount this injury is present _impact = if ((_mostEffectiveInjury select 3) >= _effectivenessFound) then {_effectivenessFound} else { (_mostEffectiveInjury select 3) }; -_mostEffectiveInjury set [ 3, ((_mostEffectiveInjury select 3) - _effectivenessFound) max 0]; +_mostEffectiveInjury set [ 3, ((_mostEffectiveInjury select 3) - _impact) max 0]; _openWounds set [_mostEffectiveSpot, _mostEffectiveInjury]; _target setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; if (USE_WOUND_EVENT_SYNC) then { - ["medical_propagateWound", [_unit, _mostEffectiveInjury]] call EFUNC(common,globalEvent); + ["medical_propagateWound", [_target, _mostEffectiveInjury]] call EFUNC(common,globalEvent); }; // Handle the reopening of bandaged wounds -if (_impact > 0) then { - // TODO handle reopening of bandaged wounds - // [_target, _impact, _part,_highestSpot, _removeItem] call FUNC(handleBandageOpening); +if (_impact > 0 && {GVAR(enableAdvancedWounds)}) then { + [_target, _impact, _part, _mostEffectiveSpot, _mostEffectiveInjury, _bandage] call FUNC(handleBandageOpening); }; // If all wounds have been bandaged, we will reset all damage to 0, so the unit is not showing any blood on the model anymore. diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf index e8669ecbec..77f6d7f44c 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf @@ -25,6 +25,7 @@ if (alive _target) exitwith { // wounds and injuries _target setvariable [QGVAR(openWounds), [], true]; + _target setvariable [QGVAR(bandagedWounds), [], true]; _target setVariable [QGVAR(internalWounds), [], true]; // vitals 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 aa7b5dbf17..66ecdf9d90 100644 --- a/addons/medical/functions/fnc_treatmentIVLocal.sqf +++ b/addons/medical/functions/fnc_treatmentIVLocal.sqf @@ -19,6 +19,9 @@ private ["_target", "_ivItem", "_config", "_volumeAdded", "_typeOf", "_varName"] _target = _this select 0; _ivItem = _this select 1; +_bloodVolume = _target getvariable [QGVAR(bloodVolume), 100]; +if (_bloodVolume >= 100) exitwith {}; + // Find the proper attributes for the used IV _config = (configFile >> "ACE_Medical_Advanced" >> "Treatment" >> "IV"); _volumeAdded = getNumber (_config >> "volume"); @@ -31,9 +34,9 @@ if (isClass (_config >> _className)) then { }; _varName = format["ACE_Medical_IVVolume_%1",_typeOf]; -_target setvariable [_varName, (_target getvariable [_varName, 0]) + _volumeAdded]; +_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 a23c37c658..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 @@ -336,6 +333,9 @@ Garot [CAT] Opaska uciskowa [CAT] + + Receiving IV [%1ml] + diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index 1fdd580724..df876ae2ae 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -1,10 +1,10 @@ class CfgAmmo { - class MissileBase; - - class M_PG_AT : MissileBase { - irLock = 0; - laserLock = 0; - airLock = 0; - manualControl = 0; - }; + class MissileBase; + + class M_PG_AT : MissileBase { + irLock = 0; + laserLock = 0; + airLock = 0; + manualControl = 0; + }; }; \ No newline at end of file diff --git a/addons/missileguidance/CfgEventhandlers.hpp b/addons/missileguidance/CfgEventhandlers.hpp index faa5edef0b..2775490d11 100644 --- a/addons/missileguidance/CfgEventhandlers.hpp +++ b/addons/missileguidance/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)); + }; }; \ No newline at end of file diff --git a/addons/missileguidance/CfgWeapons.hpp b/addons/missileguidance/CfgWeapons.hpp index d2961604b6..739ef3c5e0 100644 --- a/addons/missileguidance/CfgWeapons.hpp +++ b/addons/missileguidance/CfgWeapons.hpp @@ -1,34 +1,34 @@ class Mode_SemiAuto; class CfgWeapons { - class CannonCore; - class LauncherCore; - - class RocketPods: LauncherCore { - canLock = 1; - }; - class missiles_DAGR: RocketPods { - canLock = 1; - }; - /* - class autocannon_Base_F: CannonCore { - canLock = 1; - }; - class cannon_120mm: CannonCore { - canLock = 1; - - class player : Mode_SemiAuto { - canLock = 1; - }; - }; - class gatling_25mm: CannonCore { - canLock = 1; - }; - class autocannon_35mm: CannonCore { - canLock = 1; - }; - - class launch_NLAW_F: Launcher_Base_F - { - canLock = 1; - };*/ + class CannonCore; + class LauncherCore; + + class RocketPods: LauncherCore { + canLock = 1; + }; + class missiles_DAGR: RocketPods { + canLock = 1; + }; + /* + class autocannon_Base_F: CannonCore { + canLock = 1; + }; + class cannon_120mm: CannonCore { + canLock = 1; + + class player : Mode_SemiAuto { + canLock = 1; + }; + }; + class gatling_25mm: CannonCore { + canLock = 1; + }; + class autocannon_35mm: CannonCore { + canLock = 1; + }; + + class launch_NLAW_F: Launcher_Base_F + { + canLock = 1; + };*/ }; \ No newline at end of file diff --git a/addons/missileguidance/config.cpp b/addons/missileguidance/config.cpp index 6720559ccc..9c5842a065 100644 --- a/addons/missileguidance/config.cpp +++ b/addons/missileguidance/config.cpp @@ -1,13 +1,13 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { "ace_common", "ace_laser" }; - VERSION_CONFIG; - }; + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { "ace_common", "ace_laser" }; + VERSION_CONFIG; + }; }; #include "CfgEventhandlers.hpp" diff --git a/addons/missileguidance/functions/fnc_fired.sqf b/addons/missileguidance/functions/fnc_fired.sqf index 3b4f4b3635..dbe6abfec7 100644 --- a/addons/missileguidance/functions/fnc_fired.sqf +++ b/addons/missileguidance/functions/fnc_fired.sqf @@ -7,12 +7,12 @@ PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); if(!local _shooter) exitWith { false }; switch _weapon do { - case "missiles_DAGR": { - _this call FUNC(guidance_DAGR); - }; - case "GBU12BombLauncher": { - _this call FUNC(guidance_LGB); - }; + case "missiles_DAGR": { + _this call FUNC(guidance_DAGR); + }; + case "GBU12BombLauncher": { + _this call FUNC(guidance_LGB); + }; }; //_this call FUNC(guidance_HellfireII); diff --git a/addons/missileguidance/functions/fnc_guidance_DAGR.sqf b/addons/missileguidance/functions/fnc_guidance_DAGR.sqf index 4461c1223f..9055b00a7f 100644 --- a/addons/missileguidance/functions/fnc_guidance_DAGR.sqf +++ b/addons/missileguidance/functions/fnc_guidance_DAGR.sqf @@ -2,112 +2,119 @@ #include "script_component.hpp" FUNC(guidance_DIRECT_LOAL_PFH) = { - //TRACE_1("enter", _this); - _args = _this select 0; - //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - _shooter = _args select 0; - _dagr = _args select 6; - _curVelocity = velocity _dagr; - - if(!alive _dagr || isNull _dagr || isNull _shooter) exitWith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; - - _targets = [_dagr, ACE_DEFAULT_LASER_CODE, 70, _curVelocity] call ace_laser_fnc_findLaserDesignator; - TRACE_2("Targets", _target, _targets); - - if((_targets select 0)) then { - _target = _targets select 1; - - // player sideChat "FUCK!"; - // drop ["\a3\data_f\Cl_basic","","Billboard",1,20,(getPos _dagr),[0,0,0],1,1.275,1.0,0.0,[5],[[1,0,0,1]],[0],0.0,2.0,"","",""]; - - - _yVec = vectorDir _dagr; - _zVec = vectorUp _dagr; - _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); - - _dagrPos = getPosASL _dagr; - // player sideChat "G!"; - _targetPos = getPosASL _target; - if((count _targetPos) > 0) then { - _distanceToTarget = _dagrPos vectorDistance _targetPos; - - _addHeight = [0,0,(_dagrPos distance _targetPos)*0.02]; - #ifdef DEBUG_MODE_FULL - drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]]; - #endif - - _targetPos = _targetPos vectorAdd _addHeight; + //TRACE_1("enter", _this); + private["_args", "_shooter", "_dagr", "_curVelocity", "_targets", "_target", "_yVec", "_xVec", "_zVec", "_dagrPos", "_shooterPos", "_distanceToTarget", "_distanceToShooter", "_def"]; + _args = _this select 0; + //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + _shooter = _args select 0; + _dagr = _args select 6; + _curVelocity = velocity _dagr; + + if(!alive _dagr || isNull _dagr || isNull _shooter) exitWith { + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + + _targets = [_dagr, ACE_DEFAULT_LASER_CODE, 70, _curVelocity] call ace_laser_fnc_findLaserDesignator; + TRACE_2("Targets", _target, _targets); + + if((_targets select 0)) then { + _target = _targets select 1; + + // player sideChat "FUCK!"; + // drop ["\a3\data_f\Cl_basic","","Billboard",1,20,(getPos _dagr),[0,0,0],1,1.275,1.0,0.0,[5],[[1,0,0,1]],[0],0.0,2.0,"","",""]; + + + _yVec = vectorDir _dagr; + _zVec = vectorUp _dagr; + _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); + + _dagrPos = getPosASL _dagr; + // player sideChat "G!"; + _targetPos = getPosASL _target; + _shooterPos = getPosASL _shooter; + + if((count _targetPos) > 0) then { + _distanceToTarget = _dagrPos vectorDistance _targetPos; + _distanceToShooter = _dagrPos vectorDistance _shooterPos; + + _addHeight = [0,0,(_dagrPos distance _targetPos)*0.02]; + #ifdef DEBUG_MODE_FULL + drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]]; + #endif + + _targetPos = _targetPos vectorAdd _addHeight; - _def = 0.0050; - - _targetVectorSeeker = [_dagr, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); - // _targetVectorSeeker = _dagr worldToModel (ASLtoATL _targetPos); - // _targetVectorSeeker = [0,0,0] vectorFromTo _targetVectorSeeker; - _yaw = 0.0; - if((_targetVectorSeeker select 0) < 0) then { - _yaw = -_def; - } else { - if((_targetVectorSeeker select 0) > 0) then { - _yaw = _def; - }; - }; - - _pitch = 0.0; - if((_targetVectorSeeker select 2) < 0) then { - _pitch = -_def; - } else { - if((_targetVectorSeeker select 2) > 0) then { - _pitch = _def; - }; - }; - #ifdef DEBUG_MODE_FULL - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _dagrPos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; - drawLine3D [ASLtoATL _dagrPos, ASLtoATL _targetPos, [1,0,0,1]]; - - _distance = ([getPos startPos, _dagrPos] call BIS_fnc_distance2D); - _marker = createMarkerLocal [format["m%1", MARKERCOUNT], [_distance, _dagrPos select 2]]; - _marker setMarkerTypeLocal "mil_dot"; - _marker setMarkerColorLocal "ColorRed"; + _def = 0.0040; + if(_distanceToShooter > 100) then { + _def = 0.0025; + }; + + _targetVectorSeeker = [_dagr, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); + // _targetVectorSeeker = _dagr worldToModel (ASLtoATL _targetPos); + // _targetVectorSeeker = [0,0,0] vectorFromTo _targetVectorSeeker; + _yaw = 0.0; + if((_targetVectorSeeker select 0) < 0) then { + _yaw = -_def; + } else { + if((_targetVectorSeeker select 0) > 0) then { + _yaw = _def; + }; + }; + + _pitch = 0.0; + if((_targetVectorSeeker select 2) < 0) then { + _pitch = -_def; + } else { + if((_targetVectorSeeker select 2) > 0) then { + _pitch = _def; + }; + }; + #ifdef DEBUG_MODE_FULL + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _dagrPos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; + drawLine3D [ASLtoATL _dagrPos, ASLtoATL _targetPos, [1,0,0,1]]; + + _distance = ([getPos startPos, _dagrPos] call BIS_fnc_distance2D); + _marker = createMarkerLocal [format["m%1", MARKERCOUNT], [_distance, _dagrPos select 2]]; + _marker setMarkerTypeLocal "mil_dot"; + _marker setMarkerColorLocal "ColorRed"; - MARKERCOUNT = MARKERCOUNT + 1; - #endif - - if(accTime > 0) then { - _outVector = [_dagr, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); - // _outVector = _dagr modelToWorld [_yaw, 1, _pitch]; - // _outVector = ATLtoASL _outVector; - _vectorTo = _dagrPos vectorFromTo _outVector; - - // hintSilent format["v: %1", _vectorTo]; - - // _dagr setVectorDir _vectorTo; - _dagr setVectorDirAndUp [_vectorTo, vectorUp _dagr]; - }; - - #ifdef DEBUG_MODE_FULL - hintSilent format["d: %1", _distanceToTarget]; - #endif - }; - }; + MARKERCOUNT = MARKERCOUNT + 1; + #endif + + if(accTime > 0) then { + _outVector = [_dagr, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); + // _outVector = _dagr modelToWorldVisual [_yaw, 1, _pitch]; + // _outVector = ATLtoASL _outVector; + _vectorTo = _dagrPos vectorFromTo _outVector; + + // hintSilent format["v: %1", _vectorTo]; + + // _dagr setVectorDir _vectorTo; + _dagr setVectorDirAndUp [_vectorTo, vectorUp _dagr]; + }; + + #ifdef DEBUG_MODE_FULL + hintSilent format["d: %1", _distanceToTarget]; + #endif + }; + }; }; FUNC(guidance_DAGR_DIRECT_LOAL) = { - PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - - GVAR(lastTime) = time; - [FUNC(guidance_DIRECT_LOAL_PFH), 0, _this] call cba_fnc_addPerFrameHandler; + PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + + GVAR(lastTime) = time; + [FUNC(guidance_DIRECT_LOAL_PFH), 0, _this] call cba_fnc_addPerFrameHandler; }; PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); _fireMode = _shooter getVariable ["ACE_FIRE_SELECTION", ACE_DEFAULT_FIRE_SELECTION]; switch (_fireMode select 0) do { - // Default to FIREMODE_DIRECT_LOAL - // FIREMODE_DIRECT_LOAL - default { - LOG("Initiating DAGR FIREMODE_DIRECT_LOAL"); - _this call FUNC(guidance_DAGR_DIRECT_LOAL); - }; + // Default to FIREMODE_DIRECT_LOAL + // FIREMODE_DIRECT_LOAL + default { + LOG("Initiating DAGR FIREMODE_DIRECT_LOAL"); + _this call FUNC(guidance_DAGR_DIRECT_LOAL); + }; }; \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_guidance_HellfireII.sqf b/addons/missileguidance/functions/fnc_guidance_HellfireII.sqf index e6551ad4f4..72b8da8c67 100644 --- a/addons/missileguidance/functions/fnc_guidance_HellfireII.sqf +++ b/addons/missileguidance/functions/fnc_guidance_HellfireII.sqf @@ -2,248 +2,248 @@ #include "script_component.hpp" FUNC(guidance_Hellfire_LOAL_HI_PFH) = { - //TRACE_1("enter", _this); - _args = _this select 0; - //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - _shooter = _args select 0; - _missile = _args select 6; - _curVelocity = velocity _missile; - - if(!alive _missile || isNull _missile || isNull _shooter) exitWith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; - - _launchPos = _shooter getVariable [QGVAR(launchPos), nil]; - if(isNil "_launchPos") then { - TRACE_1("Setting launch parameters", ""); - _launchPos = getPosASL _shooter; - _shooter setVariable [QGVAR(launchPos), _launchPos, false]; - _shooter setVariable [QGVAR(launchTime), diag_tickTime, false]; - }; - - _targets = [_missile, ACE_DEFAULT_LASER_CODE, 70, _curVelocity] call ace_laser_fnc_findLaserDesignator; - _addHeight = [0,0,0]; - if((_targets select 0)) then { - _target = _targets select 1; - TRACE_2("Targets", _target, _targets); - - _yVec = vectorDir _missile; - _zVec = vectorUp _missile; - _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); - - _missilePos = getPosASL _missile; - // player sideChat "G!"; - _targetPos = getPosASL _target; - TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos)); - if((count _targetPos) > 0) then { - _distanceToTarget = _missilePos vectorDistance _targetPos; - - _defPitch = 0.05; - - if((_launchPos distance _missilePos) < 400 && (_targetPos distance _missilePos) > 400) then { - _addHeight = [0,0,(_targetPos select 2) + ((_launchPos distance _targetPos)*2)]; - TRACE_1("Climb phase", _addHeight); - //_defPitch = 0.1; - } else { - // Covered half the distance, go terminal - if((_missilePos distance _targetPos) < (_launchPos distance _targetPos) / 2) then { - TRACE_1("TERMINAL", ""); - } else { - if((_missilePos select 2) > (_targetPos select 2)) then { - _heightDiff = (_missilePos select 2) - (_targetPos select 2); - TRACE_1("Coasting", _heightDiff); - _addHeight = [0,0, _heightDiff]; - }; - }; - }; - _targetPos = _targetPos vectorAdd _addHeight; - - _defYaw = 0.0035; - - - _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); - _yaw = 0.0; - if((_targetVectorSeeker select 0) < 0) then { - _yaw = -_defYaw; - } else { - if((_targetVectorSeeker select 0) > 0) then { - _yaw = _defYaw; - }; - }; - - _pitch = 0.0; - if((_targetVectorSeeker select 2) < 0) then { - _pitch = -_defPitch; - } else { - if((_targetVectorSeeker select 2) > 0) then { - _pitch = _defPitch; - }; - }; - #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]]; - - _distance = ([getPos startPos, _missilePos] call BIS_fnc_distance2D); - _marker = createMarkerLocal [format["m%1", MARKERCOUNT], [_distance, _missilePos select 2]]; - _marker setMarkerTypeLocal "mil_dot"; - _marker setMarkerColorLocal "ColorRed"; + //TRACE_1("enter", _this); + _args = _this select 0; + //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + _shooter = _args select 0; + _missile = _args select 6; + _curVelocity = velocity _missile; + + if(!alive _missile || isNull _missile || isNull _shooter) exitWith { + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + + _launchPos = _shooter getVariable [QGVAR(launchPos), nil]; + if(isNil "_launchPos") then { + TRACE_1("Setting launch parameters", ""); + _launchPos = getPosASL _shooter; + _shooter setVariable [QGVAR(launchPos), _launchPos, false]; + _shooter setVariable [QGVAR(launchTime), diag_tickTime, false]; + }; + + _targets = [_missile, ACE_DEFAULT_LASER_CODE, 70, _curVelocity] call ace_laser_fnc_findLaserDesignator; + _addHeight = [0,0,0]; + if((_targets select 0)) then { + _target = _targets select 1; + TRACE_2("Targets", _target, _targets); + + _yVec = vectorDir _missile; + _zVec = vectorUp _missile; + _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); + + _missilePos = getPosASL _missile; + // player sideChat "G!"; + _targetPos = getPosASL _target; + TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos)); + if((count _targetPos) > 0) then { + _distanceToTarget = _missilePos vectorDistance _targetPos; + + _defPitch = 0.05; + + if((_launchPos distance _missilePos) < 400 && (_targetPos distance _missilePos) > 400) then { + _addHeight = [0,0,(_targetPos select 2) + ((_launchPos distance _targetPos)*2)]; + TRACE_1("Climb phase", _addHeight); + //_defPitch = 0.1; + } else { + // Covered half the distance, go terminal + if((_missilePos distance _targetPos) < (_launchPos distance _targetPos) / 2) then { + TRACE_1("TERMINAL", ""); + } else { + if((_missilePos select 2) > (_targetPos select 2)) then { + _heightDiff = (_missilePos select 2) - (_targetPos select 2); + TRACE_1("Coasting", _heightDiff); + _addHeight = [0,0, _heightDiff]; + }; + }; + }; + _targetPos = _targetPos vectorAdd _addHeight; + + _defYaw = 0.0035; + + + _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); + _yaw = 0.0; + if((_targetVectorSeeker select 0) < 0) then { + _yaw = -_defYaw; + } else { + if((_targetVectorSeeker select 0) > 0) then { + _yaw = _defYaw; + }; + }; + + _pitch = 0.0; + if((_targetVectorSeeker select 2) < 0) then { + _pitch = -_defPitch; + } else { + if((_targetVectorSeeker select 2) > 0) then { + _pitch = _defPitch; + }; + }; + #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]]; + + _distance = ([getPos startPos, _missilePos] call BIS_fnc_distance2D); + _marker = createMarkerLocal [format["m%1", MARKERCOUNT], [_distance, _missilePos select 2]]; + _marker setMarkerTypeLocal "mil_dot"; + _marker setMarkerColorLocal "ColorRed"; - MARKERCOUNT = MARKERCOUNT + 1; - #endif - - if(accTime > 0) then { - _outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); - - _vectorTo = _missilePos vectorFromTo _outVector; - _missile setVectorDirAndUp [_vectorTo, vectorUp _missile]; - }; - - #ifdef DEBUG_MODE_FULL - hintSilent format["d: %1", _distanceToTarget]; - #endif - }; - }; + MARKERCOUNT = MARKERCOUNT + 1; + #endif + + if(accTime > 0) then { + _outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); + + _vectorTo = _missilePos vectorFromTo _outVector; + _missile setVectorDirAndUp [_vectorTo, vectorUp _missile]; + }; + + #ifdef DEBUG_MODE_FULL + hintSilent format["d: %1", _distanceToTarget]; + #endif + }; + }; }; FUNC(guidance_Hellfire_LOAL_DIR_PFH) = { - //TRACE_1("enter", _this); - _args = _this select 0; - //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - _shooter = _args select 0; - _missile = _args select 6; - _curVelocity = velocity _missile; - - if(!alive _missile || isNull _missile || isNull _shooter) exitWith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; - - _launchPos = _shooter getVariable [QGVAR(launchPos), nil]; - if(isNil "_launchPos") then { - TRACE_1("Setting launch parameters", ""); - _launchPos = getPosASL _shooter; - _shooter setVariable [QGVAR(launchPos), _launchPos, false]; - _shooter setVariable [QGVAR(launchTime), diag_tickTime, false]; - }; - - _targets = [_missile, ACE_DEFAULT_LASER_CODE, 70, _curVelocity] call ace__laser_fnc_findLaserDesignator; - _addHeight = [0,0,0]; - if((_targets select 0)) then { - _target = _targets select 1; - TRACE_2("Targets", _target, _targets); - - _yVec = vectorDir _missile; - _zVec = vectorUp _missile; - _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); - - _missilePos = getPosASL _missile; - // player sideChat "G!"; - _targetPos = getPosASL _target; - TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos)); - if((count _targetPos) > 0) then { - _distanceToTarget = _missilePos vectorDistance _targetPos; - - if((_launchPos distance _missilePos) < 400 && (_targetPos distance _missilePos) > 400) then { - _addHeight = [0,0,(_targetPos select 2) + (_missilePos distance _targetPos)*0.5]; - TRACE_1("Climb phase", _addHeight); - } else { - // Covered half the distance, go terminal - if((_missilePos distance _targetPos) < (_launchPos distance _targetPos) / 2) then { - TRACE_1("TERMINAL", ""); - } else { - if((_missilePos select 2) > (_targetPos select 2)) then { - _heightDiff = (_missilePos select 2) - (_targetPos select 2); - TRACE_1("Coasting", _heightDiff); - _addHeight = [0,0, _heightDiff]; - }; - }; - }; - _targetPos = _targetPos vectorAdd _addHeight; - - _defYaw = 0.0035; - _defPitch = 0.0075; - - _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); - _yaw = 0.0; - if((_targetVectorSeeker select 0) < 0) then { - _yaw = -_defYaw; - } else { - if((_targetVectorSeeker select 0) > 0) then { - _yaw = _defYaw; - }; - }; - - _pitch = 0.0; - if((_targetVectorSeeker select 2) < 0) then { - _pitch = -_defPitch; - } else { - if((_targetVectorSeeker select 2) > 0) then { - _pitch = _defPitch; - }; - }; - #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]]; - - _distance = ([getPos startPos, _missilePos] call BIS_fnc_distance2D); - _marker = createMarkerLocal [format["m%1", MARKERCOUNT], [_distance, _missilePos select 2]]; - _marker setMarkerTypeLocal "mil_dot"; - _marker setMarkerColorLocal "ColorRed"; + //TRACE_1("enter", _this); + _args = _this select 0; + //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + _shooter = _args select 0; + _missile = _args select 6; + _curVelocity = velocity _missile; + + if(!alive _missile || isNull _missile || isNull _shooter) exitWith { + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + + _launchPos = _shooter getVariable [QGVAR(launchPos), nil]; + if(isNil "_launchPos") then { + TRACE_1("Setting launch parameters", ""); + _launchPos = getPosASL _shooter; + _shooter setVariable [QGVAR(launchPos), _launchPos, false]; + _shooter setVariable [QGVAR(launchTime), diag_tickTime, false]; + }; + + _targets = [_missile, ACE_DEFAULT_LASER_CODE, 70, _curVelocity] call ace__laser_fnc_findLaserDesignator; + _addHeight = [0,0,0]; + if((_targets select 0)) then { + _target = _targets select 1; + TRACE_2("Targets", _target, _targets); + + _yVec = vectorDir _missile; + _zVec = vectorUp _missile; + _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); + + _missilePos = getPosASL _missile; + // player sideChat "G!"; + _targetPos = getPosASL _target; + TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos)); + if((count _targetPos) > 0) then { + _distanceToTarget = _missilePos vectorDistance _targetPos; + + if((_launchPos distance _missilePos) < 400 && (_targetPos distance _missilePos) > 400) then { + _addHeight = [0,0,(_targetPos select 2) + (_missilePos distance _targetPos)*0.5]; + TRACE_1("Climb phase", _addHeight); + } else { + // Covered half the distance, go terminal + if((_missilePos distance _targetPos) < (_launchPos distance _targetPos) / 2) then { + TRACE_1("TERMINAL", ""); + } else { + if((_missilePos select 2) > (_targetPos select 2)) then { + _heightDiff = (_missilePos select 2) - (_targetPos select 2); + TRACE_1("Coasting", _heightDiff); + _addHeight = [0,0, _heightDiff]; + }; + }; + }; + _targetPos = _targetPos vectorAdd _addHeight; + + _defYaw = 0.0035; + _defPitch = 0.0075; + + _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); + _yaw = 0.0; + if((_targetVectorSeeker select 0) < 0) then { + _yaw = -_defYaw; + } else { + if((_targetVectorSeeker select 0) > 0) then { + _yaw = _defYaw; + }; + }; + + _pitch = 0.0; + if((_targetVectorSeeker select 2) < 0) then { + _pitch = -_defPitch; + } else { + if((_targetVectorSeeker select 2) > 0) then { + _pitch = _defPitch; + }; + }; + #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]]; + + _distance = ([getPos startPos, _missilePos] call BIS_fnc_distance2D); + _marker = createMarkerLocal [format["m%1", MARKERCOUNT], [_distance, _missilePos select 2]]; + _marker setMarkerTypeLocal "mil_dot"; + _marker setMarkerColorLocal "ColorRed"; - MARKERCOUNT = MARKERCOUNT + 1; - #endif - - if(accTime > 0) then { - _outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); - - _vectorTo = _missilePos vectorFromTo _outVector; - _missile setVectorDirAndUp [_vectorTo, vectorUp _missile]; - }; - - #ifdef DEBUG_MODE_FULL - hintSilent format["d: %1", _distanceToTarget]; - #endif - }; - }; + MARKERCOUNT = MARKERCOUNT + 1; + #endif + + if(accTime > 0) then { + _outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); + + _vectorTo = _missilePos vectorFromTo _outVector; + _missile setVectorDirAndUp [_vectorTo, vectorUp _missile]; + }; + + #ifdef DEBUG_MODE_FULL + hintSilent format["d: %1", _distanceToTarget]; + #endif + }; + }; }; FUNC(guidance_Hellfire_LOAL_HI) = { - PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - - GVAR(lastTime) = time; - [FUNC(guidance_Hellfire_LOAL_HI_PFH), 0, _this] call cba_fnc_addPerFrameHandler; + PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + + GVAR(lastTime) = time; + [FUNC(guidance_Hellfire_LOAL_HI_PFH), 0, _this] call cba_fnc_addPerFrameHandler; }; FUNC(guidance_Hellfire_LOAL_DIR) = { - PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - - GVAR(lastTime) = time; - [FUNC(guidance_Hellfire_LOAL_DIR_PFH), 0, _this] call cba_fnc_addPerFrameHandler; + PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + + GVAR(lastTime) = time; + [FUNC(guidance_Hellfire_LOAL_DIR_PFH), 0, _this] call cba_fnc_addPerFrameHandler; }; PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); _fireMode = _shooter getVariable ["ACE_FIRE_SELECTION", ACE_DEFAULT_FIRE_SELECTION]; switch (_fireMode select 0) do { - // Default to FIREMODE_DIRECT_LOAL - // FIREMODE_DIRECT_LOAL - default { - LOG("Initiating Hellfire II FIREMODE_LOAL_DIR"); - _this call FUNC(guidance_Hellfire_LOAL_HI); - }; + // Default to FIREMODE_DIRECT_LOAL + // FIREMODE_DIRECT_LOAL + default { + LOG("Initiating Hellfire II FIREMODE_LOAL_DIR"); + _this call FUNC(guidance_Hellfire_LOAL_HI); + }; }; \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_guidance_LGB.sqf b/addons/missileguidance/functions/fnc_guidance_LGB.sqf index e9e8754f19..47efa46768 100644 --- a/addons/missileguidance/functions/fnc_guidance_LGB.sqf +++ b/addons/missileguidance/functions/fnc_guidance_LGB.sqf @@ -2,108 +2,108 @@ #include "script_component.hpp" FUNC(guidance_LGB_LOAL_PFH) = { - //TRACE_1("enter", _this); - _args = _this select 0; - //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - _lgb = _args select 6; - _curVelocity = velocity _lgb; - - if(!alive _lgb) exitWith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; - - _targets = [_lgb, ACE_DEFAULT_LASER_CODE, 70, _curVelocity] call uo_laser_fnc_findLaserDesignator; - //TRACE_2("Targets", _target, _targets); - - if((_targets select 0)) then { - _target = _targets select 1; - - // player sideChat "FUCK!"; - // drop ["\a3\data_f\Cl_basic","","Billboard",1,20,(getPos _lgb),[0,0,0],1,1.275,1.0,0.0,[5],[[1,0,0,1]],[0],0.0,2.0,"","",""]; - - - _yVec = vectorDir _lgb; - _zVec = vectorUp _lgb; - _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); - - _lgbPos = getPosASL _lgb; - // player sideChat "G!"; - _targetPos = getPosASL _target; - if((count _targetPos) > 0) then { - // player sideChat format["f: %1", _targetPos]; - _addHeight = [0,0,(_lgbPos distance _targetPos)*0.06]; - // drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]]; - _targetPos = _targetPos vectorAdd _addHeight; - - - - _def = 0.0025; - - _targetVectorSeeker = [_lgb, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); - // _targetVectorSeeker = _lgb worldToModel (ASLtoATL _targetPos); - // _targetVectorSeeker = [0,0,0] vectorFromTo _targetVectorSeeker; - _yaw = 0.0; - if((_targetVectorSeeker select 0) < 0) then { - _yaw = -_def; - } else { - if((_targetVectorSeeker select 0) > 0) then { - _yaw = _def; - }; - }; - - _pitch = 0.0; - if((_targetVectorSeeker select 2) < 0) then { - _pitch = -_def; - } else { - if((_targetVectorSeeker select 2) > 0) then { - _pitch = _def; - }; - }; - #ifdef DEBUG_MODE_FULL - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _lgbPos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; - drawLine3D [ASLtoATL _lgbPos, ASLtoATL _targetPos, [1,0,0,1]]; - - _distance = ([getPos startPos, _lgbPos] call BIS_fnc_distance2D); - _marker = createMarkerLocal [format["m%1", MARKERCOUNT], [_distance, _lgbPos select 2]]; - _marker setMarkerTypeLocal "mil_dot"; - _marker setMarkerColorLocal "ColorRed"; + //TRACE_1("enter", _this); + _args = _this select 0; + //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + _lgb = _args select 6; + _curVelocity = velocity _lgb; + + if(!alive _lgb) exitWith { + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + + _targets = [_lgb, ACE_DEFAULT_LASER_CODE, 70, _curVelocity] call uo_laser_fnc_findLaserDesignator; + //TRACE_2("Targets", _target, _targets); + + if((_targets select 0)) then { + _target = _targets select 1; + + // player sideChat "FUCK!"; + // drop ["\a3\data_f\Cl_basic","","Billboard",1,20,(getPos _lgb),[0,0,0],1,1.275,1.0,0.0,[5],[[1,0,0,1]],[0],0.0,2.0,"","",""]; + + + _yVec = vectorDir _lgb; + _zVec = vectorUp _lgb; + _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); + + _lgbPos = getPosASL _lgb; + // player sideChat "G!"; + _targetPos = getPosASL _target; + if((count _targetPos) > 0) then { + // player sideChat format["f: %1", _targetPos]; + _addHeight = [0,0,(_lgbPos distance _targetPos)*0.06]; + // drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]]; + _targetPos = _targetPos vectorAdd _addHeight; + + + + _def = 0.0025; + + _targetVectorSeeker = [_lgb, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); + // _targetVectorSeeker = _lgb worldToModel (ASLtoATL _targetPos); + // _targetVectorSeeker = [0,0,0] vectorFromTo _targetVectorSeeker; + _yaw = 0.0; + if((_targetVectorSeeker select 0) < 0) then { + _yaw = -_def; + } else { + if((_targetVectorSeeker select 0) > 0) then { + _yaw = _def; + }; + }; + + _pitch = 0.0; + if((_targetVectorSeeker select 2) < 0) then { + _pitch = -_def; + } else { + if((_targetVectorSeeker select 2) > 0) then { + _pitch = _def; + }; + }; + #ifdef DEBUG_MODE_FULL + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _lgbPos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; + drawLine3D [ASLtoATL _lgbPos, ASLtoATL _targetPos, [1,0,0,1]]; + + _distance = ([getPos startPos, _lgbPos] call BIS_fnc_distance2D); + _marker = createMarkerLocal [format["m%1", MARKERCOUNT], [_distance, _lgbPos select 2]]; + _marker setMarkerTypeLocal "mil_dot"; + _marker setMarkerColorLocal "ColorRed"; - MARKERCOUNT = MARKERCOUNT + 1; - #endif - - if(accTime > 0) then { - _outVector = [_lgb, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); - // _outVector = _lgb modelToWorld [_yaw, 1, _pitch]; - // _outVector = ATLtoASL _outVector; - _vectorTo = _lgbPos vectorFromTo _outVector; - - // hintSilent format["v: %1", _vectorTo]; - - // _lgb setVectorDir _vectorTo; - _lgb setVectorDirAndUp [_vectorTo, vectorUp _lgb]; - }; - - #ifdef DEBUG_MODE_FULL - hintSilent format["d: %1", _lgbPos vectorDistance _targetPos]; - #endif - }; - }; + MARKERCOUNT = MARKERCOUNT + 1; + #endif + + if(accTime > 0) then { + _outVector = [_lgb, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); + // _outVector = _lgb modelToWorldVisual [_yaw, 1, _pitch]; + // _outVector = ATLtoASL _outVector; + _vectorTo = _lgbPos vectorFromTo _outVector; + + // hintSilent format["v: %1", _vectorTo]; + + // _lgb setVectorDir _vectorTo; + _lgb setVectorDirAndUp [_vectorTo, vectorUp _lgb]; + }; + + #ifdef DEBUG_MODE_FULL + hintSilent format["d: %1", _lgbPos vectorDistance _targetPos]; + #endif + }; + }; }; FUNC(guidance_LGB_LOAL) = { - PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - - [FUNC(guidance_LGB_LOAL_PFH), 0, _this] call cba_fnc_addPerFrameHandler; + PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + + [FUNC(guidance_LGB_LOAL_PFH), 0, _this] call cba_fnc_addPerFrameHandler; }; PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); _fireMode = _shooter getVariable ["ACE_FIRE_SELECTION", ACE_DEFAULT_FIRE_SELECTION]; switch (_fireMode select 0) do { - // Default to FIREMODE_DIRECT_LOAL - // FIREMODE_DIRECT_LOAL - default { - LOG("Initiating FIREMODE_DIRECT_LOAL"); - _this call FUNC(guidance_LGB_LOAL); - }; + // Default to FIREMODE_DIRECT_LOAL + // FIREMODE_DIRECT_LOAL + default { + LOG("Initiating FIREMODE_DIRECT_LOAL"); + _this call FUNC(guidance_LGB_LOAL); + }; }; \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_translateToWeaponSpace.sqf b/addons/missileguidance/functions/fnc_translateToWeaponSpace.sqf index 406d81b145..2c7dc5e6da 100644 --- a/addons/missileguidance/functions/fnc_translateToWeaponSpace.sqf +++ b/addons/missileguidance/functions/fnc_translateToWeaponSpace.sqf @@ -14,9 +14,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/missileguidance/script_component.hpp b/addons/missileguidance/script_component.hpp index 886764be2b..377469cdee 100644 --- a/addons/missileguidance/script_component.hpp +++ b/addons/missileguidance/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_MISSILEGUIDANCE - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_MISSILEGUIDANCE - #define DEBUG_SETTINGS DEBUG_SETTINGS_MISSILEGUIDANCE + #define DEBUG_SETTINGS DEBUG_SETTINGS_MISSILEGUIDANCE #endif #include "\z\ace\Addons\main\script_macros.hpp" 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/movement/functions/fnc_handleClimb.sqf b/addons/movement/functions/fnc_handleClimb.sqf index da0f8e0224..39ca9b1e92 100644 --- a/addons/movement/functions/fnc_handleClimb.sqf +++ b/addons/movement/functions/fnc_handleClimb.sqf @@ -21,7 +21,7 @@ private ["_unit", "_anim", "_pos"]; _unit = _this select 0; _anim = _this select 1; -_pos = _unit modelToWorld (_unit selectionPosition "camera"); +_pos = _unit modelToWorldVisual (_unit selectionPosition "camera"); [_unit, "AmovPknlMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); _pos = _pos vectorDiff (_unit selectionPosition "camera"); diff --git a/addons/optionsmenu/CfgVehicles.hpp b/addons/optionsmenu/CfgVehicles.hpp new file mode 100644 index 0000000000..2a19aa2966 --- /dev/null +++ b/addons/optionsmenu/CfgVehicles.hpp @@ -0,0 +1,28 @@ +class CfgVehicles { + class ACE_Module; + // TODO localization for all the modules + class ACE_moduleAllowConfigExport: ACE_Module { + scope = 2; + displayName = "Allow Config Export [ACE]"; + //icon = ""; + category = "ACE"; + function = QUOTE(DFUNC(moduleAllowConfigExport)); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "$STR_ACE_Common_ACETeam"; + class Arguments { + class allowconfigurationExport { + displayName = "Allow"; + description = "Allow export of all settings to a server config formatted."; + typeName = "BOOL"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = "When allowed, you have access to the settings modification and export in SP. Clicking export will place the formated config on your clipboard."; + sync[] = {}; + }; + }; + +}; \ No newline at end of file diff --git a/addons/optionsmenu/XEH_preInit.sqf b/addons/optionsmenu/XEH_preInit.sqf index 83a50bce65..42f50287f2 100644 --- a/addons/optionsmenu/XEH_preInit.sqf +++ b/addons/optionsmenu/XEH_preInit.sqf @@ -6,12 +6,27 @@ PREP(onListBoxSettingsChanged); PREP(onListBoxShowSelectionChanged); PREP(onSettingsMenuOpen); PREP(onSliderPosChanged); +PREP(onServerSaveInputField); +PREP(onServerSettingsMenuOpen); +PREP(onServerListBoxShowSelectionChanged); PREP(resetSettings); +PREP(serverResetSettings); PREP(settingsMenuUpdateKeyView); PREP(settingsMenuUpdateList); +PREP(serverSettingsMenuUpdateKeyView); +PREP(serverSettingsMenuUpdateList); PREP(updateSetting); +PREP(exportSettings); +PREP(toggleIncludeClientSettings); +PREP(moduleAllowConfigExport); GVAR(clientSideOptions) = []; GVAR(clientSideColors) = []; +GVAR(serverConfigGeneration) = 0; +GVAR(ClientSettingsExportIncluded) = false; +GVAR(serverSideOptions) = []; +GVAR(serverSideColors) = []; +GVAR(serverSideValues) = []; + ADDON = true; diff --git a/addons/optionsmenu/config.cpp b/addons/optionsmenu/config.cpp index 7850e5972e..89d5768603 100644 --- a/addons/optionsmenu/config.cpp +++ b/addons/optionsmenu/config.cpp @@ -2,7 +2,7 @@ class CfgPatches { class ADDON { - units[] = {}; + units[] = {"ACE_moduleAllowConfigExport"}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; @@ -25,3 +25,5 @@ class CfgAddons { #include "gui\define.hpp" #include "gui\settingsMenu.hpp" #include "gui\pauseMenu.hpp" + +#include "CFgVehicles.hpp" diff --git a/addons/optionsmenu/functions/fnc_exportSettings.sqf b/addons/optionsmenu/functions/fnc_exportSettings.sqf new file mode 100644 index 0000000000..3ac2455a64 --- /dev/null +++ b/addons/optionsmenu/functions/fnc_exportSettings.sqf @@ -0,0 +1,61 @@ +/* + * Author: Glowbal + * Export all config settings with their current values. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ACE_optionsmenu_fnc_exportSettings + * + * Public: No + */ + +#include "script_component.hpp" + +_compiledConfig = " +"; +{ + /*_settingData = [ + _name, + _typeName, + _isClientSetable, + _localizedName, + _localizedDescription, + _possibleValues, + _isForced, + _defaultValue + ];*/ + + _name = _x select 0; + _typeName = _x select 1; + _isClientSetable = _x select 2; + _localizedName = _x select 3; + _localizedDescription = _x select 4; + _possibleValues = _x select 5; + _defaultValue = _x select 6; + + if (GVAR(ClientSettingsExportIncluded) || !_isClientSetable) then { + _value = missionNamespace getvariable [_name, _defaultValue]; + if (_typeName == "STRING") then { // I dont think we have string values, but just in case + _value = format['"%1"', _value]; + }; + if (_typeName == "BOOL") then { + _value = if (typeName _value == "BOOL" && {_value}) then {1} else {0}; + }; + _compiledConfigEntry = format [" +class %1 { + value = %2; + typeName = %3; + force = 1; +};", _name, _value, format['"%1"', _typeName]]; + _compiledConfig = _compiledConfig + _compiledConfigEntry; + }; +} forEach EGVAR(common,settings); + +copyToClipboard format["%1",_compiledConfig]; + +["STR_ACE_OptionsMenu_settingsExported"] call EFUNC(common,displayTextStructured); diff --git a/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf b/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf new file mode 100644 index 0000000000..d756a0ef83 --- /dev/null +++ b/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf @@ -0,0 +1,25 @@ +/* + * Author: Glowbal + * + * + * Arguments: + * none + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_logic"]; +_logic = _this select 0; + +if (isMultiplayer) exitwith {}; + +if (_logic getvariable ["allowconfigurationExport", false]) then { + GVAR(serverConfigGeneration) = 1; +} else { + GVAR(serverConfigGeneration) = 0; +}; diff --git a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf index 5846d0dccb..1543a2c8d5 100644 --- a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf @@ -24,11 +24,18 @@ _rightDropDownIndex = lbCurSel 400; //Index of right drop down if (_rightDropDownIndex < 0) then {_rightDropDownIndex = 0;}; switch (GVAR(optionMenu_openTab)) do { -case (MENU_TAB_OPTIONS): { - if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideOptions)))) then { - _settingIndex = (GVAR(clientSideOptions) select _settingIndex) select 0; - [MENU_TAB_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting); - }; - [false] call FUNC(settingsMenuUpdateList); - }; + case (MENU_TAB_OPTIONS): { + if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideOptions)))) then { + _settingIndex = (GVAR(clientSideOptions) select _settingIndex) select 0; + [MENU_TAB_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting); + }; + [false] call FUNC(settingsMenuUpdateList); + }; + case (MENU_TAB_SERVER_OPTIONS): { + if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(serverSideOptions)))) then { + _settingIndex = (GVAR(serverSideOptions) select _settingIndex) select 0; + [MENU_TAB_SERVER_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting); + }; + [false] call FUNC(serverSettingsMenuUpdateList); + }; }; diff --git a/addons/optionsmenu/functions/fnc_onServerListBoxShowSelectionChanged.sqf b/addons/optionsmenu/functions/fnc_onServerListBoxShowSelectionChanged.sqf new file mode 100644 index 0000000000..aaeec2d9ac --- /dev/null +++ b/addons/optionsmenu/functions/fnc_onServerListBoxShowSelectionChanged.sqf @@ -0,0 +1,88 @@ +/* + * Author: Glowbal + * Changes which tab is open (options or colors) + * + * Arguments: + * The tab to open (defined in script_component) + * + * Return Value: + * None + * + * Example: + * [MENU_TAB_COLORS] call ACE_optionsmenu_fnc_onListBoxShowSelectionChanged + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_settingsMenu", "_localizedHeader"]; + +PARAMS_1(_openTab); +GVAR(optionMenu_openTab) = _openTab; + +disableSerialization; +_settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; + +switch (GVAR(optionMenu_openTab)) do { +case (MENU_TAB_SERVER_OPTIONS): { + _localizedHeader = format ["%1: %2", (localize "STR_ACE_OptionsMenu_OpenConfigMenu"), (localize "STR_ACE_OptionsMenu_TabOptions")]; + ctrlSetText [13, _localizedHeader]; + lbClear 400; + + (_settingsMenu displayCtrl 301) ctrlShow true; + + (_settingsMenu displayCtrl 400) ctrlShow true; + (_settingsMenu displayCtrl 410) ctrlShow false; + (_settingsMenu displayCtrl 411) ctrlShow false; + (_settingsMenu displayCtrl 412) ctrlShow false; + (_settingsMenu displayCtrl 413) ctrlShow false; + (_settingsMenu displayCtrl 414) ctrlShow false; + (_settingsMenu displayCtrl 415) ctrlShow false; + (_settingsMenu displayCtrl 416) ctrlShow false; + (_settingsMenu displayCtrl 416) ctrlEnable false; + }; +case (MENU_TAB_SERVER_COLORS): { + _localizedHeader = format ["%1: %2", (localize "STR_ACE_OptionsMenu_OpenConfigMenu"), (localize "STR_ACE_OptionsMenu_TabColors")]; + ctrlSetText [13, _localizedHeader]; + + lbClear 400; + + (_settingsMenu displayCtrl 301) ctrlShow false; + + (_settingsMenu displayCtrl 400) ctrlShow false; + (_settingsMenu displayCtrl 410) ctrlShow true; + (_settingsMenu displayCtrl 411) ctrlShow true; + (_settingsMenu displayCtrl 412) ctrlShow true; + (_settingsMenu displayCtrl 413) ctrlShow true; + + (_settingsMenu displayCtrl 410) sliderSetRange [0, 255]; + (_settingsMenu displayCtrl 411) sliderSetRange [0, 255]; + (_settingsMenu displayCtrl 412) sliderSetRange [0, 255]; + (_settingsMenu displayCtrl 413) sliderSetRange [0, 255]; + + (_settingsMenu displayCtrl 414) ctrlShow false; + (_settingsMenu displayCtrl 415) ctrlShow false; + (_settingsMenu displayCtrl 416) ctrlShow false; + (_settingsMenu displayCtrl 416) ctrlEnable false; + }; +case (MENU_TAB_SERVER_VALUES): { + _localizedHeader = format ["%1: %2", (localize "STR_ACE_OptionsMenu_OpenConfigMenu"), (localize "STR_ACE_OptionsMenu_TabValues")]; + ctrlSetText [13, _localizedHeader]; + + lbClear 400; + (_settingsMenu displayCtrl 301) ctrlShow false; + (_settingsMenu displayCtrl 400) ctrlShow false; + (_settingsMenu displayCtrl 410) ctrlShow false; + (_settingsMenu displayCtrl 411) ctrlShow false; + (_settingsMenu displayCtrl 412) ctrlShow false; + (_settingsMenu displayCtrl 413) ctrlShow false; + + (_settingsMenu displayCtrl 414) ctrlShow true; + (_settingsMenu displayCtrl 415) ctrlShow true; + (_settingsMenu displayCtrl 416) ctrlShow true; + (_settingsMenu displayCtrl 416) ctrlEnable true; + }; +}; + +[true] call FUNC(serverSettingsMenuUpdateList); diff --git a/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf b/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf new file mode 100644 index 0000000000..ca4a00891a --- /dev/null +++ b/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf @@ -0,0 +1,43 @@ +/* + * Author: Glowbal + * Called when the listbox selection is changed for an options (eg: chaning a setting from false to true) + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ACE_optionsmenu_fnc_onListBoxSettingsChanged + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_settingIndex", "_inputText"]; + +_settingIndex = lbCurSel 200; //Index of left list +_inputText = ctrlText 414; //Index of right drop down + +switch (GVAR(optionMenu_openTab)) do { + case (MENU_TAB_SERVER_VALUES): { + if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(serverSideValues)))) then { + try { + _setting = (GVAR(serverSideValues) select _settingIndex); + _settingName = _setting select 0; + + _convertedValue = switch (toUpper (_setting select 1)) do { + case "STRING": {format ['"%1"', _inputText]}; + case "ARRAY": {format [call compile "[%1]", _inputText]}; + case "SCALAR": {parseNumber _inputText;}; + default {throw "Error"}; + }; + [MENU_TAB_SERVER_VALUES, _settingName, _convertedValue] call FUNC(updateSetting); + } catch { + }; + }; + [false] call FUNC(serverSettingsMenuUpdateList); + }; +}; diff --git a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf new file mode 100644 index 0000000000..7894d2ff1a --- /dev/null +++ b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf @@ -0,0 +1,66 @@ +/* + * Author: Glowbal + * Called from the onLoad of ACE_settingsMenu dialog. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [onLoadEvent] call ACE_optionsmenu_fnc_onSettingsMenuOpen + * + * Public: No + */ + +#include "script_component.hpp" + +if (GVAR(serverConfigGeneration) == 0 || isMultiplayer) exitwith {closeDialog 145246;}; + +// Filter only user setable setting +GVAR(serverSideOptions) = []; +GVAR(serverSideColors) = []; +GVAR(serverSideValues) = []; +{ + _name = _x select 0; + _typeName = _x select 1; + _isClientSetable = _x select 2; + _localizedName = _x select 3; + _localizedDescription = _x select 4; + _possibleValues = _x select 5; + _defaultValue = _x select 6; + + // Exclude client side options if they are not included for the export + if (!(_isClientSetable) || GVAR(ClientSettingsExportIncluded)) then { + // Append the current value to the setting metadata + _setting = + _x; + _setting pushBack (missionNamespace getVariable (_x select 0)); + + // Categorize the setting according to types + // @todo: allow the user to modify other types of parameters? + if ((_typeName == "SCALAR" && count _possibleValues > 0) || (_x select 1) == "BOOL") then { + GVAR(serverSideOptions) pushBack _setting; + }; + if (_typeName == "COLOR") then { + GVAR(serverSideColors) pushBack _setting; + }; + if ((_typeName == "SCALAR" && count _possibleValues == 0) || _typeName == "ARRAY" || _typeName == "STRING") then { + GVAR(serverSideValues) pushBack _setting; + }; + }; +} forEach EGVAR(common,settings); + +//Delay a frame +[{ [MENU_TAB_SERVER_OPTIONS] call FUNC(onServerListBoxShowSelectionChanged) }, []] call EFUNC(common,execNextFrame); + +private "_menu"; +disableSerialization; +_menu = uiNamespace getvariable "ACE_serverSettingsMenu"; +(_menu displayCtrl 1003) ctrlEnable false; + +if (GVAR(ClientSettingsExportIncluded)) then { + (_settingsMenu displayCtrl 1102) ctrlSetText localize ("STR_ACE_OptionsMenu_exClientSettings"); +} else { + (_settingsMenu displayCtrl 1102) ctrlSetText localize ("STR_ACE_OptionsMenu_inClientSettings"); +}; diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf index 7c5f03af0b..3a4c6ec561 100644 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -45,3 +45,8 @@ disableSerialization; _menu = uiNamespace getvariable "ACE_settingsMenu"; (_menu displayCtrl 1002) ctrlEnable false; (_menu displayCtrl 1003) ctrlEnable false; + +if (GVAR(serverConfigGeneration) == 0) then { + (_menu displayCtrl 1102) ctrlEnable false; + (_menu displayCtrl 1102) ctrlShow false; +}; diff --git a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf index 4e0e603862..b69d8bd734 100644 --- a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf @@ -34,5 +34,18 @@ switch (GVAR(optionMenu_openTab)) do { }; [false] call FUNC(settingsMenuUpdateList); }; + case (MENU_TAB_SERVER_COLORS): { + + _newColor = []; + { + _newColor pushBack ((sliderPosition _x) / 255); + } forEach [410, 411, 412, 413]; + + if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then { + _settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0; + [MENU_TAB_SERVER_COLORS, _settingIndex, _newColor] call FUNC(updateSetting); + }; + [false] call FUNC(serverSettingsMenuUpdateList); + }; default {}; }; diff --git a/addons/optionsmenu/functions/fnc_serverResetSettings.sqf b/addons/optionsmenu/functions/fnc_serverResetSettings.sqf new file mode 100644 index 0000000000..434e622818 --- /dev/null +++ b/addons/optionsmenu/functions/fnc_serverResetSettings.sqf @@ -0,0 +1,43 @@ +/* + * Author: Glowbal + * Resets all server settings to default. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ACE_optionsmenu_fnc_onListBoxSettingsChanged + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_name", "_default", "_lastSelected"]; + +{ + _name = _x select 0; + _default = _x select 7; + [MENU_TAB_SERVER_OPTIONS, _name, _default] call FUNC(updateSetting); +} forEach GVAR(serverSideOptions); + +{ + _name = _x select 0; + _default = _x select 7; + [MENU_TAB_SERVER_COLORS, _name, _default] call FUNC(updateSetting); +} forEach GVAR(serverSideColors); + +{ + _name = _x select 0; + _default = _x select 7; + [MENU_TAB_SERVER_VALUES, _name, _default] call FUNC(updateSetting); +} forEach GVAR(serverSideVakyes); + +_lastSelected = lbCurSel 200; +[GVAR(optionMenu_openTab)] call FUNC(onserverListBoxShowSelectionChanged); +if (_lastSelected != -1) then { + lbSetCurSel [200, _lastSelected]; +}; diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf new file mode 100644 index 0000000000..2dcf9f7fe7 --- /dev/null +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf @@ -0,0 +1,94 @@ +/* + * Author: Glowbal + * Updates the right half of the option menu for the currently selected option. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ACE_optionsmenu_fnc_settingsMenuUpdateKeyView + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor"]; +disableSerialization; + +_settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; +_ctrlList = _settingsMenu displayCtrl 200; + +_collection = switch (GVAR(optionMenu_openTab)) do { + case MENU_TAB_SERVER_OPTIONS: {GVAR(serverSideOptions)}; + case MENU_TAB_SERVER_COLORS: {GVAR(serverSideColors)}; + case MENU_TAB_SERVER_VALUES: {GVAR(serverSideValues)}; + default {[]}; +}; + +if (count _collection > 0) then { + _settingIndex = (lbCurSel _ctrlList); + if (_settingIndex > (count _collection)) then { + _settingIndex = count _collection - 1; + }; + + if (_settingIndex < 0) then { + _settingIndex = 0; + }; + _setting = _collection select _settingIndex; + + _entryName = _setting select 0; + _localizedName = _setting select 3; + _localizedDescription = _setting select 4; + + if (_localizedName == "") then {_localizedName = _entryName;}; + (_settingsMenu displayCtrl 250) ctrlSetText _localizedName; + (_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription; + (_settingsMenu displayCtrl 300) ctrlSetText _entryName; + + switch (GVAR(optionMenu_openTab)) do { + case (MENU_TAB_SERVER_OPTIONS): { + _possibleValues = _setting select 5; + _settingsValue = _setting select 8; + // Created disable/enable options for bools + if ((_setting select 1) == "BOOL") then { + lbClear 400; + lbAdd [400, (localize "STR_ACE_OptionsMenu_Disabled")]; + lbAdd [400, (localize "STR_ACE_OptionsMenu_Enabled")]; + _settingsValue = [0, 1] select _settingsValue; + } else { + lbClear 400; + { lbAdd [400, _x]; } foreach _possibleValues; + }; + (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; + }; + case (MENU_TAB_SERVER_COLORS): { + _currentColor = _setting select 8; + { + sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))]; + } forEach [410, 411, 412, 413]; + }; + case (MENU_TAB_SERVER_VALUES): { + // TODO implement + _settingsValue = _setting select 8; + + // Created disable/enable options for bools + _expectedType = switch (_setting select 1) do { + case "STRING": {"STR_ACE_OptionsMenu_stringType"}; + case "ARRAY": {"STR_ACE_OptionsMenu_arrayType"}; + case "SCALAR": {"STR_ACE_OptionsMenu_scalarType"}; + default {"STR_ACE_optionsMenu_unknownType"}; + }; + (_settingsMenu displayCtrl 414) ctrlSetText format["%1", _settingsValue]; + (_settingsMenu displayCtrl 415) ctrlSetText format[localize _expectedType]; + }; + }; +} else { //no settings in list: + lbClear 400; + (_settingsMenu displayCtrl 250) ctrlSetText "No settings available"; + (_settingsMenu displayCtrl 251) ctrlSetText "No settings available"; + (_settingsMenu displayCtrl 300) ctrlSetText "No settings available"; +}; diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf new file mode 100644 index 0000000000..ad5d647c16 --- /dev/null +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf @@ -0,0 +1,81 @@ +/* + * Author: Glowbal + * Updates the setting when the client has selected a new value. Saves to profilenamespace. + * + * Arguments: + * 0: Update the keylist as well + * + * Return Value: + * None + * + * Example: + * [false] call ACE_optionsmenu_fnc_settingsMenuUpdateList + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView"]; +DEFAULT_PARAM(0,_updateKeyView,true); + +disableSerialization; +_settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; +_ctrlList = _settingsMenu displayCtrl 200; + +lbclear _ctrlList; +switch (GVAR(optionMenu_openTab)) do { + case (MENU_TAB_SERVER_OPTIONS): { + { + if ((_x select 3) != "") then { + _ctrlList lbadd (_x select 3); + } else { + _ctrlList lbadd (_x select 0); + }; + + _settingsValue = _x select 8; + + // Created disable/enable options for bools + _settingsText = if ((_x select 1) == "BOOL") then { + [(localize "STR_ACE_OptionsMenu_Disabled"), (localize "STR_ACE_OptionsMenu_Enabled")] select _settingsValue; + } else { + (_x select 5) select _settingsValue; + }; + + _ctrlList lbadd (_settingsText); + }foreach GVAR(serverSideOptions); + }; + case (MENU_TAB_SERVER_COLORS): { + { + _color = +(_x select 8); + { + _color set [_forEachIndex, ((round (_x * 100))/100)]; + } forEach _color; + _settingsColor = str _color; + if ((_x select 3) != "") then { + _ctrlList lbadd (_x select 3); + } else { + _ctrlList lbadd (_x select 0); + }; + _ctrlList lbadd (_settingsColor); + _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 8)]; + }foreach GVAR(serverSideColors); + }; + case (MENU_TAB_SERVER_VALUES): { + { + if ((_x select 3) != "") then { + _ctrlList lbadd (_x select 3); + } else { + _ctrlList lbadd (_x select 0); + }; + _settingsValue = _x select 8; + if (typeName _settingsValue != "STRINg") then { + _settingsValue = format["%1", _settingsValue]; + }; + _ctrlList lbadd (_settingsValue); + }foreach GVAR(serverSideValues); + }; +}; +if (_updateKeyView) then { + [] call FUNC(serverSettingsMenuUpdateKeyView); +}; diff --git a/addons/optionsmenu/functions/fnc_toggleIncludeClientSettings.sqf b/addons/optionsmenu/functions/fnc_toggleIncludeClientSettings.sqf new file mode 100644 index 0000000000..8fd52d8d72 --- /dev/null +++ b/addons/optionsmenu/functions/fnc_toggleIncludeClientSettings.sqf @@ -0,0 +1,18 @@ +/* + * Author: Glowbal + * + * + * Arguments: + * none + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +GVAR(ClientSettingsExportIncluded) = !(GVAR(ClientSettingsExportIncluded)); + +[] call FUNC(onServerSettingsMenuOpen); diff --git a/addons/optionsmenu/functions/fnc_updateSetting.sqf b/addons/optionsmenu/functions/fnc_updateSetting.sqf index bc5969d54c..3fe1682614 100644 --- a/addons/optionsmenu/functions/fnc_updateSetting.sqf +++ b/addons/optionsmenu/functions/fnc_updateSetting.sqf @@ -24,33 +24,71 @@ PARAMS_3(_type,_name,_newValue); _changed = false; switch (_type) do { -case (MENU_TAB_OPTIONS): { - { - if ((_x select 0) == _name) then { + case (MENU_TAB_OPTIONS): { + { + if ((_x select 0) == _name) then { + + if ((_x select 1) == "BOOL") then { + _newValue = [false, true] select _newValue; + }; + + if !((_x select 8) isEqualTo _newValue) then { + _changed = true; + _x set [8, _newValue]; + } ; - if ((_x select 1) == "BOOL") then { - _newValue = [false, true] select _newValue; }; - - if !((_x select 8) isEqualTo _newValue) then { + } foreach GVAR(clientSideOptions); + }; + case (MENU_TAB_COLORS): { + { + if (((_x select 0) == _name) && {!((_x select 8) isEqualTo _newValue)}) then { _changed = true; _x set [8, _newValue]; - } ; - - }; - } foreach GVAR(clientSideOptions); + }; + } foreach GVAR(clientSideColors); }; -case (MENU_TAB_COLORS): { - { - if (((_x select 0) == _name) && {!((_x select 8) isEqualTo _newValue)}) then { - _changed = true; - _x set [8, _newValue]; - }; - } foreach GVAR(clientSideColors); + case (MENU_TAB_SERVER_OPTIONS): { + { + if ((_x select 0) == _name) then { + + if ((_x select 1) == "BOOL") then { + _newValue = [false, true] select _newValue; + }; + + if !((_x select 8) isEqualTo _newValue) then { + _changed = true; + _x set [8, _newValue]; + } ; + + }; + } foreach GVAR(serverSideOptions); + }; + case (MENU_TAB_SERVER_COLORS): { + { + if (((_x select 0) == _name) && {!((_x select 8) isEqualTo _newValue)}) then { + _changed = true; + _x set [8, _newValue]; + }; + } foreach GVAR(serverSideColors); + }; + case (MENU_TAB_SERVER_VALUES): { + { + if (((_x select 0) == _name) && {!((_x select 8) isEqualTo _newValue)}) then { + _changed = true; + _x set [8, _newValue]; + }; + } foreach GVAR(serverSideValues); }; }; if (_changed) then { - profileNamespace setVariable [_name, _newValue]; - [_name, _newValue] call EFUNC(common,setSetting); + if (GVAR(serverConfigGeneration) > 0) then { + if !(isMultiplayer) then { + missionNamespace setvariable [_name, _newValue]; + }; + } else { + profileNamespace setVariable [_name, _newValue]; + [_name, _newValue] call EFUNC(common,setSetting); + }; }; diff --git a/addons/optionsmenu/gui/settingsMenu.hpp b/addons/optionsmenu/gui/settingsMenu.hpp index 995c7850a5..93d35b284c 100644 --- a/addons/optionsmenu/gui/settingsMenu.hpp +++ b/addons/optionsmenu/gui/settingsMenu.hpp @@ -228,5 +228,211 @@ class ACE_settingsMenu { x = 26.1 * (SIZEX / 40) + OFFSETX; action = QUOTE([] call FUNC(resetSettings)); }; + class action_exportServerConfig: actionClose { + idc = 1102; + text = "$STR_ACE_OptionsMenu_OpenExport"; + x = 1 * (SIZEX / 40) + OFFSETX; + action = QUOTE(if (GVAR(serverConfigGeneration) > 0) then {createDialog 'ACE_serverSettingsMenu'; }); + }; }; -}; \ No newline at end of file +}; +class ACE_serverSettingsMenu: ACE_settingsMenu { + onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_serverSettingsMenu', _this select 0)]; [] call FUNC(onServerSettingsMenuOpen);); + onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_serverSettingsMenu', nil)];); + class controls: controls { + class HeaderName { + idc = 1; + type = CT_STATIC; + x = 1 * UNITX + OFFSETX; + y = 1 * UNITY + OFFSETY; + w = 38 * UNITX; + h = 1 * UNITY; + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = (UNITY * 1); + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {0,0,0,0}; + text = "$STR_ACE_OptionsMenu_OpenConfigMenu"; + }; + class labelSubHeader: ACE_gui_staticBase { + idc = 13; + x = 2 * UNITX + OFFSETX; + y = 3.4 * UNITY + OFFSETY; + w = 30 * UNITX; + h = 1 * UNITY; + text = ""; + }; + class selectionAction_1: ACE_gui_buttonBase { + idc = 1000; + text = "$STR_ACE_OptionsMenu_TabOptions"; + x = 1 * UNITX + OFFSETX; + y = 2.1 * UNITY + OFFSETY; + w = 9.5 * UNITX; + h = 1 * UNITY; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1, 1, 1, 1}; + color2[] = {0,0,0, 1}; + colorBackgroundFocused[] = {1,1,1,1}; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {1,1,1,1}; + colorFocused[] = {0,0,0,1}; + periodFocus = 1; + periodOver = 1; + action = QUOTE([MENU_TAB_SERVER_OPTIONS] call FUNC(onServerListBoxShowSelectionChanged);); + }; + class selectionAction_2: selectionAction_1 { + idc = 1001; + text = "$STR_ACE_OptionsMenu_TabColors"; + x = 10.5 * UNITX + OFFSETX; + action = QUOTE([MENU_TAB_SERVER_COLORS] call FUNC(onServerListBoxShowSelectionChanged);); + }; + class selectionAction_3: selectionAction_1 { + idc = 1002; + text = "$STR_ACE_OptionsMenu_TabValues"; + x = 20 * UNITX + OFFSETX; + action = QUOTE([MENU_TAB_SERVER_VALUES] call FUNC(onServerListBoxShowSelectionChanged);); + }; + class selectionAction_4: selectionAction_1 { + idc = 1003; + text = ""; + x = 29.5 * UNITX + OFFSETX; + action = ""; + }; + class listBoxSettingsList: ACE_gui_listNBox { + idc = 200; + x = 2 * UNITX + OFFSETX; + y = 5.5 * UNITY + OFFSETY; + w = 23 * UNITX; + h = 15 * UNITY; + SizeEx = (UNITY * 0.8); + colorBackground[] = {0, 0, 0, 0.9}; + colorSelectBackground[] = {0, 0, 0, 0.9}; + columns[] = {0.0, 0.6}; + onLBSelChanged = QUOTE(_this call FUNC(serverSettingsMenuUpdateKeyView)); + }; + class labelTitle: ACE_gui_staticBase { + idc = 250; + x = 27.1 * UNITX + OFFSETX; + y = 5.1 * UNITY + OFFSETY; + w = 11 * UNITX; + h = 1 * UNITY; + text = ""; + SizeEx = (UNITY *1); + }; + class labelKey: ACE_gui_staticBase { //Variable Name + idc = 300; + x = 27.1 * UNITX + OFFSETX; + y = 6.2 * UNITY + OFFSETY; + w = 11 * UNITX; + h = 1 * UNITY; + text = ""; + SizeEx = (UNITY * 0.65); + }; + class Label2: labelKey { + idc = 301; + y = 7.3 * UNITY + OFFSETY; + text = "$STR_ACE_OptionsMenu_Setting"; + SizeEx = (UNITY * 1); + }; + class comboBox1: ACE_gui_comboBoxBase { + idc = 400; + x = 31.1 * UNITX + OFFSETX; + y = 7.3 * UNITY + OFFSETY; + w = 7 * UNITX; + h = 1 * UNITY; + onLBSelChanged = QUOTE( call FUNC(onListBoxSettingsChanged)); + SizeEx = (UNITY * 0.9); + }; + class sliderBar1: RscXSliderH { + idc = 410; + x = 27.1 * UNITX + OFFSETX; + y = 7.3 * UNITY + OFFSETY; + w = 11 * UNITX; + h = 0.75 * UNITY; + onSliderPosChanged = QUOTE(_this call FUNC(onSliderPosChanged)); + color[] = {1,0,0,0.4}; + colorActive[] = {1,0,0,1}; + }; + class sliderBar2: sliderBar1 { + idc = 411; + y = 8.2 * UNITY + OFFSETY; + color[] = {0,1,0,0.4}; + colorActive[] = {0,1,0,1}; + }; + class sliderBar3: sliderBar1 { + idc = 412; + y = 9.1 * UNITY + OFFSETY; + color[] = {0,0,1,0.4}; + colorActive[] = {0,0,1,1}; + }; + class sliderBar4: sliderBar1 { + idc = 413; + y = 10 * UNITY + OFFSETY; + color[] = {1,1,1,0.4}; + colorActive[] = {1,1,1,1}; + }; + class inputField1: ACE_gui_editBase { + idc = 414; + x = 27.1 * UNITX + OFFSETX; + y = 7.3 * UNITY + OFFSETY; + w = 11 * UNITX; + h = 0.75 * UNITY; + }; + class inputFieldTypeLabel: ACE_gui_staticBase { + idc = 415; + x = 27.1 * UNITX + OFFSETX; + y = 8.2 * UNITY + OFFSETY; + w = 11 * UNITX; + h = 0.75 * UNITY; + text = ""; + style = ST_LEFT + ST_MULTI; + lineSpacing = 1; + SizeEx = (UNITY * 0.8); + }; + class saveInputButton: selectionAction_1 { + idc = 416; + text = "$STR_ACE_OptionsMenu_SaveInput"; + x = 27.1 * UNITX + OFFSETX; + y = 9.1 * UNITY + OFFSETY; + w = 11 * UNITX; + h = 1 * UNITY; + action = QUOTE([] call FUNC(onServerSaveInputField);); + }; + class labelDesc: ACE_gui_staticBase { + idc = 251; + x = 27.1 * UNITX + OFFSETX; + y = 11 * UNITY + OFFSETY; + w = 11 * UNITX; + h = 11 * UNITY; + text = ""; + style = ST_LEFT + ST_MULTI; + lineSpacing = 1; + SizeEx = (UNITY * 0.8); + }; + class actionClose; + class action_reset: actionClose { + idc = 1100; + text = "$STR_ACE_OptionsMenu_ResetAll"; + x = 26.1 * (SIZEX / 40) + OFFSETX; + action = QUOTE([] call FUNC(serverResetSettings)); + }; + class action_exportServerConfig: actionClose { + idc = 1101; + text = "$STR_ACE_OptionsMenu_Export"; + x = 1 * (SIZEX / 40) + OFFSETX; + action = QUOTE([] call FUNC(exportSettings)); + }; + class action_toggleIncludeClientSettings: actionClose { + idc = 1102; + text = "$STR_ACE_OptionsMenu_inClientSettings"; + x = 9 * (SIZEX / 40) + OFFSETX; + action = QUOTE([] call FUNC(toggleIncludeClientSettings)); + }; + }; +}; diff --git a/addons/optionsmenu/script_component.hpp b/addons/optionsmenu/script_component.hpp index 5120791b76..7b86dbe0dd 100644 --- a/addons/optionsmenu/script_component.hpp +++ b/addons/optionsmenu/script_component.hpp @@ -17,3 +17,6 @@ #define MENU_TAB_OPTIONS 0 #define MENU_TAB_COLORS 1 +#define MENU_TAB_SERVER_OPTIONS 10 +#define MENU_TAB_SERVER_COLORS 11 +#define MENU_TAB_SERVER_VALUES 12 diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index bb5744ab16..76407da435 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -39,6 +39,9 @@ Opciók Opzioni + + Values + Yes Ja @@ -70,5 +73,35 @@ Yстановки: Ajuste: + + Export + + + Open Export Menu + + + String input. + + + Array. Seperate elements by using ,. + + + Number + + + Uknown input type + + + Save input + + + Include Client Settings + + + Exclude Client Settings + + + Settings exported to clipboard + \ No newline at end of file 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/functions/fnc_getIntersection.sqf b/addons/resting/functions/fnc_getIntersection.sqf index 395b83f0a4..0527a7c514 100644 --- a/addons/resting/functions/fnc_getIntersection.sqf +++ b/addons/resting/functions/fnc_getIntersection.sqf @@ -18,7 +18,7 @@ EXPLODE_3_PVT(_this,_unit,_vehicle,_weapon); private ["_weaponPos", "_weaponDir", "_weaponPosDown"]; -_weaponPos = ATLtoASL (_unit modelToWorld (_unit selectionPosition "RightHand")); +_weaponPos = ATLtoASL (_unit modelToWorldVisual (_unit selectionPosition "RightHand")); _weaponDir = _unit weaponDirection _weapon; _weaponPosDown = _weaponPos vectorAdd [0,0,-MAXHEIGHT]; 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/functions/fnc_playChangeFiremodeSound.sqf b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf index c0b58604b9..6c2c797706 100644 --- a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf @@ -26,7 +26,7 @@ if (count _sound < 3) then {_sound pushBack 1}; if (count _sound < 4) then {_sound pushBack 0}; private "_position"; -_position = _unit modelToWorld (_unit selectionPosition "RightHand"); +_position = _unit modelToWorldVisual (_unit selectionPosition "RightHand"); _position set [2, (_position select 2) + ((getPosASLW _unit select 2) - (getPosATL _unit select 2) max 0)]; playSound3D [_sound select 0, objNull, false, _position, _sound select 1, _sound select 2, _sound select 3]; 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/weaponselect/functions/fnc_playChangeFiremodeSound.sqf b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf index 82901a1b52..ea671a530d 100644 --- a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf @@ -27,7 +27,7 @@ if (count _sound < 4) then {_sound pushBack 0}; private "_position"; -_position = _unit modelToWorld (_unit selectionPosition "RightHand"); +_position = _unit modelToWorldVisual (_unit selectionPosition "RightHand"); _position set [2, (_position select 2) + ((getPosASLW _unit select 2) - (getPosATL _unit select 2) max 0)]; playSound3D [_sound select 0, objNull, false, _position, _sound select 1, _sound select 2, _sound select 3]; 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/CfgEventhandlers.hpp b/addons/wep_javelin/CfgEventhandlers.hpp index 70e16353cd..a61ea9c746 100644 --- a/addons/wep_javelin/CfgEventhandlers.hpp +++ b/addons/wep_javelin/CfgEventhandlers.hpp @@ -1,17 +1,18 @@ 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)); + clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit)); + }; }; class Extended_FiredBIS_EventHandlers { - class CAManBase { - ADDON = QUOTE(_this call FUNC(fired)); - }; + class CAManBase { + ADDON = QUOTE(_this call FUNC(fired)); + }; }; \ No newline at end of file diff --git a/addons/wep_javelin/CfgOptics.hpp b/addons/wep_javelin/CfgOptics.hpp deleted file mode 100644 index 53f36710fb..0000000000 --- a/addons/wep_javelin/CfgOptics.hpp +++ /dev/null @@ -1,50 +0,0 @@ -class RscControlsGroup; -class RscPicture; -class RscMapControl; - -// Taken from AGM for optics management. - -class RscInGameUI { - class RscOptics_titan { - - class CA_javelin_elements_group: RscControlsGroup { - class Controls { - class CA_Javelin_Day_mode_off: RscPicture {}; - class CA_Javelin_SEEK_off: CA_Javelin_Day_mode_off { - idc = 1005; - }; - // From AGM - class GetLockedTarget: RscMapControl { - onDraw = QUOTE(_this call FUNC(onGetLockedTarget)); - idc = -1; - w = 0; - h = 0; - }; - }; - }; - }; -}; - -// on colorText[] = {0.2941, 0.8745, 0.2157, 1.0}; -// off colorText[] = {0.2941, 0.2941, 0.2941, 1.0}; -// orange colorText[] = {0.9255, 0.5216, 0.1216, 1.0}; - -/* -CA_javelin_elements_group: 170 -CA_Javelin_Day_mode_off: 1001 -CA_Javelin_Day_mode: 160 -CA_Javelin_WFOV_mode_off: 1004 -CA_Javelin_WFOV_mode_group: 163 -CA_Javelin_NFOV_mode_off: 1003 -CA_Javelin_NFOV_mode_group: 162 -CA_Javelin_SEEK_off: 1005 //1001 -CA_Javelin_SEEK: 166 -CA_Javelin_Missle_off: 1032 -CA_Javelin_Missle: 167 -CA_Javelin_CLU_off: 1027 -CA_Javelin_HangFire_off: 1028 -CA_Javelin_TOP_off: 1006 -CA_Javelin_DIR: 1007 -CA_Javelin_FLTR_mode_off: 1002 -CA_Javelin_FLTR_mode: 161 -*/ \ No newline at end of file diff --git a/addons/wep_javelin/CfgSounds.hpp b/addons/wep_javelin/CfgSounds.hpp new file mode 100644 index 0000000000..a5002409ff --- /dev/null +++ b/addons/wep_javelin/CfgSounds.hpp @@ -0,0 +1,13 @@ + +class CfgSounds { + class ACE_Javelin_Locking { + 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[] = {}; + }; +}; diff --git a/addons/wep_javelin/README.md b/addons/wep_javelin/README.md index 18bd8c6b3f..df3ad9b29d 100644 --- a/addons/wep_javelin/README.md +++ b/addons/wep_javelin/README.md @@ -8,5 +8,5 @@ Adds the Javelin AT launcher. The people responsible for merging changes to this component or answering potential questions. -- [walterpearce](https://github.com/walterpearce) +- [jaynus](https://github.com/walterpearce) - [NouberNou](https://github.com/NouberNou) diff --git a/addons/wep_javelin/RscInGameUI.hpp b/addons/wep_javelin/RscInGameUI.hpp new file mode 100644 index 0000000000..811548a9d2 --- /dev/null +++ b/addons/wep_javelin/RscInGameUI.hpp @@ -0,0 +1,459 @@ +class RscOpticsValue; +class RscControlsGroup; +class RscPicture; +class RscMapControl; +class VScrollbar; +class HScrollbar; +class RscLine; + + +// Taken from AGM for optics management. + +class RscInGameUI { + class RscOptics_titan { + idd = 300; + controls[] = {"ACE_javelin_elements_group"}; + onLoad = QUOTE(_this call FUNC(onOpticLoad)); + 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; + }; + + 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 { + class JavelinLocking : RscMapControl { + onDraw = QUOTE(_this call FUNC(onOpticDraw)); + idc = -1; + w = 0; + 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 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 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}; + }; + }; + }; + }; +}; + +// on colorText[] = {0.2941, 0.8745, 0.2157, 1.0}; +// off colorText[] = {0.2941, 0.2941, 0.2941, 1.0}; +// orange colorText[] = {0.9255, 0.5216, 0.1216, 1.0}; + +/* +ACE_Titan_elements_group: 170 +ACE_Titan_Day_mode_off: 1001 +ACE_Titan_Day_mode: 160 +ACE_Titan_WFOV_mode_off: 1004 +ACE_Titan_WFOV_mode_group: 163 +ACE_Titan_NFOV_mode_off: 1003 +ACE_Titan_NFOV_mode_group: 162 +ACE_Titan_SEEK_off: 1005 //1001 +ACE_Titan_SEEK: 166 +ACE_Titan_Missle_off: 1032 +ACE_Titan_Missle: 167 +ACE_Titan_CLU_off: 1027 +ACE_Titan_HangFire_off: 1028 +ACE_Titan_TOP_off: 1006 +ACE_Titan_DIR: 1007 +ACE_Titan_FLTR_mode_off: 1002 +ACE_Titan_FLTR_mode: 161 +*/ \ No newline at end of file diff --git a/addons/wep_javelin/XEH_clientInit.sqf b/addons/wep_javelin/XEH_clientInit.sqf new file mode 100644 index 0000000000..1d3b546e39 --- /dev/null +++ b/addons/wep_javelin/XEH_clientInit.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +#include "initKeybinds.sqf" \ No newline at end of file diff --git a/addons/wep_javelin/XEH_post_init.sqf b/addons/wep_javelin/XEH_post_init.sqf index 6904ee6c47..dc30361926 100644 --- a/addons/wep_javelin/XEH_post_init.sqf +++ b/addons/wep_javelin/XEH_post_init.sqf @@ -1,3 +1,2 @@ #include "script_component.hpp" -NO_DEDICATED; diff --git a/addons/wep_javelin/XEH_pre_init.sqf b/addons/wep_javelin/XEH_pre_init.sqf index f826c6cf93..1b6682f0fc 100644 --- a/addons/wep_javelin/XEH_pre_init.sqf +++ b/addons/wep_javelin/XEH_pre_init.sqf @@ -1,7 +1,15 @@ #include "script_component.hpp" PREP(fired); -PREP(onGetLockedTarget); PREP(translateToWeaponSpace); -PREP(translateToModelSpace); \ No newline at end of file +PREP(translateToModelSpace); + +PREP(lockKeyDown); +PREP(lockKeyUp); +PREP(cycleFireMode); + +PREP(onOpticLoad); +PREP(onOpticDraw); + +GVAR(isLockKeyDown) = false; \ No newline at end of file diff --git a/addons/wep_javelin/config.cpp b/addons/wep_javelin/config.cpp index 0c8fae6154..3cc607f0bd 100644 --- a/addons/wep_javelin/config.cpp +++ b/addons/wep_javelin/config.cpp @@ -1,14 +1,15 @@ #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" -#include "CfgOptics.hpp" \ No newline at end of file +#include "RscInGameUI.hpp" +#include "CfgSounds.hpp" \ No newline at end of file diff --git a/addons/wep_javelin/data/jav_disp.paa b/addons/wep_javelin/data/jav_disp.paa new file mode 100644 index 0000000000..fc60af24d5 Binary files /dev/null and b/addons/wep_javelin/data/jav_disp.paa differ diff --git a/addons/wep_javelin/data/jav_ring.paa b/addons/wep_javelin/data/jav_ring.paa new file mode 100644 index 0000000000..04d23c3910 Binary files /dev/null and b/addons/wep_javelin/data/jav_ring.paa differ diff --git a/addons/wep_javelin/data/javelin_ui_border_ca.paa b/addons/wep_javelin/data/javelin_ui_border_ca.paa new file mode 100644 index 0000000000..29e9ad6f4b Binary files /dev/null and b/addons/wep_javelin/data/javelin_ui_border_ca.paa differ diff --git a/addons/wep_javelin/data/sounds/javelin_locked.ogg b/addons/wep_javelin/data/sounds/javelin_locked.ogg new file mode 100644 index 0000000000..5002405b1a Binary files /dev/null and b/addons/wep_javelin/data/sounds/javelin_locked.ogg differ diff --git a/addons/wep_javelin/data/sounds/javelin_locking.ogg b/addons/wep_javelin/data/sounds/javelin_locking.ogg new file mode 100644 index 0000000000..dca0ca73b2 Binary files /dev/null and b/addons/wep_javelin/data/sounds/javelin_locking.ogg differ diff --git a/addons/wep_javelin/functions/fnc_cycleFireMode.sqf b/addons/wep_javelin/functions/fnc_cycleFireMode.sqf new file mode 100644 index 0000000000..7902c6d265 --- /dev/null +++ b/addons/wep_javelin/functions/fnc_cycleFireMode.sqf @@ -0,0 +1,19 @@ +#define DEBUG_MODE_FULL +#include "script_component.hpp" +TRACE_1("enter", _this); + +private["_player", "_currentFireMode"]; + +_currentFireMode = ACE_player getVariable["ACE_FIRE_SELECTION", ACE_JAV_FIREMODE_TOP]; +if(_currentFireMode == ACE_JAV_FIREMODE_DIR) then { + _currentFireMode = ACE_JAV_FIREMODE_TOP; + + __JavelinIGUITop ctrlSetTextColor __ColorGreen; + __JavelinIGUIDir ctrlSetTextColor __ColorGray; +} else { + _currentFireMode = ACE_JAV_FIREMODE_DIR; + + __JavelinIGUITop ctrlSetTextColor __ColorGray; + __JavelinIGUIDir ctrlSetTextColor __ColorGreen; +}; +ACE_player setVariable["ACE_FIRE_SELECTION", _currentFireMode, false]; diff --git a/addons/wep_javelin/functions/fnc_fired.sqf b/addons/wep_javelin/functions/fnc_fired.sqf index d576975c96..139f8f4b7e 100644 --- a/addons/wep_javelin/functions/fnc_fired.sqf +++ b/addons/wep_javelin/functions/fnc_fired.sqf @@ -1,151 +1,285 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" //_this=[TEST_AI_HELICOPTER,"missiles_DAGR","missiles_DAGR","Far_AI","M_PG_AT","24Rnd_PG_missiles",163988: rocket_01_fly_f.p3d] -TRACE_1("enter", _this); +TRACE_1("Launch", _this); PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -FUNC(guidance_Javelin_LOBL_HI_PFH) = { - TRACE_1("enter", _this); - private["_pitch", "_yaw", "_wentTerminal", "_target", "_targetPos", "_curVelocity", "_missile" ]; - _args = _this select 0; - //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - _shooter = _args select 0; - _missile = _args select 6; - - if((count _this) > 2) then { - _wentTerminal = _this select 2; - } else { - _this set[2, false]; - _wentTerminal = false; - }; - - if((count _this) > 3) then { - _targets = _this select 3; - _target = _targets select 0; - _targetPos = _targets select 1; - } else { - _this set[3, [GVAR(currentTarget),GVAR(currentTargetPos)] ]; - _target = GVAR(currentTarget); - _targetPos = GVAR(currentTargetPos); - }; - - _curVelocity = velocity _missile; - - if(!alive _missile || isNull _missile) exitWith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; - - - _launchPos = _shooter getVariable [QGVAR(launchPos), nil]; - if(isNil "_launchPos") then { - TRACE_1("Setting launch parameters", ""); - _launchPos = getPosASL _shooter; - _shooter setVariable [QGVAR(launchPos), _launchPos, false]; - _shooter setVariable [QGVAR(launchTime), diag_tickTime, false]; - }; - - _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!"; +FUNC(guidance_Javelin_LOBL_DIR_PFH) = { + 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; + _launchPos = _saveArgs select 2; + _wentTerminal = _saveArgs select 3; + } 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; + }; + + _targetPos = getPosASL _target; + _curVelocity = velocity _missile; + + TRACE_4("", _target, _targetPos, _launchPos, _targetStartPos); - 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; - - _defPitch = 0.25; - - if( (_missilePos select 2) < (_targetPos select 2) + 160 && !_wentTerminal) then { - _addHeight = [0,0,(_targetPos select 2) + ( (_distanceToTarget * 2) + 160)]; - TRACE_1("Climb phase", _addHeight); - } else { - _wentTerminal = true; - _this set[2, _wentTerminal]; - TRACE_1("TERMINAL", ""); - }; - _targetPos = _targetPos vectorAdd _addHeight; - - _defYaw = 0.0035; - - _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); - _yaw = 0.0; - TRACE_5("", _missile, _xVec, _yVec, _zVec, _targetPos); - if((_targetVectorSeeker select 0) < 0) then { - _yaw = -_defYaw; - } else { - if((_targetVectorSeeker select 0) > 0) then { - _yaw = _defYaw; - }; - }; - - _pitch = 0.0; - if((_targetVectorSeeker select 2) < 0) then { - _pitch = -_defPitch; - } else { - if((_targetVectorSeeker select 2) > 0) then { - _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]]; - - _distance = ([getPos startPos, _missilePos] call BIS_fnc_distance2D); - _marker = createMarkerLocal [format["m%1", MARKERCOUNT], [_distance, _missilePos select 2]]; - _marker setMarkerTypeLocal "mil_dot"; - _marker setMarkerColorLocal "ColorRed"; + _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!"; - 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 - }; - }; + 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]; + + _defPitch = 0.15; + _defYaw = 0.035; + + TRACE_1("Climb phase", _addHeight); + } else { + _wentTerminal = true; + _this set[2, _wentTerminal]; + + _defPitch = 0.15; + _defYaw = 0.035; + + TRACE_1("TERMINAL", ""); + }; + _targetPos = _targetPos vectorAdd _addHeight; + + _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); + TRACE_5("", _missile, _xVec, _yVec, _zVec, _targetPos); + + _yaw = 0.0; + _pitch = 0.0; + + if((_targetVectorSeeker select 0) < 0) then { + _yaw = -_defYaw; + } else { + if((_targetVectorSeeker select 0) > 0) then { + _yaw = _defYaw; + }; + }; + + if((_targetVectorSeeker select 2) < 0) then { + _pitch = -_defPitch; + } else { + if((_targetVectorSeeker select 2) > 0) then { + _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]]; + + 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 ]; + _this set[0, _args]; }; -FUNC(guidance_Javelin_LOBL_HI) = { - PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); - - GVAR(lastTime) = time; - [FUNC(guidance_Javelin_LOBL_HI_PFH), 0, _this] call cba_fnc_addPerFrameHandler; +FUNC(guidance_Javelin_LOBL_TOP_PFH) = { + 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; + _launchPos = _saveArgs select 2; + _wentTerminal = _saveArgs select 3; + } 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; + }; + + _targetPos = getPosASL _target; + _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!"; + + 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)]; + + _defPitch = 0.25; + _defYaw = 0.035; + + TRACE_1("Climb phase", _addHeight); + } else { + _wentTerminal = true; + _this set[2, _wentTerminal]; + + _defPitch = 0.25; + _defYaw = 0.25; + + TRACE_1("TERMINAL", ""); + }; + _targetPos = _targetPos vectorAdd _addHeight; + + _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); + TRACE_5("", _missile, _xVec, _yVec, _zVec, _targetPos); + + _yaw = 0.0; + _pitch = 0.0; + + // Stop jinking on terminal final decent + if((_missilePos distance _targetPos) < 150) then { + _defPitch = 0.0015; + _defYaw = 0.0015; + }; + + if((_targetVectorSeeker select 0) < 0) then { + _yaw = -_defYaw; + } else { + if((_targetVectorSeeker select 0) > 0) then { + _yaw = _defYaw; + }; + }; + + if((_targetVectorSeeker select 2) < 0) then { + _pitch = -_defPitch; + } else { + if((_targetVectorSeeker select 2) > 0) then { + _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]]; + + 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 ]; + _this set[0, _args]; +}; + +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; +}; + +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; }; if(!local _shooter) exitWith { false }; if(_ammo == "M_Titan_AT") then { - _fireMode = _shooter getVariable ["ACE_FIRE_SELECTION", ACE_DEFAULT_FIRE_SELECTION]; - - switch (_fireMode select 0) do { - // Default to FIREMODE_DIRECT_LOAL - // FIREMODE_DIRECT_LOAL - default { - LOG("Initiating Javelin FIREMODE_LOBL_HI"); - _this call FUNC(guidance_Javelin_LOBL_HI); - }; -}; + _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: { + LOG("Initiating Javelin FIREMODE_LOBL_DIR"); + _this call FUNC(guidance_Javelin_LOBL_DIR); + }; + default { + LOG("Initiating Javelin FIREMODE_LOBL_TOP"); + _this call FUNC(guidance_Javelin_LOBL_TOP); + }; + }; }; \ No newline at end of file diff --git a/addons/wep_javelin/functions/fnc_lockKeyDown.sqf b/addons/wep_javelin/functions/fnc_lockKeyDown.sqf new file mode 100644 index 0000000000..bc3198915b --- /dev/null +++ b/addons/wep_javelin/functions/fnc_lockKeyDown.sqf @@ -0,0 +1,3 @@ +#define DEBUG_MODE_FULL +#include "script_component.hpp" +TRACE_1("enter", _this); \ No newline at end of file diff --git a/addons/wep_javelin/functions/fnc_lockKeyUp.sqf b/addons/wep_javelin/functions/fnc_lockKeyUp.sqf new file mode 100644 index 0000000000..bc3198915b --- /dev/null +++ b/addons/wep_javelin/functions/fnc_lockKeyUp.sqf @@ -0,0 +1,3 @@ +#define DEBUG_MODE_FULL +#include "script_component.hpp" +TRACE_1("enter", _this); \ No newline at end of file diff --git a/addons/wep_javelin/functions/fnc_onGetLockedTarget.sqf b/addons/wep_javelin/functions/fnc_onGetLockedTarget.sqf deleted file mode 100644 index 3cc5d685c2..0000000000 --- a/addons/wep_javelin/functions/fnc_onGetLockedTarget.sqf +++ /dev/null @@ -1,8 +0,0 @@ -//#define DEBUG_MODE_FULL -#include "script_component.hpp" - -// Store the current cursor target for guidance -GVAR(currentTarget) = cursorTarget; -GVAR(currentTargetPos) = screenToWorld [0.5,0.5]; - -TRACE_2("Tracking optics target draw", GVAR(currentTarget), GVAR(currentTargetPos)); \ No newline at end of file diff --git a/addons/wep_javelin/functions/fnc_onOpticDraw.sqf b/addons/wep_javelin/functions/fnc_onOpticDraw.sqf new file mode 100644 index 0000000000..6a74b3ed57 --- /dev/null +++ b/addons/wep_javelin/functions/fnc_onOpticDraw.sqf @@ -0,0 +1,132 @@ +//#define DEBUG_MODE_FULL +#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 __ConstraintTop (((ctrlPosition __JavelinIGUITargetingConstrainTop) select 1) + ((ctrlPosition (__JavelinIGUITargetingConstrainTop)) select 3)) +#define __ConstraintBottom ((ctrlPosition __JavelinIGUITargetingConstrainBottom) select 1) +#define __ConstraintLeft (((ctrlPosition __JavelinIGUITargetingConstrainLeft) select 0) + ((ctrlPosition (__JavelinIGUITargetingConstrainLeft)) select 2)) +#define __ConstraintRight ((ctrlPosition __JavelinIGUITargetingConstrainRight) select 0) + +#define __OffsetX ((ctrlPosition __JavelinIGUITargetingLineV) select 0) - 0.5 +#define __OffsetY ((ctrlPosition __JavelinIGUITargetingLineH) select 1) - 0.5 + + +private["_args", "_lastTick", "_runTime", "_soundTime", "_lockTime", "_newTarget", "_currentTarget", "_range", "_pos", "_targetArray"]; + +// Reset arguments if we havnt rendered in over a second +_args = uiNamespace getVariable[QGVAR(arguments), [] ]; +if( (count _args) > 0) then { + _lastTick = _args select 0; + if(diag_tickTime - _lastTick > 1) then { + [] call FUNC(onOpticLoad); + }; +}; + +// Pull the arguments +_currentTarget = _args select 1; +_runTime = _args select 2; +_lockTime = _args select 3; +_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. + ACE_player switchCamera "INTERNAL"; +}; + +// Only start locking on holding tab +if(!GVAR(isLockKeyDown)) exitWith { false }; + +_range = parseNumber (ctrlText __JavelinIGUIRangefinder); +if (_range > 50 && {_range < 2500}) then { + _pos = positionCameraToWorld [0,0,_range]; + _targetArray = _pos nearEntities ["AllVehicles", _range/25]; + if (count (_targetArray) > 0) then { + _newTarget = _targetArray select 0; + }; +}; + +if (isNull _newTarget) then { + _newTarget = cursorTarget; +}; + +if (isNull _newTarget) then { + // No targets found + _currentTarget = objNull; + _lockTime = 0; + + __JavelinIGUISeek ctrlSetTextColor __ColorGray; + __JavelinIGUINFOV ctrlSetTextColor __ColorGreen; + __JavelinIGUITargetingConstrains ctrlShow false; + __JavelinIGUITargetingGate ctrlShow false; + __JavelinIGUITargetingLines ctrlShow false; + + 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];}; +} else { + if (_newTarget distance ACE_player < 2500 + // && {(call CBA_fnc_getFoV) select 1 > 7} + // && { (currentVisionMode ACE_player == 2)} + ) then { + // Lock on after 3 seconds + if(_currentTarget != _newTarget) then { + TRACE_1("New Target, reseting locking", _newTarget); + _lockTime = diag_tickTime; + _currentTarget = _newTarget; + + playSound "ACE_Javelin_Locking"; + } else { + if(diag_tickTime - _lockTime > 3) then { + TRACE_2("LOCKED!", _currentTarget, _lockTime); + __JavelinIGUISeek ctrlSetTextColor __ColorGreen; + __JavelinIGUINFOV ctrlSetTextColor __ColorNull; + __JavelinIGUITargetingConstrains ctrlShow true; + + ACE_player setVariable[QGVAR(currentTarget), _currentTarget, false]; + ACE_player setVariable[QGVAR(currentTargetPos), getPosASL _currentTarget, false]; + + if(diag_tickTime > _soundTime) then { + playSound "ACE_Javelin_Locked"; + _soundTime = diag_tickTime + 0.25; + }; + } else { + if(diag_tickTime > _soundTime) then { + playSound "ACE_Javelin_Locking"; + _soundTime = diag_tickTime + 0.25; + }; + }; + }; + } else { + // Something is wrong with our seek + _currentTarget = objNull; + + __JavelinIGUISeek ctrlSetTextColor __ColorGray; + __JavelinIGUINFOV ctrlSetTextColor __ColorGray; + __JavelinIGUITargetingConstrains ctrlShow false; + __JavelinIGUITargetingGate ctrlShow false; + __JavelinIGUITargetingLines ctrlShow false; + + ACE_player setVariable [QGVAR(currentTarget),nil, false]; + }; + +}; + +//TRACE_2("", _newTarget, _currentTarget); + +// Save arguments for next run +_args set[0, diag_tickTime]; +_args set[1, _currentTarget]; +_args set[2, _runTime]; +_args set[3, _lockTime]; +_args set[4, _soundTime]; + +uiNamespace setVariable[QGVAR(arguments), _args ]; \ No newline at end of file diff --git a/addons/wep_javelin/functions/fnc_onOpticLoad.sqf b/addons/wep_javelin/functions/fnc_onOpticLoad.sqf new file mode 100644 index 0000000000..c4a7069630 --- /dev/null +++ b/addons/wep_javelin/functions/fnc_onOpticLoad.sqf @@ -0,0 +1,17 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +TRACE_1("enter", _this); + +if((count _this) > 0) then { + uiNameSpace setVariable ['ACE_RscOptics_javelin',_this select 0]; +}; + +uiNameSpace setVariable [QGVAR(arguments), + [ + 0, // Last runtime + objNull, // currentTargetObject + 0, // Run Time + 0, // Lock Time + 0 // Sound timer + ] +]; \ No newline at end of file diff --git a/addons/wep_javelin/functions/fnc_translateToModelSpace.sqf b/addons/wep_javelin/functions/fnc_translateToModelSpace.sqf index 1e2e930ac7..12f828769a 100644 --- a/addons/wep_javelin/functions/fnc_translateToModelSpace.sqf +++ b/addons/wep_javelin/functions/fnc_translateToModelSpace.sqf @@ -1,3 +1,7 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +TRACE_1("enter", _this); + _object = _this select 0; _origin = getPosASL _object; _matrix = _this select 1; diff --git a/addons/wep_javelin/functions/fnc_translateToWeaponSpace.sqf b/addons/wep_javelin/functions/fnc_translateToWeaponSpace.sqf index d74fa17fa1..8f85005d48 100644 --- a/addons/wep_javelin/functions/fnc_translateToWeaponSpace.sqf +++ b/addons/wep_javelin/functions/fnc_translateToWeaponSpace.sqf @@ -1,3 +1,6 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +TRACE_1("enter", _this); _object = _this select 0; _origin = getPosASL _object; @@ -15,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/wep_javelin/initKeybinds.sqf b/addons/wep_javelin/initKeybinds.sqf new file mode 100644 index 0000000000..126b1395a3 --- /dev/null +++ b/addons/wep_javelin/initKeybinds.sqf @@ -0,0 +1,30 @@ +// by commy2 + +["ACE3", QGVAR(lockTarget), localize "STR_ACE_WEP_JAVELIN_LockTarget", +{ + if (GETGVAR(isLockKeyDown,false)) exitWith {false}; + + GVAR(isLockKeyDown) = true; + + // Statement + [ACE_player] call FUNC(lockKeyDown); + // Return false so it doesn't block the rest weapon action + false +}, +{ + // prevent holding down + GVAR(isLockKeyDown) = false; + + // Statement + [ACE_player] call FUNC(lockKeyUp); + false +}, +[15, [false, false, false]], false] call cba_fnc_addKeybind; //Tab Key + +["ACE3", QGVAR(cycleFireMode), localize "STR_ACE_WEP_JAVELIN_CycleFireMode", +{ false }, +{ + [ACE_player] call FUNC(cycleFireMode); + false +}, +[15, [false, true, false]], false] call cba_fnc_addKeybind; //Shift+Tab Key \ No newline at end of file diff --git a/addons/wep_javelin/script_component.hpp b/addons/wep_javelin/script_component.hpp index 3c21d429f2..3df1273422 100644 --- a/addons/wep_javelin/script_component.hpp +++ b/addons/wep_javelin/script_component.hpp @@ -2,11 +2,52 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_WEP_JAVELIN - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_WEP_JAVELIN - #define DEBUG_SETTINGS DEBUG_SETTINGS_WEP_JAVELIN + #define DEBUG_SETTINGS DEBUG_SETTINGS_WEP_JAVELIN #endif #include "\z\ace\Addons\main\script_macros.hpp" + +#define ACE_JAV_FIREMODE_DIR 1 +#define ACE_JAV_FIREMODE_TOP 2 + + +// Javelin IGUI defines +#define __JavelinIGUI (uinamespace getVariable "ACE_RscOptics_javelin") + +// Custom controls +#define __JavelinIGUISeek (__JavelinIGUI displayCtrl 699000) +#define __JavelinIGUITop (__JavelinIGUI displayCtrl 699001) +#define __JavelinIGUIDir (__JavelinIGUI displayCtrl 699002) +#define __JavelinIGUINFOV (__JavelinIGUI displayCtrl 699003) + +// Constrains +#define __JavelinIGUITargetingConstrains (__JavelinIGUI displayCtrl 699100) +#define __JavelinIGUITargetingConstrainTop (__JavelinIGUI displayCtrl 699101) +#define __JavelinIGUITargetingConstrainBottom (__JavelinIGUI displayCtrl 699102) +#define __JavelinIGUITargetingConstrainLeft (__JavelinIGUI displayCtrl 699103) +#define __JavelinIGUITargetingConstrainRight (__JavelinIGUI displayCtrl 699104) + +// Targeting gate +#define __JavelinIGUITargetingGate (__JavelinIGUI displayCtrl 699200) +#define __JavelinIGUITargetingGateTL (__JavelinIGUI displayCtrl 699201) +#define __JavelinIGUITargetingGateTR (__JavelinIGUI displayCtrl 699202) +#define __JavelinIGUITargetingGateBL (__JavelinIGUI displayCtrl 699203) +#define __JavelinIGUITargetingGateBR (__JavelinIGUI displayCtrl 699204) + +// Rangefinder +#define __JavelinIGUIRangefinder (__JavelinIGUI displayCtrl 151) + +// Targeting lines +#define __JavelinIGUITargetingLines (__JavelinIGUI displayCtrl 699300) +#define __JavelinIGUITargetingLineH (__JavelinIGUI displayCtrl 699301) +#define __JavelinIGUITargetingLineV (__JavelinIGUI displayCtrl 699302) + +// Colors for controls +#define __ColorOrange [0.9255,0.5216,0.1216,1] +#define __ColorGreen [0.2941,0.8745,0.2157,1] +#define __ColorGray [0.2941,0.2941,0.2941,1] +#define __ColorNull [0,0,0,0] \ No newline at end of file diff --git a/addons/wep_javelin/stringtable.xml b/addons/wep_javelin/stringtable.xml new file mode 100644 index 0000000000..4068d6f0a6 --- /dev/null +++ b/addons/wep_javelin/stringtable.xml @@ -0,0 +1,24 @@ + + + + + + Lock Target (Hold) + Lock Target (Hold) + Lock Target (Hold) + Lock Target (Hold) + Lock Target (Hold) + Lock Target (Hold) + Lock Target (Hold) + + + Cycle Fire Mode + Cycle Fire Mode + Cycle Fire Mode + Cycle Fire Mode + Cycle Fire Mode + Cycle Fire Mode + Cycle Fire Mode + + + 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/CMakeLists.txt b/extensions/CMakeLists.txt new file mode 100644 index 0000000000..f0e21e9207 --- /dev/null +++ b/extensions/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required (VERSION 3.0) +project (ACE) + +if (NOT CMAKE_BUILD_TYPE AND CMAKE_COMPILER_IS_GNUCXX) + message(STATUS "No build type selected, default to Debug") + set(CMAKE_BUILD_TYPE "Debug") +endif() + +option(USE_64BIT_BUILD "USE_64BIT_BUILD" OFF) +option(USE_STATIC_LINKING "USE_STATIC_LINKING" ON) + + +if(CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_CXX_FLAGS "-std=c++11 -march=i686 -m32 -O2 -s -fPIC -fpermissive") + set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") + set(CMAKE_SHARED_LINKER_FLAGS "-static-libgcc -static-libstdc++") +else() + set(CMAKE_CXX_FLAGS_DEBUG "/D _DEBUG /MTd /Zi /Ob0 /Od /RTC1") + set(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG") + set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG") +endif() + +file(GLOB ACE_COMMON_SOURCES common/*.h common/*.hpp common/*.c common/*.cpp) +add_library(ace_common STATIC ${ACE_COMMON_SOURCES}) +include_directories(AFTER "common") + +# Add extensions to build here +add_subdirectory(fcs) + +message("Build Type: ${CMAKE_BUILD_TYPE}") \ No newline at end of file diff --git a/extensions/build/.gitignore b/extensions/build/.gitignore new file mode 100644 index 0000000000..44c5ea8fa7 --- /dev/null +++ b/extensions/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file diff --git a/extensions/common/ace_common.cpp b/extensions/common/ace_common.cpp new file mode 100644 index 0000000000..6ccd690c3a --- /dev/null +++ b/extensions/common/ace_common.cpp @@ -0,0 +1,4 @@ + +int test(int var) { + return var; +} \ No newline at end of file diff --git a/extensions/common/ace_common.h b/extensions/common/ace_common.h new file mode 100644 index 0000000000..4a8847b209 --- /dev/null +++ b/extensions/common/ace_common.h @@ -0,0 +1,4 @@ +#pragma once + +#include "targetver.h" + diff --git a/extensions/common/targetver.h b/extensions/common/targetver.h new file mode 100644 index 0000000000..781012c18f --- /dev/null +++ b/extensions/common/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +#ifdef _WIN32 + #define WIN32_LEAN_AND_MEAN + #include +#else + +#endif \ No newline at end of file diff --git a/extensions/fcs/CMakeLists.txt b/extensions/fcs/CMakeLists.txt new file mode 100644 index 0000000000..2b24542566 --- /dev/null +++ b/extensions/fcs/CMakeLists.txt @@ -0,0 +1,11 @@ +set(ACE_EXTENSION_NAME "ace_fcs") + +file(GLOB SOURCES *.h *.hpp *.c *.cpp) +add_library( ${ACE_EXTENSION_NAME} SHARED ${SOURCES}) +add_dependencies(${ACE_EXTENSION_NAME} ace_common) +SET_TARGET_PROPERTIES(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") + +if(CMAKE_COMPILER_IS_GNUCXX) + set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_START_STATIC 1) + set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_END_STATIC 1) +endif() \ No newline at end of file diff --git a/extensions/ace_fcs.cpp b/extensions/fcs/ace_fcs.cpp similarity index 94% rename from extensions/ace_fcs.cpp rename to extensions/fcs/ace_fcs.cpp index 81c515e0aa..6338dd8571 100644 --- a/extensions/ace_fcs.cpp +++ b/extensions/fcs/ace_fcs.cpp @@ -11,8 +11,8 @@ * Correction to angle */ -#include "stdafx.h" - +#include "ace_common.h" + #define _USE_MATH_DEFINES #include @@ -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/extensions/stdafx.cpp b/extensions/stdafx.cpp deleted file mode 100644 index e1e622b65d..0000000000 --- a/extensions/stdafx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// ace_fcs.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/extensions/stdafx.h b/extensions/stdafx.h deleted file mode 100644 index f3a07375c7..0000000000 --- a/extensions/stdafx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#pragma once - -#include "targetver.h" - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -// Windows Header Files: -#include - - - -// TODO: reference additional headers your program requires here diff --git a/optionals/server/config.cpp b/optionals/server/config.cpp new file mode 100644 index 0000000000..9cfcb35012 --- /dev/null +++ b/optionals/server/config.cpp @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"Glowbal"}; + authorUrl = "https://github.com/Glowbal/"; + VERSION_CONFIG; + }; +}; + +class ACE_ServerSettings { + #include "\userconfig\ace\serverconfig.hpp" +}; diff --git a/optionals/server/script_component.hpp b/optionals/server/script_component.hpp new file mode 100644 index 0000000000..f044c9601a --- /dev/null +++ b/optionals/server/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT serverconfig +#include "\z\ace\Addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_SERVERCONFIG + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_SERVERCONFIG + #define DEBUG_SETTINGS DEBUG_SETTINGS_SERVERCONFIG +#endif + +#include "\z\ace\Addons\main\script_macros.hpp" diff --git a/optionals/userconfig/ace/serverconfig.hpp b/optionals/userconfig/ace/serverconfig.hpp new file mode 100644 index 0000000000..ebabfe12bd --- /dev/null +++ b/optionals/userconfig/ace/serverconfig.hpp @@ -0,0 +1,6 @@ + +// Example: +class ACE_common_forceAllSettings { + value = 0; + typeName = "BOOL"; +}; diff --git a/tools/ace_build_tool/pabstFrankensteinBuilder.py b/tools/ace_build_tool/pabstFrankensteinBuilder.py index 43d67e187d..a0c57f2b3e 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 @@ -577,10 +578,28 @@ See the make.cfg file for additional build options. #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")]) + if ret != 0: + print_error("cfgConvertGUI (bin) return code == " + str(ret)) + input("Press Enter to continue...") + + #PABST: Need micro sleeps because cfgConvertGUI can return before it's finished procressing + time.sleep(0.05) + ret = subprocess.call(["cfgConvertGUI.exe", os.path.join(work_drive, prefix, module, "config.bin")]) - + if ret != 0: + print_error("cfgConvertGUI (txt) return code == " + str(ret)) + input("Press Enter to continue...") + + time.sleep(0.05) + + #cmd = [rapifyTool, "-L", "-P", os.path.join(work_drive, prefix, module, "config.cpp")]; + #ret = subprocess.call(cmd) + #if ret != 0: + # print_error("rapifyTool return code == " + str(ret) + str(cmd)) + # input("Press Enter to continue...") + # Call pboProject os.chdir("P:\\") @@ -625,12 +644,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"))