Merge branch 'master' into AdvancedBallistics

This commit is contained in:
esteldunedain 2015-04-05 19:05:12 -03:00
commit b8c493a495
125 changed files with 3878 additions and 1093 deletions

View File

@ -95,29 +95,7 @@ class CfgVehicles {
}; };
}; };
class Heli_Attack_01_base_F: Helicopter_Base_F { #include "Heli_Attack_01_base_F.hpp"
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";
};
};
};
class B_Heli_Attack_01_F: Heli_Attack_01_base_F {}; class B_Heli_Attack_01_F: Heli_Attack_01_base_F {};
@ -222,7 +200,7 @@ class CfgVehicles {
lockDetectionSystem = 0; lockDetectionSystem = 0;
incomingMissileDetectionSystem = 16; incomingMissileDetectionSystem = 16;
driverCanEject = 1; 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"}; magazines[] = {"5000Rnd_762x51_Yellow_Belt","24Rnd_missiles","168Rnd_CMFlare_Chaff_Magazine"};
class Turrets: Turrets { class Turrets: Turrets {

View File

@ -4,6 +4,23 @@ class Mode_Burst;
class Mode_FullAuto; class Mode_FullAuto;
class CfgWeapons { 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 // Manual Switching Of Flare Mode
class SmokeLauncher; class SmokeLauncher;
class CMFlareLauncher: SmokeLauncher { class CMFlareLauncher: SmokeLauncher {

File diff suppressed because one or more lines are too long

View File

@ -3,6 +3,7 @@ ace_aircraft
Changes to air weaponry, flightmodels and HUDs. Changes to air weaponry, flightmodels and HUDs.
* Contributations by Kimi for HUD updates
## Maintainers ## Maintainers
@ -10,3 +11,4 @@ The people responsible for merging changes to this component or answering potent
- [KoffeinFlummi](https://github.com/KoffeinFlummi) - [KoffeinFlummi](https://github.com/KoffeinFlummi)
- [commy2](https://github.com/commy2) - [commy2](https://github.com/commy2)
- [jaynus](https://github.com/walterpearce)

View File

@ -0,0 +1,578 @@
class RscControlsGroup;
class RscText;
class RangeText: RscText{};
class RscPicture;
class RscOpticsText;
class RscIGProgress;
class RscOpticsValue;
class VScrollbar;
class HScrollbar;
class RscLadderPicture;
class RscInGameUI
{
class RscUnitInfo;
class Rsc_ACE_Helo_UI_Turret: RscUnitInfo
{
idd = 300;
controls[] = {"CA_Zeroing","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)";
};
};
};
};
};

View File

@ -6,7 +6,7 @@ class CfgPatches {
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"}; requiredAddons[] = {"ace_common"};
author[] = {"KoffeinFlummi","Crusty","commy2"}; author[] = {"KoffeinFlummi","Crusty","commy2","jaynus","Kimi"};
authorUrl = "https://github.com/KoffeinFlummi/"; authorUrl = "https://github.com/KoffeinFlummi/";
VERSION_CONFIG; VERSION_CONFIG;
}; };
@ -16,3 +16,4 @@ class CfgPatches {
#include "CfgMagazines.hpp" #include "CfgMagazines.hpp"
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"
#include "CfgWeapons.hpp" #include "CfgWeapons.hpp"
#include "RscInGameUI.hpp"

Binary file not shown.

View File

@ -94,7 +94,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment
_unit removeAction _actionID; _unit removeAction _actionID;
if (GVAR(placeAction) == 1) then { 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); [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _startingPosition] call FUNC(placeApprove);
}; };
deleteVehicle _tempObject; deleteVehicle _tempObject;

View File

@ -25,6 +25,6 @@ _itemName = [_args, 0, ""] call CBA_fnc_defaultParam;
_attachLimit = [6, 1] select (_player == _attachToVehicle); _attachLimit = [6, 1] select (_player == _attachToVehicle);
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; _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) + [""])}; (canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemName in ((itemsWithMagazines _player) + [""])};

View File

@ -45,7 +45,7 @@ while {(_closeInMax - _closeInMin) > 0.01} do {
// systemChat format ["Trying %1 from %2 start %3", _closeInDistance, [_closeInMax, _closeInMin], _startDistanceFromCenter]; // systemChat format ["Trying %1 from %2 start %3", _closeInDistance, [_closeInMax, _closeInMin], _startDistanceFromCenter];
_endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance); _endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance);
_endPosTestOffset set [2, (_startingOffset select 2)]; _endPosTestOffset set [2, (_startingOffset select 2)];
_endPosTest = _attachToVehicle modelToWorld _endPosTestOffset; _endPosTest = _attachToVehicle modelToWorldVisual _endPosTestOffset;
_doesIntersect = false; _doesIntersect = false;
{ {

View File

@ -37,7 +37,7 @@ _sounds = [
QUOTE(PATHTO_R(sounds\zip_out.wav)) 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); _position = _position call EFUNC(common,positionToASL);
playSound3D [ playSound3D [

View File

@ -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;
};
};

View File

@ -14,3 +14,4 @@ class CfgPatches {
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"
#include "CfgWeapons.hpp" #include "CfgWeapons.hpp"
#include "CfgAmmo.hpp"

View File

@ -18,9 +18,6 @@
EXPLODE_2_PVT(_this,_unit,_isUnconc); EXPLODE_2_PVT(_this,_unit,_isUnconc);
diag_log "handleOnUnconscious";
diag_log _this;
diag_log _unit;
if (!local _unit) exitWith {}; if (!local _unit) exitWith {};
if (_isUnconc) then { if (_isUnconc) then {

View File

@ -73,6 +73,15 @@ PREP(getStringFromMissionSQM);
PREP(getTargetAzimuthAndInclination); PREP(getTargetAzimuthAndInclination);
PREP(getTargetDistance); PREP(getTargetDistance);
PREP(getTargetObject); PREP(getTargetObject);
PREP(getTurretCommander);
PREP(getTurretConfigPath);
PREP(getTurretCopilot);
PREP(getTurretGunner);
PREP(getTurretIndex);
PREP(getTurrets);
PREP(getTurretsFFV);
PREP(getTurretsOther);
PREP(getTurretDirection);
PREP(getUavControlPosition); PREP(getUavControlPosition);
PREP(getVehicleCargo); PREP(getVehicleCargo);
PREP(getVehicleCodriver); PREP(getVehicleCodriver);

View File

@ -57,7 +57,7 @@ switch ((_type select 0)) do {
}; };
} else { } else {
_addedToPlayer = false; _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 = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit addWeaponCargoGlobal [_classname,1]; _unit addWeaponCargoGlobal [_classname,1];
_unit setPosATL _pos; _unit setPosATL _pos;
@ -73,7 +73,7 @@ switch ((_type select 0)) do {
}; };
} else { } else {
_addedToPlayer = false; _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 = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit addMagazineCargoGlobal [_classname, 1]; _unit addMagazineCargoGlobal [_classname, 1];
_unit setPosATL _pos; _unit setPosATL _pos;
@ -89,7 +89,7 @@ switch ((_type select 0)) do {
}; };
} else { } else {
_addedToPlayer = false; _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 = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit addItemCargoGlobal [_classname,1]; _unit addItemCargoGlobal [_classname,1];
_unit setPosATL _pos; _unit setPosATL _pos;

View File

@ -242,10 +242,10 @@ _fnc_isInRange = {
private ["_unitPosition", "_distance"]; private ["_unitPosition", "_distance"];
_unitPosition = getPos _unit; _unitPosition = getPos _unit;
_distance = _unitPosition distance (_vehicle modelToWorld _selectionPosition); _distance = _unitPosition distance (_vehicle modelToWorldVisual _selectionPosition);
if (!isNil "_selectionPosition2") then { if (!isNil "_selectionPosition2") then {
_distance = _distance min (_unitPosition distance (_vehicle modelToWorld _selectionPosition2)); _distance = _distance min (_unitPosition distance (_vehicle modelToWorldVisual _selectionPosition2));
}; };
_distance < _radius _distance < _radius

View File

@ -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]

View File

@ -14,7 +14,7 @@ private ["_unit","_return","_aslPos"];
_unit = _this select 0; _unit = _this select 0;
_return = false; _return = false;
if ((surfaceIsWater getPos _unit)) then { if ((surfaceIsWater getPos _unit)) then {
_aslPos = _unit modelToWorld (_unit selectionPosition "head"); _aslPos = _unit modelToWorldVisual (_unit selectionPosition "head");
if ((_aslPos select 2) <= 0) then { if ((_aslPos select 2) <= 0) then {
_return = true; _return = true;
}; };

View File

@ -36,7 +36,7 @@ if (_target isKindOf "CAManBase") then {
// add height offset of model // add height offset of model
private "_offset"; 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]; _position = _position vectorAdd [0, 0, _offset];

View File

@ -25,7 +25,7 @@ _direction = _target getVariable [QGVAR(dragDirection), 0];
// add height offset of model // add height offset of model
private "_offset"; 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]; _position = _position vectorAdd [0, 0, _offset];

View File

@ -36,7 +36,7 @@ if (_carriedItem isKindOf "CAManBase") exitWith {false};
private ["_position", "_maxHeight"]; private ["_position", "_maxHeight"];
_position = getPosATL _carriedItem; _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]; _position set [2, ((_position select 2) + _scrollAmount min (_maxHeight + 1.5)) max _maxHeight];

View File

@ -19,7 +19,7 @@
#include "script_component.hpp" #include "script_component.hpp"
EXPLODE_4_PVT(_this select 0,_unit,_i,_arr,_code); EXPLODE_4_PVT(_this select 0,_unit,_i,_arr,_code);
if ((_i mod 4) == 0) then { 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)]]; ctrlSetText [1400,format["Calling%1",_arr select (_i - 4)]];

View File

@ -15,7 +15,7 @@
* Placed explosive <OBJECT> * Placed explosive <OBJECT>
* *
* Example: * Example:
* _explosive = [player, player modelToWorld [0,0.5, 0.1], 134, * _explosive = [player, player modelToWorldVisual [0,0.5, 0.1], 134,
* "SatchelCharge_Remote_Mag", "Command", []] call ACE_Explosives_fnc_placeExplosive; * "SatchelCharge_Remote_Mag", "Command", []] call ACE_Explosives_fnc_placeExplosive;
* *
* Public: Yes * Public: Yes

View File

@ -5,3 +5,6 @@ GVAR(time) = 0;
GVAR(position) = [0,0,0]; GVAR(position) = [0,0,0];
#include "initKeybinds.sqf" #include "initKeybinds.sqf"
// Register event for global updates
[QGVAR(forceUpdate), FUNC(onForceUpdate)] call ace_common_fnc_addEventHandler;

View File

@ -10,6 +10,7 @@ PREP(firedEH);
PREP(getAngle); PREP(getAngle);
PREP(getRange); PREP(getRange);
PREP(handleAirBurstAmmunitionPFH); PREP(handleAirBurstAmmunitionPFH);
PREP(onForceUpdate);
PREP(keyDown); PREP(keyDown);
PREP(keyUp); PREP(keyUp);
PREP(reset); PREP(reset);

View File

@ -12,7 +12,7 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_vehicle", "_turret", "_turretConfig", "_distance", "_magazines"]; private ["_vehicle", "_turret", "_turretConfig", "_distance", "_magazines", "_userChange"];
_vehicle = _this select 0; _vehicle = _this select 0;
_turret = _this select 1; _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); _angleTarget = asin (_weaponDirection select 2);
if (count _this > 2) then { 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 { if (!(isNil QGVAR(backgroundCalculation)) and {!(scriptDone GVAR(backgroundCalculation))}) then {
@ -160,4 +162,11 @@ _FCSElevation = [];
[_vehicle, format ["%1_%2", QGVAR(Elevation), _turret], _FCSElevation] call EFUNC(common,setVariablePublic); [_vehicle, format ["%1_%2", QGVAR(Elevation), _turret], _FCSElevation] call EFUNC(common,setVariablePublic);
[_vehicle, format ["%1_%2", QGVAR(Azimuth), _turret], _FCSAzimuth] 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); _userChange = true;
if( (count _this) > 3) then {
_userChange = _this select 3;
};
if(_userChange) then {
[format ["%1: %2", localize "STR_ACE_FCS_ZeroedTo", _distance]] call EFUNC(common,displayTextStructured);
};

View File

@ -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] call FUNC(keyUp);

View File

@ -28,24 +28,22 @@ if((count _this) > 2) then {
_pos = _this select 2; _pos = _this select 2;
} else { } else {
if(typeName (_actionData select 7) == "ARRAY") then { if(typeName (_actionData select 7) == "ARRAY") then {
_pos = _object modelToWorld (_actionData select 7); _pos = _object modelToWorldVisual (_actionData select 7);
} else { } else {
if ((_actionData select 7) == "weapon") then { if ((_actionData select 7) == "weapon") then {
// Craft a suitable position for weapon interaction // Craft a suitable position for weapon interaction
_weaponDir = _object weaponDirection currentWeapon _object; _weaponDir = _object weaponDirection currentWeapon _object;
_ref = _weaponDir call EFUNC(common,createOrthonormalReference); _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 { } 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 // For non-self actions, exit if the action is too far away
if (GVAR(openedMenuType) == 0 && vehicle ACE_player == ACE_player && 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 // Exit if the action is behind you
_sPos = if (count _pos != 2) then { _sPos = if (count _pos != 2) then {

View File

@ -1,11 +1,11 @@
class Extended_PreInit_EventHandlers { class Extended_PreInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_pre_init)); init = QUOTE(call COMPILE_FILE(XEH_pre_init));
}; };
}; };
class Extended_PostInit_EventHandlers { class Extended_PostInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_post_init)); init = QUOTE(call COMPILE_FILE(XEH_post_init));
}; };
}; };

View File

@ -1,9 +1,9 @@
class CfgVehicles { class CfgVehicles {
class All; class All;
class LaserTarget: All { class LaserTarget: All {
class EventHandlers { class EventHandlers {
init = QUOTE(_this call FUNC(laser_init)); init = QUOTE(_this call FUNC(laser_init));
}; };
}; };
}; };

View File

@ -14,7 +14,7 @@ PREP(translateToWeaponSpace);
PREP(laser_init); 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); PREP(laserTargetPFH);

View File

@ -1,13 +1,13 @@
#include "script_component.hpp" #include "script_component.hpp"
class CfgPatches { class CfgPatches {
class ADDON { class ADDON {
units[] = {}; units[] = {};
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = { "ace_common" }; requiredAddons[] = { "ace_common" };
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };
#include "CfgEventhandlers.hpp" #include "CfgEventhandlers.hpp"

View File

@ -7,7 +7,7 @@ _designator = _this select 2;
_seeker = _this select 3; _seeker = _this select 3;
_spacing = 100; _spacing = 100;
if((count _this) > 4) then { if((count _this) > 4) then {
_spacing = _this select 4; _spacing = _this select 4;
}; };
_return = true; _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"]; // player sideChat format["new los check"];
if(terrainIntersect [_pos2, _pos1]) then { if(terrainIntersect [_pos2, _pos1]) then {
_return = false; _return = false;
} else { } else {
if(lineIntersects [_pos2, _pos1]) then { // should take as arguments and add to this command objects to exclude - target and observer 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]]; // player sideChat format["with: %1", lineIntersectsWith [_pos1, _pos2]];
_return = false; _return = false;
}; };
}; };
_return; _return;

View File

@ -1,70 +1,70 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_missile", "_headingPitch", "_found", "_vectorTo", "_polarTo", "_dir", "_vertOk", "_horzOk", "_fov", 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; _missile = _this select 0;
_laserCode = _this select 1; _laserCode = _this select 1;
_fov = if (count _this > 2) then {_this select 2} else {75}; _fov = if (count _this > 2) then {_this select 2} else {75};
_vector = if (count _this > 3) then {_this select 3} else {vectorDir _missile}; _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]}; _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; _currentTarget = nil;
_found = false; _found = false;
LOG("Searching lasers"); LOG("Searching lasers");
if(!(isNil "ACE_LASERS")) then { if(!(isNil "ACE_LASERS")) then {
_potentialTargets = []; _potentialTargets = [];
TRACE_1("", ACE_LASERS); TRACE_1("", ACE_LASERS);
{ {
if(!(isNull _x)) then { if(!(isNull _x)) then {
_sensorPos = ATLtoASL(_missile modelToWorld _offset); _sensorPos = ATLtoASL(_missile modelToWorldVisual _offset);
_vectorTo = [_sensorPos, ([_x] call FUNC(getPosASL))] call BIS_fnc_vectorFromXToY; _vectorTo = [_sensorPos, ([_x] call FUNC(getPosASL))] call BIS_fnc_vectorFromXToY;
_polarTo = _vectorTo call CBA_fnc_vect2polar; _polarTo = _vectorTo call CBA_fnc_vect2polar;
_dir = _polarTo select 1; _dir = _polarTo select 1;
_dir = _dir - (_headingPitch select 1); _dir = _dir - (_headingPitch select 1);
TRACE_4("Calc", _sensorPos, _vectorTo, _polarTo, _dir); TRACE_4("Calc", _sensorPos, _vectorTo, _polarTo, _dir);
if (_dir < 0) then {_dir = _dir + 360}; if (_dir < 0) then {_dir = _dir + 360};
if (_dir > 360) then {_dir = _dir - 360}; if (_dir > 360) then {_dir = _dir - 360};
_vertOk = false; _vertOk = false;
_horzOk = false; _horzOk = false;
if(_dir < _fov || {_dir > (360-_fov)}) then { if(_dir < _fov || {_dir > (360-_fov)}) then {
_horzOk = true; _horzOk = true;
}; };
if(abs((abs(_polarTo select 2))-(abs(_headingPitch select 2))) < _fov) then { if(abs((abs(_polarTo select 2))-(abs(_headingPitch select 2))) < _fov) then {
_vertOk = true; _vertOk = true;
}; };
TRACE_2("Results", _vertOk, _horzOk); TRACE_2("Results", _vertOk, _horzOk);
if(_vertOk && {_horzOk}) then { if(_vertOk && {_horzOk}) then {
// Does the laser currently have our current code, if we have one? // Does the laser currently have our current code, if we have one?
_targetCode = _x getVariable ["ACE_LASERTARGET_CODE", ACE_DEFAULT_LASER_CODE]; _targetCode = _x getVariable ["ACE_LASERTARGET_CODE", ACE_DEFAULT_LASER_CODE];
TRACE_1("Target in sight, checking code", _targetCode, _laserCode); TRACE_1("Target in sight, checking code", _targetCode, _laserCode);
if(_targetCode == _laserCode) then { if(_targetCode == _laserCode) then {
_potentialTargets set[(count _potentialTargets), _x]; _potentialTargets set[(count _potentialTargets), _x];
}; };
}; };
}; };
} forEach ACE_LASERS; } forEach ACE_LASERS;
TRACE_1("", _potentialTargets); TRACE_1("", _potentialTargets);
_closestDistance = 100000; _closestDistance = 100000;
{ {
_pos1 = (getPosASL _missile); _pos1 = (getPosASL _missile);
_pos2 = ([_x] call FUNC(getPosASL)); _pos2 = ([_x] call FUNC(getPosASL));
_disCheck = _pos1 distance _pos2; _disCheck = _pos1 distance _pos2;
// shouldn't this bail out when a valid target is found instead of iterating over all potential targets ? // 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 { if(_disCheck < _closestDistance && {[_pos1, _pos2, _x, _missile] call FUNC(checkLos)}) then {
_found = true; _found = true;
_currentTarget = _x; _currentTarget = _x;
_closestDistance = _disCheck; _closestDistance = _disCheck;
}; };
} forEach _potentialTargets; } forEach _potentialTargets;
}; };
[_found, _currentTarget] [_found, _currentTarget]

View File

@ -7,43 +7,43 @@ _outliers = [];
_spot = []; _spot = [];
_testPos = (_list select 0) select 0; _testPos = (_list select 0) select 0;
{ {
_samplePos = _x select 0; _samplePos = _x select 0;
if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then { if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then {
if(_samplePos distance _testPos < 2) then { if(_samplePos distance _testPos < 2) then {
_spot pushBack _samplePos; _spot pushBack _samplePos;
} else { } else {
_outliers pushBack _samplePos; _outliers pushBack _samplePos;
}; };
}; };
} forEach _list; } forEach _list;
_spots pushBack _spot; _spots pushBack _spot;
if(count _outliers > 0) then { if(count _outliers > 0) then {
for "_i" from 1 to 3 do { for "_i" from 1 to 3 do {
_remainingSpots = _outliers; _remainingSpots = _outliers;
_outliers = []; _outliers = [];
_spot = []; _spot = [];
_testPos = (_remainingSpots select 0); _testPos = (_remainingSpots select 0);
{ {
_samplePos = _x; _samplePos = _x;
if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then { if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then {
if(_samplePos distance _testPos < 2) then { if(_samplePos distance _testPos < 2) then {
_spot pushBack _samplePos; _spot pushBack _samplePos;
} else { } else {
_outliers pushBack _samplePos; _outliers pushBack _samplePos;
}; };
}; };
} forEach _remainingSpots; } forEach _remainingSpots;
_spots pushBack _spot; _spots pushBack _spot;
}; };
}; };
_largest = 0; _largest = 0;
_largestSpot = []; _largestSpot = [];
{ {
if((count _x) > _largest) then { if((count _x) > _largest) then {
_largest = (count _x); _largest = (count _x);
_largestSpot = _x; _largestSpot = _x;
}; };
} forEach _spots; } forEach _spots;
// player sideChat format["g: %1", _spots]; // player sideChat format["g: %1", _spots];
_largestSpot select (random (floor(count _largestSpot))); _largestSpot select (random (floor(count _largestSpot)));

View File

@ -6,8 +6,8 @@ _args = _this select 0;
_laserTarget = _args select 0; _laserTarget = _args select 0;
if(isNull _laserTarget || !alive player) exitWith { if(isNull _laserTarget || !alive player) exitWith {
[(_this select 1)] call cba_fnc_removePerFrameHandler; [(_this select 1)] call cba_fnc_removePerFrameHandler;
REM(ACE_LASERS, _laserTarget); REM(ACE_LASERS, _laserTarget);
}; };
_end = diag_tickTime; _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"]; 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)]; 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"]; 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; } forEach DRAW_LINES;
DRAW_LINES = []; DRAW_LINES = [];
#endif #endif

View File

@ -16,10 +16,10 @@ REM(ACE_LASERS, objNull);
if(!(local _laserTarget)) exitWith { }; if(!(local _laserTarget)) exitWith { };
// The target is local, so its on this client // The target is local, so its on this client
if(!isDedicated) then { if(!isDedicated) then {
_laserTarget setVariable ["ACE_LASERTARGET_SHOOTER", player, true]; _laserTarget setVariable ["ACE_LASERTARGET_SHOOTER", player, true];
[FUNC(laserTargetPFH), 0, [_laserTarget, player]] call cba_fnc_addPerFrameHandler; [FUNC(laserTargetPFH), 0, [_laserTarget, player]] call cba_fnc_addPerFrameHandler;
} else { } else {
// server side ownership of laser // server side ownership of laser
//_laserTarget setVariable ["ACE_LASERTARGET_SHOOTER", nil, false]; //_laserTarget setVariable ["ACE_LASERTARGET_SHOOTER", nil, false];
}; };

View File

@ -17,50 +17,50 @@ _vecRotateMap = [_cp, _p1, _p2] call FUNC(rotateVectLineGetMap);
_result = [_pos, _vec] call FUNC(shootRay); _result = [_pos, _vec] call FUNC(shootRay);
_resultPos = _result select 0; _resultPos = _result select 0;
if(!isNil "_resultPos") then { if(!isNil "_resultPos") then {
_distance = _result select 1; _distance = _result select 1;
if(_distance < _shortestReturn) then { if(_distance < _shortestReturn) then {
_shortestReturn = _distance; _shortestReturn = _distance;
}; };
if(_distance > _longestReturn) then { if(_distance > _longestReturn) then {
_longestReturn = _distance; _longestReturn = _distance;
}; };
_resultPositions set[(count _resultPositions), _result]; _resultPositions set[(count _resultPositions), _result];
#ifdef DEBUG_MODE_FULL #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 #endif
}; };
_count = 8; _count = 8;
_pos2 = [ _pos2 = [
(_pos select 0)+((_vec select 0)*1000), (_pos select 0)+((_vec select 0)*1000),
(_pos select 1)+((_vec select 1)*1000), (_pos select 1)+((_vec select 1)*1000),
(_pos select 2)+((_vec select 2)*1000) (_pos select 2)+((_vec select 2)*1000)
]; ];
{ {
for "_i" from 0 to ceil(_count*_x) do { for "_i" from 0 to ceil(_count*_x) do {
_radOffset = random 360; _radOffset = random 360;
_offset = [_vecRotateMap, (((360/_count)*_i)+_radOffset) mod 360] call FUNC(rotateVectLine); _offset = [_vecRotateMap, (((360/_count)*_i)+_radOffset) mod 360] call FUNC(rotateVectLine);
_offsetPos = [ _offsetPos = [
(_pos2 select 0)+((_offset select 0)*(_divergence*_x)), (_pos2 select 0)+((_offset select 0)*(_divergence*_x)),
(_pos2 select 1)+((_offset select 1)*(_divergence*_x)), (_pos2 select 1)+((_offset select 1)*(_divergence*_x)),
(_pos2 select 2)+((_offset select 2)*(_divergence*_x)) (_pos2 select 2)+((_offset select 2)*(_divergence*_x))
]; ];
_offsetVector = [_pos, _offsetPos] call BIS_fnc_vectorFromXtoY; _offsetVector = [_pos, _offsetPos] call BIS_fnc_vectorFromXtoY;
_result = [_pos, _offsetVector] call FUNC(shootRay); _result = [_pos, _offsetVector] call FUNC(shootRay);
_resultPos = _result select 0; _resultPos = _result select 0;
if(!isNil "_resultPos") then { if(!isNil "_resultPos") then {
_distance = _result select 1; _distance = _result select 1;
if(_distance < _shortestReturn) then { if(_distance < _shortestReturn) then {
_shortestReturn = _distance; _shortestReturn = _distance;
}; };
if(_distance > _longestReturn) then { if(_distance > _longestReturn) then {
_longestReturn = _distance; _longestReturn = _distance;
}; };
_resultPositions set[(count _resultPositions), _result]; _resultPositions set[(count _resultPositions), _result];
#ifdef DEBUG_MODE_FULL #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 #endif
}; };
}; };
} forEach [1,0.5,0.25]; } forEach [1,0.5,0.25];
[_longestReturn, _shortestReturn, _resultPositions]; [_longestReturn, _shortestReturn, _resultPositions];

View File

@ -9,22 +9,22 @@ _resultPos = nil;
_fidelity = [1000,100,10,1,0.1]; _fidelity = [1000,100,10,1,0.1];
_lastPos = +_pos; _lastPos = +_pos;
{ {
scopeName "mainSearch"; scopeName "mainSearch";
for "_i" from 1 to 10 do { for "_i" from 1 to 10 do {
_nextPos = [ _nextPos = [
(_lastPos select 0)+((_vec select 0)*_x), (_lastPos select 0)+((_vec select 0)*_x),
(_lastPos select 1)+((_vec select 1)*_x), (_lastPos select 1)+((_vec select 1)*_x),
(_lastPos select 2)+((_vec select 2)*_x) (_lastPos select 2)+((_vec select 2)*_x)
]; ];
if(lineIntersects [_lastPos, _nextPos] || terrainIntersectASL [_lastPos, _nextPos]) then { if(lineIntersects [_lastPos, _nextPos] || terrainIntersectASL [_lastPos, _nextPos]) then {
_resultPos = _lastPos; _resultPos = _lastPos;
breakTo "mainSearch"; breakTo "mainSearch";
} else { } else {
_distance = _distance + _x; _distance = _distance + _x;
_lastPos = _nextPos; _lastPos = _nextPos;
}; };
}; };
} forEach _fidelity; } forEach _fidelity;
[_resultPos, _distance]; [_resultPos, _distance];

View File

@ -14,9 +14,9 @@ _y = _offset select 1;
_z = _offset select 2; _z = _offset select 2;
_out = [ _out = [
((_xVec select 0)*_x) + ((_xVec select 1)*_y) + ((_xVec 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), ((_yVec select 0)*_x) + ((_yVec select 1)*_y) + ((_yVec select 2)*_z),
((_zVec select 0)*_x) + ((_zVec select 1)*_y) + ((_zVec select 2)*_z) ((_zVec select 0)*_x) + ((_zVec select 1)*_y) + ((_zVec select 2)*_z)
]; ];
_out; _out;

View File

@ -2,11 +2,11 @@
#include "\z\ace\Addons\main\script_mod.hpp" #include "\z\ace\Addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_LASER #ifdef DEBUG_ENABLED_LASER
#define DEBUG_MODE_FULL #define DEBUG_MODE_FULL
#endif #endif
#ifdef DEBUG_SETTINGS_LASER #ifdef DEBUG_SETTINGS_LASER
#define DEBUG_SETTINGS DEBUG_SETTINGS_LASER #define DEBUG_SETTINGS DEBUG_SETTINGS_LASER
#endif #endif
#include "\z\ace\Addons\main\script_macros.hpp" #include "\z\ace\Addons\main\script_macros.hpp"

View File

@ -10,18 +10,10 @@ class Extended_PostInit_EventHandlers {
}; };
}; };
class Extended_GetIn_EventHandlers { class Extended_Init_EventHandlers {
class B_Heli_Attack_01_F { class Helicopter {
class ADDON { 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));
};
};
};

View File

@ -23,7 +23,8 @@ class CfgVehicles {
class B_Heli_Attack_01_F: Heli_Attack_01_base_F { class B_Heli_Attack_01_F: Heli_Attack_01_base_F {
class Turrets: Turrets { class Turrets: Turrets {
class MainTurret: MainTurret { 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
}; };
}; };
}; };

View File

@ -1,12 +1,11 @@
#include "script_component.hpp" #include "script_component.hpp"
PREP(onGetIn); PREP(initDesignatorActions);
PREP(onGetOut);
PREP(laserHudDesignateOn); PREP(laserHudDesignateOn);
PREP(laserHudDesignateOff); PREP(laserHudDesignateOff);
PREP(unitTurretHasDesignator);
GVAR(laser) = nil; GVAR(laser) = nil;
GVAR(laserActive) = false; GVAR(laserActive) = false;
FUNC(getPosASL) = {visiblePositionASL (_this select 0)}; FUNC(getPosASL) = {visiblePositionASL (_this select 0)};

View File

@ -5,7 +5,7 @@ class CfgPatches {
units[] = {}; units[] = {};
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_main", "ace_laser"}; requiredAddons[] = {"ace_interaction", "ace_laser"};
version = VERSION; version = VERSION;
}; };
}; };

View File

@ -0,0 +1,56 @@
/*
* Author: esteldunedain
* Initializes the actions for turning on/off the laser for vehicles that have them
*
* Argument:
* 0: Vehicle <OBJECT>
*
* 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;
{
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;

View File

@ -1,15 +1,15 @@
#include "script_component.hpp" #include "script_component.hpp"
if(isNil QGVAR(laser)) exitWith { if(isNil QGVAR(laser)) exitWith {
false false
}; };
if(!local GVAR(laser)) then { if(!local GVAR(laser)) then {
false false
}; };
_handle = GVAR(laser) getVariable ["ACE_PFH_HANDLE", nil]; _handle = GVAR(laser) getVariable ["ACE_PFH_HANDLE", nil];
if(!isNil "_handle") then { if(!isNil "_handle") then {
[_handle] call cba_fnc_removePerFrameHandler; [_handle] call cba_fnc_removePerFrameHandler;
}; };
REM(ACE_LASERS, GVAR(laser)); REM(ACE_LASERS, GVAR(laser));

View File

@ -1,90 +1,112 @@
//#define DEBUG_MODE_FULL // #define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
TRACE_1("enter", _this); TRACE_1("enter", _this);
#define FCS_UPDATE_DELAY 2.0
FUNC(magnitude) = { FUNC(magnitude) = {
_this distance [0, 0, 0] _this distance [0, 0, 0]
}; };
FUNC(mat_normalize3d) = { FUNC(mat_normalize3d) = {
private ["_mag"]; private ["_mag"];
PARAMS_3(_vx,_vy,_vz); PARAMS_3(_vx,_vy,_vz);
_mag = _this call FUNC(magnitude); _mag = _this call FUNC(magnitude);
if (_mag == 0) then {_mag = 1}; if (_mag == 0) then {_mag = 1};
[(_vx/_mag), (_vy/_mag), (_vz/_mag)] [(_vx/_mag), (_vy/_mag), (_vz/_mag)]
}; };
FUNC(laserHudDesignatePFH) = { FUNC(laserHudDesignatePFH) = {
_args = _this select 0; private["_args", "_laserTarget", "_shooter", "_vehicle", "_weapon", "_gunnerInfo", "_turret", "_pov", "_gunBeg", "_gunEnd", "_povPos", "_povDir", "_result", "_resultPositions", "_firstResult", "_forceUpdateTime"];
_laserTarget = _args select 0; _args = _this select 0;
_shooter = _args select 1; _laserTarget = _args select 0;
_shooter = _args select 1;
_vehicle = vehicle _shooter;
_weapon = currentWeapon _vehicle; if( (count _args) < 3) then {
_args set[2, diag_tickTime + FCS_UPDATE_DELAY];
if(!alive _shooter || isNull _vehicle || isNull _laserTarget || !GVAR(laserActive) ) exitWith { };
[(_this select 1)] call cba_fnc_removePerFrameHandler; _forceUpdateTime = _args select 2;
};
_vehicle = vehicle _shooter;
// Retrieve the gunner and turret memory point information _weapon = currentWeapon _vehicle;
_gunnerInfo = [_vehicle, _weapon] call CBA_fnc_getFirer;
TRACE_1("", _args);
_turret = [_vehicle, _gunnerInfo select 1] call CBA_fnc_getTurret;
_pov = getText (_turret >> "memoryPointGunnerOptics"); if(!alive _shooter || isNull _vehicle || isNull _laserTarget || !GVAR(laserActive) ) exitWith {
_gunBeg = getText (_turret >> "gunBeg"); [] call FUNC(laserHudDesignateOff);
_gunEnd = getText (_turret >> "gunEnd"); };
TRACE_3("", _pov, _gunBeg, _gunEnd); 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 if((count _resultPositions) > 0) then {
_povPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _pov ) ); _firstResult = _resultPositions select 0;
_povDir = [0,0,0]; _pos = _firstResult select 0;
if(_pov == "pip0_pos") then {
_pipDir = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition "pip0_dir" ) ); // If the laser has moved less than a half meter, then dont move it.
_povDir = [_povPos, _pipDir] call BIS_fnc_vectorDiff; // Just regular use of lasers will commonly make them move this much,
} else { // but not across multiple close frames.
_gunBeginPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _gunBeg ) ); // This loses accuracy a little, but saves position updates per frame.
_gunEndPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _gunEnd ) ); TRACE_5("", diag_tickTime, _forceUpdateTime, getPosASL _laserTarget, _pos, ((getPosASL _laserTarget) distance _pos));
_povDir = [_gunEndPos, _gunBeginPos] call BIS_fnc_vectorDiff;
}; if(diag_tickTime > _forceUpdateTime) then {
TRACE_1("FCS Update", "");
TRACE_4("", _povDir, _povPos, _gunBeginPos, _gunEndPos); ["ace_fcs_forceUpdate", []] call ace_common_fnc_localEvent;
};
_result = [_povPos, _povDir] call EFUNC(laser,shootCone);
if( ((getPosASL _laserTarget) vectorDistance _pos) > 2) then {
if((count _result) > 0) then { TRACE_1("LaserPos Update", "");
_resultPositions = _result select 2; _laserTarget setPosATL (ASLToATL _pos);
if((count _resultPositions) > 0) then { };
_firstResult = _resultPositions select 0;
_pos = _firstResult select 0; if(diag_tickTime > _forceUpdateTime) then {
_args set[3, diag_tickTime + FCS_UPDATE_DELAY];
// 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);
//};
#ifdef DEBUG_MODE_FULL #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 #endif
}; };
}; };
_this set[0, _args];
}; };
private "_laserTarget";
private "_handle";
if(isNil QGVAR(laser)) then { if(isNil QGVAR(laser)) then {
_laserTarget = "LaserTarget" createVehicle (getpos player);
_laserTarget = "LaserTargetW" createVehicle (getpos player);
GVAR(laserActive) = true;
GVAR(laserActive) = true;
_handle = [FUNC(laserHudDesignatePFH), 0, [_laserTarget, player]] call cba_fnc_addPerFrameHandler;
_laserTarget setVariable ["ACE_PFH_HANDLE", _handle, false]; _handle = [FUNC(laserHudDesignatePFH), 0, [_laserTarget, player]] call cba_fnc_addPerFrameHandler;
_laserTarget setVariable ["ACE_PFH_HANDLE", _handle, false];
GVAR(laser) = _laserTarget;
GVAR(laser) = _laserTarget;
} else { } else {
[] call FUNC(laserHudDesignateOff); [] call FUNC(laserHudDesignateOff);
[] call FUNC(laserHudDesignateOn); [] call FUNC(laserHudDesignateOn);
}; };

View File

@ -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];

View File

@ -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];

View File

@ -0,0 +1,21 @@
/*
* Author: esteldunedain
* Checks if the turret occupied by the given unit has a laser designator
*
* Argument:
* 0: Unit <OBJECT>
*
* Return value:
* Has designator? <BOOL>
*/
#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

View File

@ -2,11 +2,11 @@
#include "\z\ace\Addons\main\script_mod.hpp" #include "\z\ace\Addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_LASER_SELFDESIGNATE #ifdef DEBUG_ENABLED_LASER_SELFDESIGNATE
#define DEBUG_MODE_FULL #define DEBUG_MODE_FULL
#endif #endif
#ifdef DEBUG_SETTINGS_LASER_SELFDESIGNATE #ifdef DEBUG_SETTINGS_LASER_SELFDESIGNATE
#define DEBUG_SETTINGS DEBUG_SETTINGS_LASER_SELFDESIGNATE #define DEBUG_SETTINGS DEBUG_SETTINGS_LASER_SELFDESIGNATE
#endif #endif
#include "\z\ace\Addons\main\script_macros.hpp" #include "\z\ace\Addons\main\script_macros.hpp"

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2015-04-03 -->
<Project name="ACE">
<Package name="Laser_SelfDesignate">
<Key ID="STR_ACE_Laser_SelfDesignate_DesignatorOn">
<English>Laser&lt;br/&gt;Designator On</English>
</Key>
<Key ID="STR_ACE_Laser_SelfDesignate_DesignatorOff">
<English>Laser&lt;br/&gt;Designator Off</English>
</Key>
</Package>
</Project>

View File

@ -3,7 +3,7 @@
EXPLODE_3_PVT(_this,_unit,_range,_isGreen); EXPLODE_3_PVT(_this,_unit,_range,_isGreen);
_p0Pos = _unit modelToWorld (_unit selectionPosition "righthand"); _p0Pos = _unit modelToWorldVisual (_unit selectionPosition "righthand");
// Convert _p0Pos to ASL // Convert _p0Pos to ASL
_p0 = + _p0Pos; _p0 = + _p0Pos;

View File

@ -265,7 +265,7 @@ class ACE_Medical_Actions {
condition = "((_this select 1) getvariable ['ACE_medical_inCardiacArrest', false])"; condition = "((_this select 1) getvariable ['ACE_medical_inCardiacArrest', false])";
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR)); callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR));
callbackFailure = ""; callbackFailure = "";
callbackProgress = "((_this select 1) getvariable ['ACE_medical_inCardiacArrest', false])"; callbackProgress = "(((_this select 0) select 1) getvariable ['ACE_medical_inCardiacArrest', false])";
animationPatient = ""; animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationCaller = "AinvPknlMstpSlayWnonDnon_medic"; animationCaller = "AinvPknlMstpSlayWnonDnon_medic";

View File

@ -16,13 +16,12 @@ class ACE_Settings {
}; };
class GVAR(enableOverdosing) { class GVAR(enableOverdosing) {
typeName = "BOOL"; typeName = "BOOL";
value = true; value = 1;
}; };
class GVAR(bleedingCoefficient) { class GVAR(bleedingCoefficient) {
typeName = "SCALAR"; typeName = "SCALAR";
value = 1; value = 1;
}; };
class GVAR(enableAirway) { class GVAR(enableAirway) {
typeName = "BOOL"; typeName = "BOOL";
value = false; value = false;
@ -37,11 +36,11 @@ class ACE_Settings {
}; };
class GVAR(enableVehicleCrashes) { class GVAR(enableVehicleCrashes) {
typeName = "BOOL"; typeName = "BOOL";
value = true; value = 1;
}; };
class GVAR(enableScreams) { class GVAR(enableScreams) {
typeName = "BOOL"; typeName = "BOOL";
value = true; value = 1;
}; };
class GVAR(playerDamageThreshold) { class GVAR(playerDamageThreshold) {
typeName = "SCALAR"; typeName = "SCALAR";
@ -58,7 +57,7 @@ class ACE_Settings {
}; };
class GVAR(preventInstaDeath) { class GVAR(preventInstaDeath) {
typeName = "BOOL"; typeName = "BOOL";
value = false; value = 0;
}; };
class GVAR(maxReviveTime) { class GVAR(maxReviveTime) {
typeName = "SCALAR"; typeName = "SCALAR";
@ -70,7 +69,7 @@ class ACE_Settings {
}; };
class GVAR(allowDeadBodyMovement) { class GVAR(allowDeadBodyMovement) {
typeName = "BOOL"; typeName = "BOOL";
value = false; value = 0;
}; };
class GVAR(allowLitterCreation) { class GVAR(allowLitterCreation) {
typeName = "BOOL"; typeName = "BOOL";
@ -83,17 +82,25 @@ class ACE_Settings {
class GVAR(medicSetting_PAK) { class GVAR(medicSetting_PAK) {
typeName = "SCALAR"; typeName = "SCALAR";
value = 1; value = 1;
values[] = {"Anyone", "Medics only", "Doctors only"};
}; };
class GVAR(medicSetting_SurgicalKit) { class GVAR(medicSetting_SurgicalKit) {
typeName = "SCALAR"; typeName = "SCALAR";
value = 1; value = 1;
values[] = {"Anyone", "Medics only", "Doctors only"};
}; };
class GVAR(consumeItem_PAK) { class GVAR(consumeItem_PAK) {
typeName = "SCALAR"; typeName = "SCALAR";
value = 0; value = 0;
values[] = {"No", "Yes"};
}; };
class GVAR(consumeItem_SurgicalKit) { class GVAR(consumeItem_SurgicalKit) {
typeName = "SCALAR"; typeName = "SCALAR";
value = 0; value = 0;
values[] = {"No", "Yes"};
};
class GVAR(keepLocalSettingsSynced) {
typeName = "BOOL";
value = 1;
}; };
}; };

View File

@ -128,6 +128,12 @@ class CfgVehicles {
typeName = "NUMBER"; typeName = "NUMBER";
defaultValue = 1; defaultValue = 1;
}; };
class keepLocalSettingsSynced {
displayName = "Sync status";
description = "Keep unit status synced. Recommended on.";
typeName = "BOOL";
defaultValue = 1;
};
}; };
class ModuleDescription { class ModuleDescription {
description = "Provides a medical system for both players and AI."; 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; scope = 2;
displayName = "Treatment Settings [ACE]"; displayName = "Treatment Settings [ACE]";
icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa));

View File

@ -10,14 +10,12 @@ class CfgWeapons {
type = 0; type = 0;
class ItemInfo: InventoryFirstAidKitItem_Base_F { class ItemInfo: InventoryFirstAidKitItem_Base_F {
mass = 4; mass = 4;
type = 201;
}; };
}; };
class Medikit: ItemCore { class Medikit: ItemCore {
type = 0; type = 0;
class ItemInfo: MedikitItem { class ItemInfo: MedikitItem {
mass = 60; mass = 60;
type = 201;
}; };
}; };
@ -31,11 +29,10 @@ class CfgWeapons {
descriptionShort = $STR_ACE_MEDICAL_BANDAGE_BASIC_DESC_SHORT; descriptionShort = $STR_ACE_MEDICAL_BANDAGE_BASIC_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_BANDAGE_BASIC_DESC_USE; descriptionUse = $STR_ACE_MEDICAL_BANDAGE_BASIC_DESC_USE;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass=1; mass = 1;
type=201;
}; };
}; };
class ACE_packingBandage: ItemCore { class ACE_packingBandage: ACE_ItemCore {
scope = 2; scope = 2;
value = 1; value = 1;
count = 1; count = 1;
@ -46,11 +43,10 @@ class CfgWeapons {
descriptionShort = $STR_ACE_MEDICAL_PACKING_BANDAGE_DESC_SHORT; descriptionShort = $STR_ACE_MEDICAL_PACKING_BANDAGE_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_PACKING_BANDAGE_DESC_USE; descriptionUse = $STR_ACE_MEDICAL_PACKING_BANDAGE_DESC_USE;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass=1; mass = 1;
type=201;
}; };
}; };
class ACE_elasticBandage: ItemCore { class ACE_elasticBandage: ACE_ItemCore {
scope = 2; scope = 2;
value = 1; value = 1;
count = 1; count = 1;
@ -61,11 +57,10 @@ class CfgWeapons {
descriptionShort = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DESC_SHORT; descriptionShort = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DESC_USE; descriptionUse = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DESC_USE;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass=1; mass = 1;
type=201;
}; };
}; };
class ACE_tourniquet: ItemCore { class ACE_tourniquet: ACE_ItemCore {
scope = 2; scope = 2;
value = 1; value = 1;
count = 1; count = 1;
@ -76,11 +71,10 @@ class CfgWeapons {
descriptionShort = $STR_ACE_MEDICAL_TOURNIQUET_DESC_SHORT; descriptionShort = $STR_ACE_MEDICAL_TOURNIQUET_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_TOURNIQUET_DESC_USE; descriptionUse = $STR_ACE_MEDICAL_TOURNIQUET_DESC_USE;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass=1; mass = 1;
type=201;
}; };
}; };
class ACE_morphine: ItemCore { class ACE_morphine: ACE_ItemCore {
scope = 2; scope = 2;
value = 1; value = 1;
count = 1; count = 1;
@ -91,11 +85,10 @@ class CfgWeapons {
descriptionShort = $STR_ACE_MEDICAL_MORPHINE_DESC_SHORT; descriptionShort = $STR_ACE_MEDICAL_MORPHINE_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_MORPHINE_DESC_USE; descriptionUse = $STR_ACE_MEDICAL_MORPHINE_DESC_USE;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass=1; mass = 1;
type=201;
}; };
}; };
class ACE_atropine: ItemCore { class ACE_atropine: ACE_ItemCore {
scope = 2; scope = 2;
value = 1; value = 1;
count = 1; count = 1;
@ -106,11 +99,11 @@ class CfgWeapons {
descriptionShort = $STR_ACE_MEDICAL_ATROPINE_DESC_SHORT; descriptionShort = $STR_ACE_MEDICAL_ATROPINE_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_ATROPINE_DESC_USE; descriptionUse = $STR_ACE_MEDICAL_ATROPINE_DESC_USE;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass=1; mass = 1;
type=201;
}; };
}; };
class ACE_epinephrine: ItemCore { class ACE_epinephrine: ACE_ItemCore {
scope = 2; scope = 2;
value = 1; value = 1;
count = 1; count = 1;
@ -121,11 +114,10 @@ class CfgWeapons {
descriptionShort = $STR_ACE_MEDICAL_EPINEPHRINE_DESC_SHORT; descriptionShort = $STR_ACE_MEDICAL_EPINEPHRINE_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_EPINEPHRINE_DESC_USE; descriptionUse = $STR_ACE_MEDICAL_EPINEPHRINE_DESC_USE;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass=1; mass = 1;
type=201;
}; };
}; };
class ACE_plasmaIV: ItemCore { class ACE_plasmaIV: ACE_ItemCore {
scope = 2; scope = 2;
value = 1; value = 1;
count = 1; count = 1;
@ -135,24 +127,21 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_PLASMA_IV_DESC_USE; descriptionUse = $STR_ACE_MEDICAL_PLASMA_IV_DESC_USE;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 10; mass = 10;
type = 201;
}; };
}; };
class ACE_plasmaIV_500: ACE_plasmaIV { class ACE_plasmaIV_500: ACE_plasmaIV {
displayName = $STR_ACE_MEDICAL_PLASMA_IV_500; displayName = $STR_ACE_MEDICAL_PLASMA_IV_500;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 5; mass = 5;
type = 201;
}; };
}; };
class ACE_plasmaIV_250: ACE_plasmaIV { class ACE_plasmaIV_250: ACE_plasmaIV {
displayName = $STR_ACE_MEDICAL_PLASMA_IV_250; displayName = $STR_ACE_MEDICAL_PLASMA_IV_250;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 2.5; mass = 2.5;
type = 201;
}; };
}; };
class ACE_bloodIV: ItemCore { class ACE_bloodIV: ACE_ItemCore {
scope = 2; scope = 2;
value = 1; value = 1;
count = 1; count = 1;
@ -163,24 +152,21 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_BLOOD_IV_DESC_USE; descriptionUse = $STR_ACE_MEDICAL_BLOOD_IV_DESC_USE;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 10; mass = 10;
type = 201;
}; };
}; };
class ACE_bloodIV_500: ACE_bloodIV { class ACE_bloodIV_500: ACE_bloodIV {
displayName = $STR_ACE_MEDICAL_BLOOD_IV_500; displayName = $STR_ACE_MEDICAL_BLOOD_IV_500;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 5; mass = 5;
type = 201;
}; };
}; };
class ACE_bloodIV_250: ACE_bloodIV { class ACE_bloodIV_250: ACE_bloodIV {
displayName = $STR_ACE_MEDICAL_BLOOD_IV_250; displayName = $STR_ACE_MEDICAL_BLOOD_IV_250;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 2.5; mass = 2.5;
type = 201;
}; };
}; };
class ACE_salineIV: ItemCore { class ACE_salineIV: ACE_ItemCore {
scope = 2; scope = 2;
value = 1; value = 1;
count = 1; count = 1;
@ -190,24 +176,21 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_SALINE_IV_DESC_USE; descriptionUse = $STR_ACE_MEDICAL_SALINE_IV_DESC_USE;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 10; mass = 10;
type = 201;
}; };
}; };
class ACE_salineIV_500: ACE_salineIV { class ACE_salineIV_500: ACE_salineIV {
displayName = $STR_ACE_MEDICAL_SALINE_IV_500; displayName = $STR_ACE_MEDICAL_SALINE_IV_500;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 2.5; mass = 2.5;
type = 201;
}; };
}; };
class ACE_salineIV_250: ACE_salineIV { class ACE_salineIV_250: ACE_salineIV {
displayName = $STR_ACE_MEDICAL_SALINE_IV_250; displayName = $STR_ACE_MEDICAL_SALINE_IV_250;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 2.5; mass = 2.5;
type = 201;
}; };
}; };
class ACE_quikclot: ItemCore { class ACE_quikclot: ACE_ItemCore {
scope = 2; scope = 2;
value = 1; value = 1;
count = 1; count = 1;
@ -218,25 +201,22 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_QUIKCLOT_DESC_USE; descriptionUse = $STR_ACE_MEDICAL_QUIKCLOT_DESC_USE;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 1; mass = 1;
type = 201;
}; };
}; };
class ACE_personalAidKit: ItemCore { class ACE_personalAidKit: ACE_ItemCore {
scope = 2; scope = 2;
value = 1; value = 1;
count = 1; count = 1;
type = 16; type = 16;
displayName = $STR_ACE_MEDICAL_AID_KIT_DISPLAY; displayName = $STR_ACE_MEDICAL_AID_KIT_DISPLAY;
picture = QUOTE(PATHTOF(ui\items\personal_aid_kit.paa)); 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; descriptionShort = $STR_ACE_MEDICAL_AID_KIT_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_AID_KIT_DESC_USE; descriptionUse = $STR_ACE_MEDICAL_AID_KIT_DESC_USE;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 2; mass = 2;
type = 201;
}; };
}; };
class ACE_surgicalKit: ItemCore { class ACE_surgicalKit: ACE_ItemCore {
scope=2; scope=2;
displayName= $STR_ACE_MEDICAL_SURGICALKIT_DISPLAY; displayName= $STR_ACE_MEDICAL_SURGICALKIT_DISPLAY;
model = QUOTE(PATHTOF(data\surgical_kit.p3d)); model = QUOTE(PATHTOF(data\surgical_kit.p3d));
@ -245,10 +225,9 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_SURGICALKIT_DESC_USE; descriptionUse = $STR_ACE_MEDICAL_SURGICALKIT_DESC_USE;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 5; mass = 5;
type = 201;
}; };
}; };
class ACE_bodyBag: ItemCore { class ACE_bodyBag: ACE_ItemCore {
scope=2; scope=2;
displayName= $STR_ACE_MEDICAL_BODYBAG_DISPLAY; displayName= $STR_ACE_MEDICAL_BODYBAG_DISPLAY;
model = QUOTE(PATHTOF(data\bodybagItem.p3d)); model = QUOTE(PATHTOF(data\bodybagItem.p3d));
@ -257,7 +236,6 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_BODYBAG_DESC_USE; descriptionUse = $STR_ACE_MEDICAL_BODYBAG_DESC_USE;
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 15; mass = 15;
type = 201;
}; };
}; };
}; };

View File

@ -45,6 +45,7 @@ PREP(handleDamage_wounds);
PREP(handleUnitVitals); PREP(handleUnitVitals);
PREP(handleKilled); PREP(handleKilled);
PREP(handleLocal); PREP(handleLocal);
PREP(handleBandageOpening);
PREP(hasItem); PREP(hasItem);
PREP(hasItems); PREP(hasItems);
PREP(hasMedicalEnabled); PREP(hasMedicalEnabled);

View File

@ -22,18 +22,18 @@ if !([_caller, "ACE_itemBodyBag"] call EFUNC(common,hasItem)) exitwith {};
[_caller, "ACE_itemBodyBag"] call EFUNC(common,useItem); [_caller, "ACE_itemBodyBag"] call EFUNC(common,useItem);
_nameOfUnit = [_unit] call EFUNC(common,getName); _nameOfUnit = [_target] call EFUNC(common,getName);
if (alive _unit) then { if (alive _target) then {
// force kill the unit. // force kill the unit.
[_unit, true] call FUNC(setDead); [_target, true] call FUNC(setDead);
}; };
_onPosition = getPos _unit; _onPosition = getPos _target;
deleteVehicle _unit; deleteVehicle _target;
_bodyBagCreated = createVehicle ["ACE_bodyBag", _onPosition, [], 0, "NONE"]; _bodyBagCreated = createVehicle ["ACE_bodyBag", _onPosition, [], 0, "NONE"];
// reset the position to ensure it is on the correct one. // reset the position to ensure it is on the correct one.
_bodyBagCreated setPos _onPosition; _bodyBagCreated setPos _onPosition;
// TODO Does this need to be something with QUOTE(DEFUNC)? // 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], QUOTE(DEFUNC(common,revealObject)), true] call call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
_bodyBagCreated; _bodyBagCreated;

View File

@ -24,6 +24,7 @@ _className = _this select 3;
_usersOfItems = _this select 5; _usersOfItems = _this select 5;
if !(GVAR(allowLitterCreation)) exitwith {}; if !(GVAR(allowLitterCreation)) exitwith {};
if (vehicle _caller != _caller || vehicle _target != _target) exitwith {};
_config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className); _config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className);
if (GVAR(level) >= 2) then { if (GVAR(level) >= 2) then {

View File

@ -61,6 +61,18 @@ if (_show) then {
_genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_PAIN", [1, 1, 1, 1]]; _genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_PAIN", [1, 1, 1, 1]];
}; };
_totalIvVolume = 0;
{
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]; _selectionBloodLoss = [0,0,0,0,0,0];
if (GVAR(level) >= 2) then { if (GVAR(level) >= 2) then {
_openWounds = _target getvariable [QGVAR(openWounds), []]; _openWounds = _target getvariable [QGVAR(openWounds), []];
@ -74,24 +86,45 @@ if (_show) then {
if (_amountOf > 0) then { if (_amountOf > 0) then {
if (_amountOf >= 1) then { if (_amountOf >= 1) then {
// TODO localization // 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 { } else {
// TODO localization // 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; }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 { } else {
{ {
_selectionBloodLoss set [_forEachIndex, _target getHitPointDamage _x]; _selectionBloodLoss set [_forEachIndex, _target getHitPointDamage _x];
if (_target getHitPointDamage _x > 0.1) then { if (_target getHitPointDamage _x > 0.1) then {
// @todo localize // @todo localize
_allInjuryTexts pushBack format ["%1 %2", _allInjuryTexts pushBack [format ["%1 %2",
["Lightly wounded", "Heavily wounded"] select (_target getHitPointDamage _x > 0.5), ["Lightly wounded", "Heavily wounded"] select (_target getHitPointDamage _x > 0.5),
["head", "torso", "left arm", "right arm", "left leg", "right leg"] select _forEachIndex ["head", "torso", "left arm", "right arm", "left leg", "right leg"] select _forEachIndex
]; ], [1,1,1,1]];
}; };
} forEach ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; } forEach ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"];
}; };
@ -125,7 +158,8 @@ if (_show) then {
_lbCtrl lbSetColor [_foreachIndex, _x select 1]; _lbCtrl lbSetColor [_foreachIndex, _x select 1];
}foreach _genericMessages; }foreach _genericMessages;
{ {
_lbCtrl lbAdd _x; _lbCtrl lbAdd (_x select 0);
_lbCtrl lbSetColor [_foreachIndex, _x select 1];
}foreach _allInjuryTexts; }foreach _allInjuryTexts;
if (count _allInjuryTexts == 0) then { if (count _allInjuryTexts == 0) then {
_lbCtrl lbAdd "No injuries on this bodypart.."; _lbCtrl lbAdd "No injuries on this bodypart..";

View File

@ -43,28 +43,27 @@ if (_show) then {
_lbCtrl = (_display displayCtrl 200); _lbCtrl = (_display displayCtrl 200);
lbClear _lbCtrl; lbClear _lbCtrl;
_log = _target getvariable ["myVariableTESTKOEAKJR", []]; _log = _target getvariable [QGVAR(triageCard), []];
{ {
// [_message,_moment,_type, _arguments] _item = _x select 0;
_message = _x select 0; _amount = _x select 1;
_moment = _x select 1; _message = _item;
_arguments = _x select 3; if (isClass(configFile >> "CfgWeapons" >> _item)) then {
if (isLocalized _message) then { _message = getText(configFile >> "CfgWeapons" >> _item >> "DisplayName");
_message = localize _message; } else {
}; if (isLocalized _message) then {
_message = localize _message;
{
if (typeName _x == "STRING" && {isLocalized _x}) then {
_arguments set [_foreachIndex, localize _x];
}; };
}foreach _arguments; };
_message = format([_message] + _arguments); _triageCardTexts pushback format["%1x - %2", _amount, _message];
_lbCtrl lbAdd format["%1 %2", _moment, _message];
}foreach _log; }foreach _log;
if (count _triageCardTexts == 0) then { if (count _triageCardTexts == 0) then {
_lbCtrl lbAdd "No entries on this triage card.."; _lbCtrl lbAdd "No entries on this triage card..";
}; };
{
_lbCtrl lbAdd _x;
}foreach _triageCardTexts;
_triageStatus = [_target] call FUNC(getTriageStatus); _triageStatus = [_target] call FUNC(getTriageStatus);
(_display displayCtrl 2000) ctrlSetText (_triageStatus select 0); (_display displayCtrl 2000) ctrlSetText (_triageStatus select 0);

View File

@ -13,6 +13,8 @@
#include "script_component.hpp" #include "script_component.hpp"
#define BLOODLOSSRATE_BASIC 0.4
private ["_totalBloodLoss","_tourniquets","_openWounds", "_value", "_cardiacOutput", "_internalWounds"]; private ["_totalBloodLoss","_tourniquets","_openWounds", "_value", "_cardiacOutput", "_internalWounds"];
// TODO Only use this calculation if medium or higher, otherwise use vanilla calculations (for basic medical). // TODO Only use this calculation if medium or higher, otherwise use vanilla calculations (for basic medical).
_totalBloodLoss = 0; _totalBloodLoss = 0;
@ -40,6 +42,6 @@ if (GVAR(level) >= 2) then {
// cap the blood loss to be no greater as the current cardiac output // cap the blood loss to be no greater as the current cardiac output
//(_totalBloodLoss min _cardiacOutput); //(_totalBloodLoss min _cardiacOutput);
} else { } else {
// TODO basic medical _totalBloodLoss = BLOODLOSSRATE_BASIC * (damage _this);
}; };
_totalBloodLoss * (GVAR(bleedingCoefficient) max 0); _totalBloodLoss * (GVAR(bleedingCoefficient) max 0);

View File

@ -44,6 +44,12 @@ if (_bloodVolume < 100.0) then {
_unit setvariable [_x,_ivVolume]; _unit setvariable [_x,_ivVolume];
}; };
}foreach GVAR(IVBags); }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; _bloodVolumeChange;

View File

@ -0,0 +1,118 @@
/*
* Author: Glowbal
* Handles the bandage of a patient.
*
* Arguments:
* 0: The target <OBJECT>
* 1: The impact <NUMBER>
* 2: Selection part number <NUMBER>
* 3: Injury index <NUMBER>
* 4: Injury <ARRAY>
* 5: Used Bandage type <STRING>
*
* 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);
};

View File

@ -22,7 +22,7 @@ _unit setVariable [QGVAR(lastMomentVitalsHandled), time];
if (_interval == 0) exitWith {}; if (_interval == 0) exitWith {};
_lastTimeValuesSynced = _unit getvariable [QGVAR(lastMomentValuesSynced), 0]; _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 { if (_syncValues) then {
_unit setvariable [QGVAR(lastMomentValuesSynced), time]; _unit setvariable [QGVAR(lastMomentValuesSynced), time];
}; };
@ -167,4 +167,15 @@ if (GVAR(level) >= 2) then {
[_unit] call FUNC(setCardiacArrest); [_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);
};
}; };

View File

@ -26,6 +26,7 @@ _unit setvariable [QGVAR(tourniquets), [0,0,0,0,0,0], true];
// wounds and injuries // wounds and injuries
_unit setvariable [QGVAR(openWounds), [], true]; _unit setvariable [QGVAR(openWounds), [], true];
_unit setvariable [QGVAR(bandagedWounds), [], true];
_unit setVariable [QGVAR(internalWounds), [], true]; _unit setVariable [QGVAR(internalWounds), [], true];
// vitals // vitals

View File

@ -37,7 +37,7 @@ _medicalFacility =
"USMC_WarfareBFieldhHospital" "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 { if (((typeOf _x) in _medicalFacility) || (_x getVariable [QGVAR(isMedicalFacility),false])) exitwith {
_isInBuilding = true; _isInBuilding = true;

View File

@ -34,3 +34,4 @@ if !(_activated) exitWith {};
[_logic, QGVAR(enableUnsconsiousnessAI), "enableUnsconsiousnessAI"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(enableUnsconsiousnessAI), "enableUnsconsiousnessAI"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(preventInstaDeath), "preventInstaDeath"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(preventInstaDeath), "preventInstaDeath"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(bleedingCoefficient), "bleedingCoefficient"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(bleedingCoefficient), "bleedingCoefficient"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(keepLocalSettingsSynced), "keepLocalSettingsSynced"] call EFUNC(common,readSettingFromModule);

View File

@ -26,7 +26,6 @@ _unit setvariable [QGVAR(heartRate), 0];
[_unit, true] call FUNC(setUnconscious); [_unit, true] call FUNC(setUnconscious);
_timeInCardiacArrest = 120 + round(random(600)); _timeInCardiacArrest = 120 + round(random(600));
systemChat format["Unit went cardiac arrest; hr: %1", _unit getvariable [QGVAR(heartRate), -1]];
[{ [{
private ["_args","_unit","_startTime","_timeInCardiacArrest","_heartRate"]; private ["_args","_unit","_startTime","_timeInCardiacArrest","_heartRate"];
_args = _this select 0; _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]; _heartRate = _unit getvariable [QGVAR(heartRate), 0];
if (_heartRate > 0 || !alive _unit) exitwith { 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; [(_this select 1)] call cba_fnc_removePerFrameHandler;
_unit setvariable [QGVAR(inCardiacArrest), nil,true]; _unit setvariable [QGVAR(inCardiacArrest), nil,true];
}; };

View File

@ -10,7 +10,7 @@
* Return Value: * Return Value:
* Succesful treatment started <BOOL> * Succesful treatment started <BOOL>
* *
* Public: Yes * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
@ -82,18 +82,17 @@ if (_effectivenessFound == -1) exitwith {}; // Seems everything is patched up on
// TODO refactor this part // TODO refactor this part
// Find the impact this bandage has and reduce the amount this injury is present // 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) }; _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]; _openWounds set [_mostEffectiveSpot, _mostEffectiveInjury];
_target setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; _target setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC];
if (USE_WOUND_EVENT_SYNC) then { 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 // Handle the reopening of bandaged wounds
if (_impact > 0) then { if (_impact > 0 && {GVAR(enableAdvancedWounds)}) then {
// TODO handle reopening of bandaged wounds [_target, _impact, _part, _mostEffectiveSpot, _mostEffectiveInjury, _bandage] call FUNC(handleBandageOpening);
// [_target, _impact, _part,_highestSpot, _removeItem] 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. // 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.

View File

@ -25,6 +25,7 @@ if (alive _target) exitwith {
// wounds and injuries // wounds and injuries
_target setvariable [QGVAR(openWounds), [], true]; _target setvariable [QGVAR(openWounds), [], true];
_target setvariable [QGVAR(bandagedWounds), [], true];
_target setVariable [QGVAR(internalWounds), [], true]; _target setVariable [QGVAR(internalWounds), [], true];
// vitals // vitals

View File

@ -19,6 +19,9 @@ private ["_target", "_ivItem", "_config", "_volumeAdded", "_typeOf", "_varName"]
_target = _this select 0; _target = _this select 0;
_ivItem = _this select 1; _ivItem = _this select 1;
_bloodVolume = _target getvariable [QGVAR(bloodVolume), 100];
if (_bloodVolume >= 100) exitwith {};
// Find the proper attributes for the used IV // Find the proper attributes for the used IV
_config = (configFile >> "ACE_Medical_Advanced" >> "Treatment" >> "IV"); _config = (configFile >> "ACE_Medical_Advanced" >> "Treatment" >> "IV");
_volumeAdded = getNumber (_config >> "volume"); _volumeAdded = getNumber (_config >> "volume");
@ -31,7 +34,7 @@ if (isClass (_config >> _className)) then {
}; };
_varName = format["ACE_Medical_IVVolume_%1",_typeOf]; _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 { if !(_varName in GVAR(IVBags)) then {
GVAR(IVBags) pushback _varName; GVAR(IVBags) pushback _varName;

View File

@ -336,6 +336,9 @@
<French>Garot [CAT]</French> <French>Garot [CAT]</French>
<Polish>Opaska uciskowa [CAT]</Polish> <Polish>Opaska uciskowa [CAT]</Polish>
</Key> </Key>
<Key ID="STR_ACE_MEDICAL_receivingIvVolume">
<English>Receiving IV [%1ml]</English>
</Key>
</Container> </Container>
<Container name="CfgWeapons"> <Container name="CfgWeapons">
<Key ID="STR_ACE_MEDICAL_BANDAGE_BASIC_DISPLAY"> <Key ID="STR_ACE_MEDICAL_BANDAGE_BASIC_DISPLAY">

View File

@ -1,10 +1,10 @@
class CfgAmmo { class CfgAmmo {
class MissileBase; class MissileBase;
class M_PG_AT : MissileBase { class M_PG_AT : MissileBase {
irLock = 0; irLock = 0;
laserLock = 0; laserLock = 0;
airLock = 0; airLock = 0;
manualControl = 0; manualControl = 0;
}; };
}; };

View File

@ -1,17 +1,17 @@
class Extended_PreInit_EventHandlers { class Extended_PreInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_pre_init)); init = QUOTE(call COMPILE_FILE(XEH_pre_init));
}; };
}; };
class Extended_PostInit_EventHandlers { class Extended_PostInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_post_init)); init = QUOTE(call COMPILE_FILE(XEH_post_init));
}; };
}; };
class Extended_FiredBIS_EventHandlers { class Extended_FiredBIS_EventHandlers {
class AllVehicles { class AllVehicles {
ADDON = QUOTE(_this call FUNC(fired)); ADDON = QUOTE(_this call FUNC(fired));
}; };
}; };

View File

@ -1,34 +1,34 @@
class Mode_SemiAuto; class Mode_SemiAuto;
class CfgWeapons { class CfgWeapons {
class CannonCore; class CannonCore;
class LauncherCore; class LauncherCore;
class RocketPods: LauncherCore { class RocketPods: LauncherCore {
canLock = 1; canLock = 1;
}; };
class missiles_DAGR: RocketPods { class missiles_DAGR: RocketPods {
canLock = 1; canLock = 1;
}; };
/* /*
class autocannon_Base_F: CannonCore { class autocannon_Base_F: CannonCore {
canLock = 1; canLock = 1;
}; };
class cannon_120mm: CannonCore { class cannon_120mm: CannonCore {
canLock = 1; canLock = 1;
class player : Mode_SemiAuto { class player : Mode_SemiAuto {
canLock = 1; canLock = 1;
}; };
}; };
class gatling_25mm: CannonCore { class gatling_25mm: CannonCore {
canLock = 1; canLock = 1;
}; };
class autocannon_35mm: CannonCore { class autocannon_35mm: CannonCore {
canLock = 1; canLock = 1;
}; };
class launch_NLAW_F: Launcher_Base_F class launch_NLAW_F: Launcher_Base_F
{ {
canLock = 1; canLock = 1;
};*/ };*/
}; };

View File

@ -1,13 +1,13 @@
#include "script_component.hpp" #include "script_component.hpp"
class CfgPatches { class CfgPatches {
class ADDON { class ADDON {
units[] = {}; units[] = {};
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = { "ace_common", "ace_laser" }; requiredAddons[] = { "ace_common", "ace_laser" };
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };
#include "CfgEventhandlers.hpp" #include "CfgEventhandlers.hpp"

View File

@ -7,12 +7,12 @@ PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
if(!local _shooter) exitWith { false }; if(!local _shooter) exitWith { false };
switch _weapon do { switch _weapon do {
case "missiles_DAGR": { case "missiles_DAGR": {
_this call FUNC(guidance_DAGR); _this call FUNC(guidance_DAGR);
}; };
case "GBU12BombLauncher": { case "GBU12BombLauncher": {
_this call FUNC(guidance_LGB); _this call FUNC(guidance_LGB);
}; };
}; };
//_this call FUNC(guidance_HellfireII); //_this call FUNC(guidance_HellfireII);

View File

@ -2,112 +2,119 @@
#include "script_component.hpp" #include "script_component.hpp"
FUNC(guidance_DIRECT_LOAL_PFH) = { FUNC(guidance_DIRECT_LOAL_PFH) = {
//TRACE_1("enter", _this); //TRACE_1("enter", _this);
_args = _this select 0; private["_args", "_shooter", "_dagr", "_curVelocity", "_targets", "_target", "_yVec", "_xVec", "_zVec", "_dagrPos", "_shooterPos", "_distanceToTarget", "_distanceToShooter", "_def"];
//PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); _args = _this select 0;
_shooter = _args select 0; //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
_dagr = _args select 6; _shooter = _args select 0;
_curVelocity = velocity _dagr; _dagr = _args select 6;
_curVelocity = velocity _dagr;
if(!alive _dagr || isNull _dagr || isNull _shooter) exitWith {
[(_this select 1)] call cba_fnc_removePerFrameHandler; 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); _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; 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,"","",""]; // 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; _yVec = vectorDir _dagr;
_xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); _zVec = vectorUp _dagr;
_xVec = vectorNormalized (_yVec vectorCrossProduct _zVec);
_dagrPos = getPosASL _dagr;
// player sideChat "G!"; _dagrPos = getPosASL _dagr;
_targetPos = getPosASL _target; // player sideChat "G!";
if((count _targetPos) > 0) then { _targetPos = getPosASL _target;
_distanceToTarget = _dagrPos vectorDistance _targetPos; _shooterPos = getPosASL _shooter;
_addHeight = [0,0,(_dagrPos distance _targetPos)*0.02]; if((count _targetPos) > 0) then {
#ifdef DEBUG_MODE_FULL _distanceToTarget = _dagrPos vectorDistance _targetPos;
drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]]; _distanceToShooter = _dagrPos vectorDistance _shooterPos;
#endif
_addHeight = [0,0,(_dagrPos distance _targetPos)*0.02];
_targetPos = _targetPos vectorAdd _addHeight; #ifdef DEBUG_MODE_FULL
drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]];
#endif
_targetPos = _targetPos vectorAdd _addHeight;
_def = 0.0050; _def = 0.0040;
if(_distanceToShooter > 100) then {
_targetVectorSeeker = [_dagr, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); _def = 0.0025;
// _targetVectorSeeker = _dagr worldToModel (ASLtoATL _targetPos); };
// _targetVectorSeeker = [0,0,0] vectorFromTo _targetVectorSeeker;
_yaw = 0.0; _targetVectorSeeker = [_dagr, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace);
if((_targetVectorSeeker select 0) < 0) then { // _targetVectorSeeker = _dagr worldToModel (ASLtoATL _targetPos);
_yaw = -_def; // _targetVectorSeeker = [0,0,0] vectorFromTo _targetVectorSeeker;
} else { _yaw = 0.0;
if((_targetVectorSeeker select 0) > 0) then { if((_targetVectorSeeker select 0) < 0) then {
_yaw = _def; _yaw = -_def;
}; } else {
}; if((_targetVectorSeeker select 0) > 0) then {
_yaw = _def;
_pitch = 0.0; };
if((_targetVectorSeeker select 2) < 0) then { };
_pitch = -_def;
} else { _pitch = 0.0;
if((_targetVectorSeeker select 2) > 0) then { if((_targetVectorSeeker select 2) < 0) then {
_pitch = _def; _pitch = -_def;
}; } else {
}; if((_targetVectorSeeker select 2) > 0) then {
#ifdef DEBUG_MODE_FULL _pitch = _def;
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]]; };
#ifdef DEBUG_MODE_FULL
_distance = ([getPos startPos, _dagrPos] call BIS_fnc_distance2D); 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"];
_marker = createMarkerLocal [format["m%1", MARKERCOUNT], [_distance, _dagrPos select 2]]; drawLine3D [ASLtoATL _dagrPos, ASLtoATL _targetPos, [1,0,0,1]];
_marker setMarkerTypeLocal "mil_dot";
_marker setMarkerColorLocal "ColorRed"; _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; MARKERCOUNT = MARKERCOUNT + 1;
#endif #endif
if(accTime > 0) then { if(accTime > 0) then {
_outVector = [_dagr, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); _outVector = [_dagr, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace);
// _outVector = _dagr modelToWorld [_yaw, 1, _pitch]; // _outVector = _dagr modelToWorldVisual [_yaw, 1, _pitch];
// _outVector = ATLtoASL _outVector; // _outVector = ATLtoASL _outVector;
_vectorTo = _dagrPos vectorFromTo _outVector; _vectorTo = _dagrPos vectorFromTo _outVector;
// hintSilent format["v: %1", _vectorTo]; // hintSilent format["v: %1", _vectorTo];
// _dagr setVectorDir _vectorTo; // _dagr setVectorDir _vectorTo;
_dagr setVectorDirAndUp [_vectorTo, vectorUp _dagr]; _dagr setVectorDirAndUp [_vectorTo, vectorUp _dagr];
}; };
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL
hintSilent format["d: %1", _distanceToTarget]; hintSilent format["d: %1", _distanceToTarget];
#endif #endif
}; };
}; };
}; };
FUNC(guidance_DAGR_DIRECT_LOAL) = { FUNC(guidance_DAGR_DIRECT_LOAL) = {
PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
GVAR(lastTime) = time; GVAR(lastTime) = time;
[FUNC(guidance_DIRECT_LOAL_PFH), 0, _this] call cba_fnc_addPerFrameHandler; [FUNC(guidance_DIRECT_LOAL_PFH), 0, _this] call cba_fnc_addPerFrameHandler;
}; };
PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
_fireMode = _shooter getVariable ["ACE_FIRE_SELECTION", ACE_DEFAULT_FIRE_SELECTION]; _fireMode = _shooter getVariable ["ACE_FIRE_SELECTION", ACE_DEFAULT_FIRE_SELECTION];
switch (_fireMode select 0) do { switch (_fireMode select 0) do {
// Default to FIREMODE_DIRECT_LOAL // Default to FIREMODE_DIRECT_LOAL
// FIREMODE_DIRECT_LOAL // FIREMODE_DIRECT_LOAL
default { default {
LOG("Initiating DAGR FIREMODE_DIRECT_LOAL"); LOG("Initiating DAGR FIREMODE_DIRECT_LOAL");
_this call FUNC(guidance_DAGR_DIRECT_LOAL); _this call FUNC(guidance_DAGR_DIRECT_LOAL);
}; };
}; };

View File

@ -2,248 +2,248 @@
#include "script_component.hpp" #include "script_component.hpp"
FUNC(guidance_Hellfire_LOAL_HI_PFH) = { FUNC(guidance_Hellfire_LOAL_HI_PFH) = {
//TRACE_1("enter", _this); //TRACE_1("enter", _this);
_args = _this select 0; _args = _this select 0;
//PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
_shooter = _args select 0; _shooter = _args select 0;
_missile = _args select 6; _missile = _args select 6;
_curVelocity = velocity _missile; _curVelocity = velocity _missile;
if(!alive _missile || isNull _missile || isNull _shooter) exitWith { if(!alive _missile || isNull _missile || isNull _shooter) exitWith {
[(_this select 1)] call cba_fnc_removePerFrameHandler; [(_this select 1)] call cba_fnc_removePerFrameHandler;
}; };
_launchPos = _shooter getVariable [QGVAR(launchPos), nil]; _launchPos = _shooter getVariable [QGVAR(launchPos), nil];
if(isNil "_launchPos") then { if(isNil "_launchPos") then {
TRACE_1("Setting launch parameters", ""); TRACE_1("Setting launch parameters", "");
_launchPos = getPosASL _shooter; _launchPos = getPosASL _shooter;
_shooter setVariable [QGVAR(launchPos), _launchPos, false]; _shooter setVariable [QGVAR(launchPos), _launchPos, false];
_shooter setVariable [QGVAR(launchTime), diag_tickTime, false]; _shooter setVariable [QGVAR(launchTime), diag_tickTime, false];
}; };
_targets = [_missile, ACE_DEFAULT_LASER_CODE, 70, _curVelocity] call ace_laser_fnc_findLaserDesignator; _targets = [_missile, ACE_DEFAULT_LASER_CODE, 70, _curVelocity] call ace_laser_fnc_findLaserDesignator;
_addHeight = [0,0,0]; _addHeight = [0,0,0];
if((_targets select 0)) then { if((_targets select 0)) then {
_target = _targets select 1; _target = _targets select 1;
TRACE_2("Targets", _target, _targets); TRACE_2("Targets", _target, _targets);
_yVec = vectorDir _missile; _yVec = vectorDir _missile;
_zVec = vectorUp _missile; _zVec = vectorUp _missile;
_xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec);
_missilePos = getPosASL _missile; _missilePos = getPosASL _missile;
// player sideChat "G!"; // player sideChat "G!";
_targetPos = getPosASL _target; _targetPos = getPosASL _target;
TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos)); TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos));
if((count _targetPos) > 0) then { if((count _targetPos) > 0) then {
_distanceToTarget = _missilePos vectorDistance _targetPos; _distanceToTarget = _missilePos vectorDistance _targetPos;
_defPitch = 0.05; _defPitch = 0.05;
if((_launchPos distance _missilePos) < 400 && (_targetPos distance _missilePos) > 400) then { if((_launchPos distance _missilePos) < 400 && (_targetPos distance _missilePos) > 400) then {
_addHeight = [0,0,(_targetPos select 2) + ((_launchPos distance _targetPos)*2)]; _addHeight = [0,0,(_targetPos select 2) + ((_launchPos distance _targetPos)*2)];
TRACE_1("Climb phase", _addHeight); TRACE_1("Climb phase", _addHeight);
//_defPitch = 0.1; //_defPitch = 0.1;
} else { } else {
// Covered half the distance, go terminal // Covered half the distance, go terminal
if((_missilePos distance _targetPos) < (_launchPos distance _targetPos) / 2) then { if((_missilePos distance _targetPos) < (_launchPos distance _targetPos) / 2) then {
TRACE_1("TERMINAL", ""); TRACE_1("TERMINAL", "");
} else { } else {
if((_missilePos select 2) > (_targetPos select 2)) then { if((_missilePos select 2) > (_targetPos select 2)) then {
_heightDiff = (_missilePos select 2) - (_targetPos select 2); _heightDiff = (_missilePos select 2) - (_targetPos select 2);
TRACE_1("Coasting", _heightDiff); TRACE_1("Coasting", _heightDiff);
_addHeight = [0,0, _heightDiff]; _addHeight = [0,0, _heightDiff];
}; };
}; };
}; };
_targetPos = _targetPos vectorAdd _addHeight; _targetPos = _targetPos vectorAdd _addHeight;
_defYaw = 0.0035; _defYaw = 0.0035;
_targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace);
_yaw = 0.0; _yaw = 0.0;
if((_targetVectorSeeker select 0) < 0) then { if((_targetVectorSeeker select 0) < 0) then {
_yaw = -_defYaw; _yaw = -_defYaw;
} else { } else {
if((_targetVectorSeeker select 0) > 0) then { if((_targetVectorSeeker select 0) > 0) then {
_yaw = _defYaw; _yaw = _defYaw;
}; };
}; };
_pitch = 0.0; _pitch = 0.0;
if((_targetVectorSeeker select 2) < 0) then { if((_targetVectorSeeker select 2) < 0) then {
_pitch = -_defPitch; _pitch = -_defPitch;
} else { } else {
if((_targetVectorSeeker select 2) > 0) then { if((_targetVectorSeeker select 2) > 0) then {
_pitch = _defPitch; _pitch = _defPitch;
}; };
}; };
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL
drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]]; drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]];
_light = "#lightpoint" createVehicleLocal (getPos _missile); _light = "#lightpoint" createVehicleLocal (getPos _missile);
_light setLightBrightness 1.0; _light setLightBrightness 1.0;
_light setLightAmbient [1.0, 0.0, 0.0]; _light setLightAmbient [1.0, 0.0, 0.0];
_light setLightColor [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"]; 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]]; drawLine3D [ASLtoATL _missilePos, ASLtoATL _targetPos, [1,0,0,1]];
_distance = ([getPos startPos, _missilePos] call BIS_fnc_distance2D); _distance = ([getPos startPos, _missilePos] call BIS_fnc_distance2D);
_marker = createMarkerLocal [format["m%1", MARKERCOUNT], [_distance, _missilePos select 2]]; _marker = createMarkerLocal [format["m%1", MARKERCOUNT], [_distance, _missilePos select 2]];
_marker setMarkerTypeLocal "mil_dot"; _marker setMarkerTypeLocal "mil_dot";
_marker setMarkerColorLocal "ColorRed"; _marker setMarkerColorLocal "ColorRed";
MARKERCOUNT = MARKERCOUNT + 1; MARKERCOUNT = MARKERCOUNT + 1;
#endif #endif
if(accTime > 0) then { if(accTime > 0) then {
_outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); _outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace);
_vectorTo = _missilePos vectorFromTo _outVector; _vectorTo = _missilePos vectorFromTo _outVector;
_missile setVectorDirAndUp [_vectorTo, vectorUp _missile]; _missile setVectorDirAndUp [_vectorTo, vectorUp _missile];
}; };
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL
hintSilent format["d: %1", _distanceToTarget]; hintSilent format["d: %1", _distanceToTarget];
#endif #endif
}; };
}; };
}; };
FUNC(guidance_Hellfire_LOAL_DIR_PFH) = { FUNC(guidance_Hellfire_LOAL_DIR_PFH) = {
//TRACE_1("enter", _this); //TRACE_1("enter", _this);
_args = _this select 0; _args = _this select 0;
//PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
_shooter = _args select 0; _shooter = _args select 0;
_missile = _args select 6; _missile = _args select 6;
_curVelocity = velocity _missile; _curVelocity = velocity _missile;
if(!alive _missile || isNull _missile || isNull _shooter) exitWith { if(!alive _missile || isNull _missile || isNull _shooter) exitWith {
[(_this select 1)] call cba_fnc_removePerFrameHandler; [(_this select 1)] call cba_fnc_removePerFrameHandler;
}; };
_launchPos = _shooter getVariable [QGVAR(launchPos), nil]; _launchPos = _shooter getVariable [QGVAR(launchPos), nil];
if(isNil "_launchPos") then { if(isNil "_launchPos") then {
TRACE_1("Setting launch parameters", ""); TRACE_1("Setting launch parameters", "");
_launchPos = getPosASL _shooter; _launchPos = getPosASL _shooter;
_shooter setVariable [QGVAR(launchPos), _launchPos, false]; _shooter setVariable [QGVAR(launchPos), _launchPos, false];
_shooter setVariable [QGVAR(launchTime), diag_tickTime, false]; _shooter setVariable [QGVAR(launchTime), diag_tickTime, false];
}; };
_targets = [_missile, ACE_DEFAULT_LASER_CODE, 70, _curVelocity] call ace__laser_fnc_findLaserDesignator; _targets = [_missile, ACE_DEFAULT_LASER_CODE, 70, _curVelocity] call ace__laser_fnc_findLaserDesignator;
_addHeight = [0,0,0]; _addHeight = [0,0,0];
if((_targets select 0)) then { if((_targets select 0)) then {
_target = _targets select 1; _target = _targets select 1;
TRACE_2("Targets", _target, _targets); TRACE_2("Targets", _target, _targets);
_yVec = vectorDir _missile; _yVec = vectorDir _missile;
_zVec = vectorUp _missile; _zVec = vectorUp _missile;
_xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec);
_missilePos = getPosASL _missile; _missilePos = getPosASL _missile;
// player sideChat "G!"; // player sideChat "G!";
_targetPos = getPosASL _target; _targetPos = getPosASL _target;
TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos)); TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos));
if((count _targetPos) > 0) then { if((count _targetPos) > 0) then {
_distanceToTarget = _missilePos vectorDistance _targetPos; _distanceToTarget = _missilePos vectorDistance _targetPos;
if((_launchPos distance _missilePos) < 400 && (_targetPos distance _missilePos) > 400) then { if((_launchPos distance _missilePos) < 400 && (_targetPos distance _missilePos) > 400) then {
_addHeight = [0,0,(_targetPos select 2) + (_missilePos distance _targetPos)*0.5]; _addHeight = [0,0,(_targetPos select 2) + (_missilePos distance _targetPos)*0.5];
TRACE_1("Climb phase", _addHeight); TRACE_1("Climb phase", _addHeight);
} else { } else {
// Covered half the distance, go terminal // Covered half the distance, go terminal
if((_missilePos distance _targetPos) < (_launchPos distance _targetPos) / 2) then { if((_missilePos distance _targetPos) < (_launchPos distance _targetPos) / 2) then {
TRACE_1("TERMINAL", ""); TRACE_1("TERMINAL", "");
} else { } else {
if((_missilePos select 2) > (_targetPos select 2)) then { if((_missilePos select 2) > (_targetPos select 2)) then {
_heightDiff = (_missilePos select 2) - (_targetPos select 2); _heightDiff = (_missilePos select 2) - (_targetPos select 2);
TRACE_1("Coasting", _heightDiff); TRACE_1("Coasting", _heightDiff);
_addHeight = [0,0, _heightDiff]; _addHeight = [0,0, _heightDiff];
}; };
}; };
}; };
_targetPos = _targetPos vectorAdd _addHeight; _targetPos = _targetPos vectorAdd _addHeight;
_defYaw = 0.0035; _defYaw = 0.0035;
_defPitch = 0.0075; _defPitch = 0.0075;
_targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace);
_yaw = 0.0; _yaw = 0.0;
if((_targetVectorSeeker select 0) < 0) then { if((_targetVectorSeeker select 0) < 0) then {
_yaw = -_defYaw; _yaw = -_defYaw;
} else { } else {
if((_targetVectorSeeker select 0) > 0) then { if((_targetVectorSeeker select 0) > 0) then {
_yaw = _defYaw; _yaw = _defYaw;
}; };
}; };
_pitch = 0.0; _pitch = 0.0;
if((_targetVectorSeeker select 2) < 0) then { if((_targetVectorSeeker select 2) < 0) then {
_pitch = -_defPitch; _pitch = -_defPitch;
} else { } else {
if((_targetVectorSeeker select 2) > 0) then { if((_targetVectorSeeker select 2) > 0) then {
_pitch = _defPitch; _pitch = _defPitch;
}; };
}; };
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL
drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]]; drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]];
_light = "#lightpoint" createVehicleLocal (getPos _missile); _light = "#lightpoint" createVehicleLocal (getPos _missile);
_light setLightBrightness 1.0; _light setLightBrightness 1.0;
_light setLightAmbient [1.0, 0.0, 0.0]; _light setLightAmbient [1.0, 0.0, 0.0];
_light setLightColor [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"]; 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]]; drawLine3D [ASLtoATL _missilePos, ASLtoATL _targetPos, [1,0,0,1]];
_distance = ([getPos startPos, _missilePos] call BIS_fnc_distance2D); _distance = ([getPos startPos, _missilePos] call BIS_fnc_distance2D);
_marker = createMarkerLocal [format["m%1", MARKERCOUNT], [_distance, _missilePos select 2]]; _marker = createMarkerLocal [format["m%1", MARKERCOUNT], [_distance, _missilePos select 2]];
_marker setMarkerTypeLocal "mil_dot"; _marker setMarkerTypeLocal "mil_dot";
_marker setMarkerColorLocal "ColorRed"; _marker setMarkerColorLocal "ColorRed";
MARKERCOUNT = MARKERCOUNT + 1; MARKERCOUNT = MARKERCOUNT + 1;
#endif #endif
if(accTime > 0) then { if(accTime > 0) then {
_outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); _outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace);
_vectorTo = _missilePos vectorFromTo _outVector; _vectorTo = _missilePos vectorFromTo _outVector;
_missile setVectorDirAndUp [_vectorTo, vectorUp _missile]; _missile setVectorDirAndUp [_vectorTo, vectorUp _missile];
}; };
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL
hintSilent format["d: %1", _distanceToTarget]; hintSilent format["d: %1", _distanceToTarget];
#endif #endif
}; };
}; };
}; };
FUNC(guidance_Hellfire_LOAL_HI) = { FUNC(guidance_Hellfire_LOAL_HI) = {
PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
GVAR(lastTime) = time; GVAR(lastTime) = time;
[FUNC(guidance_Hellfire_LOAL_HI_PFH), 0, _this] call cba_fnc_addPerFrameHandler; [FUNC(guidance_Hellfire_LOAL_HI_PFH), 0, _this] call cba_fnc_addPerFrameHandler;
}; };
FUNC(guidance_Hellfire_LOAL_DIR) = { FUNC(guidance_Hellfire_LOAL_DIR) = {
PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
GVAR(lastTime) = time; GVAR(lastTime) = time;
[FUNC(guidance_Hellfire_LOAL_DIR_PFH), 0, _this] call cba_fnc_addPerFrameHandler; [FUNC(guidance_Hellfire_LOAL_DIR_PFH), 0, _this] call cba_fnc_addPerFrameHandler;
}; };
PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
_fireMode = _shooter getVariable ["ACE_FIRE_SELECTION", ACE_DEFAULT_FIRE_SELECTION]; _fireMode = _shooter getVariable ["ACE_FIRE_SELECTION", ACE_DEFAULT_FIRE_SELECTION];
switch (_fireMode select 0) do { switch (_fireMode select 0) do {
// Default to FIREMODE_DIRECT_LOAL // Default to FIREMODE_DIRECT_LOAL
// FIREMODE_DIRECT_LOAL // FIREMODE_DIRECT_LOAL
default { default {
LOG("Initiating Hellfire II FIREMODE_LOAL_DIR"); LOG("Initiating Hellfire II FIREMODE_LOAL_DIR");
_this call FUNC(guidance_Hellfire_LOAL_HI); _this call FUNC(guidance_Hellfire_LOAL_HI);
}; };
}; };

View File

@ -2,108 +2,108 @@
#include "script_component.hpp" #include "script_component.hpp"
FUNC(guidance_LGB_LOAL_PFH) = { FUNC(guidance_LGB_LOAL_PFH) = {
//TRACE_1("enter", _this); //TRACE_1("enter", _this);
_args = _this select 0; _args = _this select 0;
//PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
_lgb = _args select 6; _lgb = _args select 6;
_curVelocity = velocity _lgb; _curVelocity = velocity _lgb;
if(!alive _lgb) exitWith { if(!alive _lgb) exitWith {
[(_this select 1)] call cba_fnc_removePerFrameHandler; [(_this select 1)] call cba_fnc_removePerFrameHandler;
}; };
_targets = [_lgb, ACE_DEFAULT_LASER_CODE, 70, _curVelocity] call uo_laser_fnc_findLaserDesignator; _targets = [_lgb, ACE_DEFAULT_LASER_CODE, 70, _curVelocity] call uo_laser_fnc_findLaserDesignator;
//TRACE_2("Targets", _target, _targets); //TRACE_2("Targets", _target, _targets);
if((_targets select 0)) then { if((_targets select 0)) then {
_target = _targets select 1; _target = _targets select 1;
// player sideChat "FUCK!"; // 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,"","",""]; // 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; _yVec = vectorDir _lgb;
_zVec = vectorUp _lgb; _zVec = vectorUp _lgb;
_xVec = vectorNormalized (_yVec vectorCrossProduct _zVec); _xVec = vectorNormalized (_yVec vectorCrossProduct _zVec);
_lgbPos = getPosASL _lgb; _lgbPos = getPosASL _lgb;
// player sideChat "G!"; // player sideChat "G!";
_targetPos = getPosASL _target; _targetPos = getPosASL _target;
if((count _targetPos) > 0) then { if((count _targetPos) > 0) then {
// player sideChat format["f: %1", _targetPos]; // player sideChat format["f: %1", _targetPos];
_addHeight = [0,0,(_lgbPos distance _targetPos)*0.06]; _addHeight = [0,0,(_lgbPos distance _targetPos)*0.06];
// drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]]; // drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]];
_targetPos = _targetPos vectorAdd _addHeight; _targetPos = _targetPos vectorAdd _addHeight;
_def = 0.0025; _def = 0.0025;
_targetVectorSeeker = [_lgb, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); _targetVectorSeeker = [_lgb, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace);
// _targetVectorSeeker = _lgb worldToModel (ASLtoATL _targetPos); // _targetVectorSeeker = _lgb worldToModel (ASLtoATL _targetPos);
// _targetVectorSeeker = [0,0,0] vectorFromTo _targetVectorSeeker; // _targetVectorSeeker = [0,0,0] vectorFromTo _targetVectorSeeker;
_yaw = 0.0; _yaw = 0.0;
if((_targetVectorSeeker select 0) < 0) then { if((_targetVectorSeeker select 0) < 0) then {
_yaw = -_def; _yaw = -_def;
} else { } else {
if((_targetVectorSeeker select 0) > 0) then { if((_targetVectorSeeker select 0) > 0) then {
_yaw = _def; _yaw = _def;
}; };
}; };
_pitch = 0.0; _pitch = 0.0;
if((_targetVectorSeeker select 2) < 0) then { if((_targetVectorSeeker select 2) < 0) then {
_pitch = -_def; _pitch = -_def;
} else { } else {
if((_targetVectorSeeker select 2) > 0) then { if((_targetVectorSeeker select 2) > 0) then {
_pitch = _def; _pitch = _def;
}; };
}; };
#ifdef DEBUG_MODE_FULL #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"]; 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]]; drawLine3D [ASLtoATL _lgbPos, ASLtoATL _targetPos, [1,0,0,1]];
_distance = ([getPos startPos, _lgbPos] call BIS_fnc_distance2D); _distance = ([getPos startPos, _lgbPos] call BIS_fnc_distance2D);
_marker = createMarkerLocal [format["m%1", MARKERCOUNT], [_distance, _lgbPos select 2]]; _marker = createMarkerLocal [format["m%1", MARKERCOUNT], [_distance, _lgbPos select 2]];
_marker setMarkerTypeLocal "mil_dot"; _marker setMarkerTypeLocal "mil_dot";
_marker setMarkerColorLocal "ColorRed"; _marker setMarkerColorLocal "ColorRed";
MARKERCOUNT = MARKERCOUNT + 1; MARKERCOUNT = MARKERCOUNT + 1;
#endif #endif
if(accTime > 0) then { if(accTime > 0) then {
_outVector = [_lgb, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); _outVector = [_lgb, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace);
// _outVector = _lgb modelToWorld [_yaw, 1, _pitch]; // _outVector = _lgb modelToWorldVisual [_yaw, 1, _pitch];
// _outVector = ATLtoASL _outVector; // _outVector = ATLtoASL _outVector;
_vectorTo = _lgbPos vectorFromTo _outVector; _vectorTo = _lgbPos vectorFromTo _outVector;
// hintSilent format["v: %1", _vectorTo]; // hintSilent format["v: %1", _vectorTo];
// _lgb setVectorDir _vectorTo; // _lgb setVectorDir _vectorTo;
_lgb setVectorDirAndUp [_vectorTo, vectorUp _lgb]; _lgb setVectorDirAndUp [_vectorTo, vectorUp _lgb];
}; };
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL
hintSilent format["d: %1", _lgbPos vectorDistance _targetPos]; hintSilent format["d: %1", _lgbPos vectorDistance _targetPos];
#endif #endif
}; };
}; };
}; };
FUNC(guidance_LGB_LOAL) = { FUNC(guidance_LGB_LOAL) = {
PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
[FUNC(guidance_LGB_LOAL_PFH), 0, _this] call cba_fnc_addPerFrameHandler; [FUNC(guidance_LGB_LOAL_PFH), 0, _this] call cba_fnc_addPerFrameHandler;
}; };
PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
_fireMode = _shooter getVariable ["ACE_FIRE_SELECTION", ACE_DEFAULT_FIRE_SELECTION]; _fireMode = _shooter getVariable ["ACE_FIRE_SELECTION", ACE_DEFAULT_FIRE_SELECTION];
switch (_fireMode select 0) do { switch (_fireMode select 0) do {
// Default to FIREMODE_DIRECT_LOAL // Default to FIREMODE_DIRECT_LOAL
// FIREMODE_DIRECT_LOAL // FIREMODE_DIRECT_LOAL
default { default {
LOG("Initiating FIREMODE_DIRECT_LOAL"); LOG("Initiating FIREMODE_DIRECT_LOAL");
_this call FUNC(guidance_LGB_LOAL); _this call FUNC(guidance_LGB_LOAL);
}; };
}; };

View File

@ -14,9 +14,9 @@ _y = _offset select 1;
_z = _offset select 2; _z = _offset select 2;
_out = [ _out = [
((_xVec select 0)*_x) + ((_xVec select 1)*_y) + ((_xVec 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), ((_yVec select 0)*_x) + ((_yVec select 1)*_y) + ((_yVec select 2)*_z),
((_zVec select 0)*_x) + ((_zVec select 1)*_y) + ((_zVec select 2)*_z) ((_zVec select 0)*_x) + ((_zVec select 1)*_y) + ((_zVec select 2)*_z)
]; ];
_out; _out;

View File

@ -2,11 +2,11 @@
#include "\z\ace\Addons\main\script_mod.hpp" #include "\z\ace\Addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_MISSILEGUIDANCE #ifdef DEBUG_ENABLED_MISSILEGUIDANCE
#define DEBUG_MODE_FULL #define DEBUG_MODE_FULL
#endif #endif
#ifdef DEBUG_SETTINGS_MISSILEGUIDANCE #ifdef DEBUG_SETTINGS_MISSILEGUIDANCE
#define DEBUG_SETTINGS DEBUG_SETTINGS_MISSILEGUIDANCE #define DEBUG_SETTINGS DEBUG_SETTINGS_MISSILEGUIDANCE
#endif #endif
#include "\z\ace\Addons\main\script_macros.hpp" #include "\z\ace\Addons\main\script_macros.hpp"

View File

@ -21,7 +21,7 @@ private ["_unit", "_anim", "_pos"];
_unit = _this select 0; _unit = _this select 0;
_anim = _this select 1; _anim = _this select 1;
_pos = _unit modelToWorld (_unit selectionPosition "camera"); _pos = _unit modelToWorldVisual (_unit selectionPosition "camera");
[_unit, "AmovPknlMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); [_unit, "AmovPknlMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
_pos = _pos vectorDiff (_unit selectionPosition "camera"); _pos = _pos vectorDiff (_unit selectionPosition "camera");

View File

@ -18,7 +18,7 @@ EXPLODE_3_PVT(_this,_unit,_vehicle,_weapon);
private ["_weaponPos", "_weaponDir", "_weaponPosDown"]; private ["_weaponPos", "_weaponDir", "_weaponPosDown"];
_weaponPos = ATLtoASL (_unit modelToWorld (_unit selectionPosition "RightHand")); _weaponPos = ATLtoASL (_unit modelToWorldVisual (_unit selectionPosition "RightHand"));
_weaponDir = _unit weaponDirection _weapon; _weaponDir = _unit weaponDirection _weapon;
_weaponPosDown = _weaponPos vectorAdd [0,0,-MAXHEIGHT]; _weaponPosDown = _weaponPos vectorAdd [0,0,-MAXHEIGHT];

View File

@ -26,7 +26,7 @@ if (count _sound < 3) then {_sound pushBack 1};
if (count _sound < 4) then {_sound pushBack 0}; if (count _sound < 4) then {_sound pushBack 0};
private "_position"; 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)]; _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]; playSound3D [_sound select 0, objNull, false, _position, _sound select 1, _sound select 2, _sound select 3];

View File

@ -27,7 +27,7 @@ if (count _sound < 4) then {_sound pushBack 0};
private "_position"; 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)]; _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]; playSound3D [_sound select 0, objNull, false, _position, _sound select 1, _sound select 2, _sound select 3];

View File

@ -1,17 +1,18 @@
class Extended_PreInit_EventHandlers { class Extended_PreInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_pre_init)); init = QUOTE(call COMPILE_FILE(XEH_pre_init));
}; };
}; };
class Extended_PostInit_EventHandlers { class Extended_PostInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_post_init)); init = QUOTE(call COMPILE_FILE(XEH_post_init));
}; clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit));
};
}; };
class Extended_FiredBIS_EventHandlers { class Extended_FiredBIS_EventHandlers {
class CAManBase { class CAManBase {
ADDON = QUOTE(_this call FUNC(fired)); ADDON = QUOTE(_this call FUNC(fired));
}; };
}; };

View File

@ -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
*/

View File

@ -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[] = {};
};
};

View File

@ -8,5 +8,5 @@ Adds the Javelin AT launcher.
The people responsible for merging changes to this component or answering potential questions. 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) - [NouberNou](https://github.com/NouberNou)

View File

@ -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
*/

View File

@ -0,0 +1,3 @@
#include "script_component.hpp"
#include "initKeybinds.sqf"

View File

@ -1,3 +1,2 @@
#include "script_component.hpp" #include "script_component.hpp"
NO_DEDICATED;

View File

@ -1,7 +1,15 @@
#include "script_component.hpp" #include "script_component.hpp"
PREP(fired); PREP(fired);
PREP(onGetLockedTarget);
PREP(translateToWeaponSpace); PREP(translateToWeaponSpace);
PREP(translateToModelSpace); PREP(translateToModelSpace);
PREP(lockKeyDown);
PREP(lockKeyUp);
PREP(cycleFireMode);
PREP(onOpticLoad);
PREP(onOpticDraw);
GVAR(isLockKeyDown) = false;

View File

@ -11,4 +11,5 @@ class CfgPatches {
}; };
#include "CfgEventhandlers.hpp" #include "CfgEventhandlers.hpp"
#include "CfgOptics.hpp" #include "RscInGameUI.hpp"
#include "CfgSounds.hpp"

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More