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 {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
canEject = 1;
showHMD = 1;
weapons[] = {"ACE_gatling_20mm_Comanche","missiles_DAGR","missiles_ASRAAM"};
magazines[] = {"ACE_500Rnd_20mm_shells_Comanche","4Rnd_AAA_missiles","24Rnd_PG_missiles"};
};
};
class AnimationSources: AnimationSources {
class Gatling {
weapon = "ACE_gatling_20mm_Comanche";
};
class Muzzle_flash {
weapon = "ACE_gatling_20mm_Comanche";
};
};
};
#include "Heli_Attack_01_base_F.hpp"
class B_Heli_Attack_01_F: Heli_Attack_01_base_F {};
@ -222,7 +200,7 @@ class CfgVehicles {
lockDetectionSystem = 0;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
weapons[] = {"M134_minigun","missiles_DAR","CMFlareLauncher"};
weapons[] = {"M134_minigun","missiles_DAR","CMFlareLauncher", "ACE_AIR_SAFETY" };
magazines[] = {"5000Rnd_762x51_Yellow_Belt","24Rnd_missiles","168Rnd_CMFlare_Chaff_Magazine"};
class Turrets: Turrets {

View File

@ -4,6 +4,23 @@ class Mode_Burst;
class Mode_FullAuto;
class CfgWeapons {
class RocketPods;
class ACE_AIR_SAFETY : RocketPods
{
CanLock = 0;
displayName = "SAFE";
displayNameMagazine = "SAFE";
shortNameMagazine = "SAFE";
nameSound = "cannon";
cursor = "EmptyCursor";
cursorAim = "EmptyCursor";
magazines[] = {"FakeMagazine"};
burst = 0;
reloadTime = 0.01;
magazineReloadTime = 0.1;
};
// Manual Switching Of Flare Mode
class SmokeLauncher;
class CMFlareLauncher: SmokeLauncher {

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.
* Contributations by Kimi for HUD updates
## Maintainers
@ -10,3 +11,4 @@ The people responsible for merging changes to this component or answering potent
- [KoffeinFlummi](https://github.com/KoffeinFlummi)
- [commy2](https://github.com/commy2)
- [jaynus](https://github.com/walterpearce)

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

Binary file not shown.

View File

@ -94,7 +94,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment
_unit removeAction _actionID;
if (GVAR(placeAction) == 1) then {
_startingPosition = _tempObject modelToWorld [0,0,0];
_startingPosition = _tempObject modelToWorldVisual [0,0,0];
[_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _startingPosition] call FUNC(placeApprove);
};
deleteVehicle _tempObject;

View File

@ -25,6 +25,6 @@ _itemName = [_args, 0, ""] call CBA_fnc_defaultParam;
_attachLimit = [6, 1] select (_player == _attachToVehicle);
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
_playerPos = (ACE_player modelToWorld (ACE_player selectionPosition "pilot"));
_playerPos = (ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot"));
(canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemName in ((itemsWithMagazines _player) + [""])};

View File

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

View File

@ -37,7 +37,7 @@ _sounds = [
QUOTE(PATHTO_R(sounds\zip_out.wav))
];
_position = _target modelToWorld (_target selectionPosition "Spine3");
_position = _target modelToWorldVisual (_target selectionPosition "Spine3");
_position = _position call EFUNC(common,positionToASL);
playSound3D [

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 "CfgWeapons.hpp"
#include "CfgAmmo.hpp"

View File

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

View File

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

View File

@ -57,7 +57,7 @@ switch ((_type select 0)) do {
};
} else {
_addedToPlayer = false;
_pos = _unit modelToWorld [0,1,0.05];
_pos = _unit modelToWorldVisual [0,1,0.05];
_unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit addWeaponCargoGlobal [_classname,1];
_unit setPosATL _pos;
@ -73,7 +73,7 @@ switch ((_type select 0)) do {
};
} else {
_addedToPlayer = false;
_pos = _unit modelToWorld [0,1,0.05];
_pos = _unit modelToWorldVisual [0,1,0.05];
_unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit addMagazineCargoGlobal [_classname, 1];
_unit setPosATL _pos;
@ -89,7 +89,7 @@ switch ((_type select 0)) do {
};
} else {
_addedToPlayer = false;
_pos = _unit modelToWorld [0,1,0.05];
_pos = _unit modelToWorldVisual [0,1,0.05];
_unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit addItemCargoGlobal [_classname,1];
_unit setPosATL _pos;

View File

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

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;
_return = false;
if ((surfaceIsWater getPos _unit)) then {
_aslPos = _unit modelToWorld (_unit selectionPosition "head");
_aslPos = _unit modelToWorldVisual (_unit selectionPosition "head");
if ((_aslPos select 2) <= 0) then {
_return = true;
};

View File

@ -36,7 +36,7 @@ if (_target isKindOf "CAManBase") then {
// add height offset of model
private "_offset";
_offset = (_target modelToWorld [0, 0, 0] select 2) - (_unit modelToWorld [0, 0, 0] select 2);
_offset = (_target modelToWorldVisual [0, 0, 0] select 2) - (_unit modelToWorldVisual [0, 0, 0] select 2);
_position = _position vectorAdd [0, 0, _offset];

View File

@ -25,7 +25,7 @@ _direction = _target getVariable [QGVAR(dragDirection), 0];
// add height offset of model
private "_offset";
_offset = (_target modelToWorld [0, 0, 0] select 2) - (_unit modelToWorld [0, 0, 0] select 2);
_offset = (_target modelToWorldVisual [0, 0, 0] select 2) - (_unit modelToWorldVisual [0, 0, 0] select 2);
_position = _position vectorAdd [0, 0, _offset];

View File

@ -36,7 +36,7 @@ if (_carriedItem isKindOf "CAManBase") exitWith {false};
private ["_position", "_maxHeight"];
_position = getPosATL _carriedItem;
_maxHeight = (_unit ModelToWorld [0,0,0]) select 2;
_maxHeight = (_unit modelToWorldVisual [0,0,0]) select 2;
_position set [2, ((_position select 2) + _scrollAmount min (_maxHeight + 1.5)) max _maxHeight];

View File

@ -19,7 +19,7 @@
#include "script_component.hpp"
EXPLODE_4_PVT(_this select 0,_unit,_i,_arr,_code);
if ((_i mod 4) == 0) then {
playSound3D [QUOTE(PATHTO_R(Data\Audio\DialTone.wss)), objNull, false, (_unit ModelToWorld [0,0.2,2]), 15,1,2.5];
playSound3D [QUOTE(PATHTO_R(Data\Audio\DialTone.wss)), objNull, false, (_unit modelToWorldVisual [0,0.2,2]), 15,1,2.5];
};
ctrlSetText [1400,format["Calling%1",_arr select (_i - 4)]];

View File

@ -15,7 +15,7 @@
* Placed explosive <OBJECT>
*
* 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;
*
* Public: Yes

View File

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

View File

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

View File

@ -12,7 +12,7 @@
#include "script_component.hpp"
private ["_vehicle", "_turret", "_turretConfig", "_distance", "_magazines"];
private ["_vehicle", "_turret", "_turretConfig", "_distance", "_magazines", "_userChange"];
_vehicle = _this select 0;
_turret = _this select 1;
@ -46,8 +46,10 @@ if (_weaponDirection isEqualTo [0,0,0]) then { // dummy value for non main turr
_angleTarget = asin (_weaponDirection select 2);
if (count _this > 2) then {
if((_this select 2) > -1) then {
_distance = _this select 2;
};
};
if (!(isNil QGVAR(backgroundCalculation)) and {!(scriptDone GVAR(backgroundCalculation))}) then {
terminate GVAR(backgroundCalculation);
@ -160,4 +162,11 @@ _FCSElevation = [];
[_vehicle, format ["%1_%2", QGVAR(Elevation), _turret], _FCSElevation] call EFUNC(common,setVariablePublic);
[_vehicle, format ["%1_%2", QGVAR(Azimuth), _turret], _FCSAzimuth] call EFUNC(common,setVariablePublic);
_userChange = true;
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;
} else {
if(typeName (_actionData select 7) == "ARRAY") then {
_pos = _object modelToWorld (_actionData select 7);
_pos = _object modelToWorldVisual (_actionData select 7);
} else {
if ((_actionData select 7) == "weapon") then {
// Craft a suitable position for weapon interaction
_weaponDir = _object weaponDirection currentWeapon _object;
_ref = _weaponDir call EFUNC(common,createOrthonormalReference);
_pos = (_object modelToWorld (_object selectionPosition "righthand")) vectorAdd ((_ref select 2) vectorMultiply 0.1);
_pos = (_object modelToWorldVisual (_object selectionPosition "righthand")) vectorAdd ((_ref select 2) vectorMultiply 0.1);
} else {
_pos = _object modelToWorld (_object selectionPosition (_actionData select 7));
_pos = _object modelToWorldVisual (_object selectionPosition (_actionData select 7));
};
};
// Compensate for movement during the frame to get rid of jittering
_pos = _pos vectorAdd ((visiblePositionASL _object) vectorDiff (getPosASL _object));
};
// For non-self actions, exit if the action is too far away
if (GVAR(openedMenuType) == 0 && vehicle ACE_player == ACE_player &&
{(ACE_player modelToWorld (ACE_player selectionPosition "pilot")) distance _pos >= _distance}) exitWith {false};
{(ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot")) distance _pos >= _distance}) exitWith {false};
// Exit if the action is behind you
_sPos = if (count _pos != 2) then {

View File

@ -19,7 +19,7 @@ if(!(isNil "ACE_LASERS")) 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;
_polarTo = _vectorTo call CBA_fnc_vect2polar;
_dir = _polarTo select 1;

View File

@ -10,18 +10,10 @@ class Extended_PostInit_EventHandlers {
};
};
class Extended_GetIn_EventHandlers {
class B_Heli_Attack_01_F {
class Extended_Init_EventHandlers {
class Helicopter {
class ADDON {
getIn = QUOTE(call FUNC(onGetin));
};
};
};
class Extended_GetOut_EventHandlers {
class B_Heli_Attack_01_F {
class ADDON {
getOut = QUOTE(call FUNC(onGetout));
init = QUOTE(_this call DFUNC(initDesignatorActions));
};
};
};

View File

@ -23,6 +23,7 @@ class CfgVehicles {
class B_Heli_Attack_01_F: Heli_Attack_01_base_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
GVAR(Enabled) = 1; // Enable laser self-designation
stabilizedInAxes = 4; // This stablizes the turret a bit more for laser designation
};
};

View File

@ -1,10 +1,9 @@
#include "script_component.hpp"
PREP(onGetIn);
PREP(onGetOut);
PREP(initDesignatorActions);
PREP(laserHudDesignateOn);
PREP(laserHudDesignateOff);
PREP(unitTurretHasDesignator);
GVAR(laser) = nil;
GVAR(laserActive) = false;

View File

@ -5,7 +5,7 @@ class CfgPatches {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_main", "ace_laser"};
requiredAddons[] = {"ace_interaction", "ace_laser"};
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

@ -3,6 +3,8 @@
TRACE_1("enter", _this);
#define FCS_UPDATE_DELAY 2.0
FUNC(magnitude) = {
_this distance [0, 0, 0]
};
@ -17,42 +19,37 @@ FUNC(mat_normalize3d) = {
};
FUNC(laserHudDesignatePFH) = {
private["_args", "_laserTarget", "_shooter", "_vehicle", "_weapon", "_gunnerInfo", "_turret", "_pov", "_gunBeg", "_gunEnd", "_povPos", "_povDir", "_result", "_resultPositions", "_firstResult", "_forceUpdateTime"];
_args = _this select 0;
_laserTarget = _args select 0;
_shooter = _args select 1;
if( (count _args) < 3) then {
_args set[2, diag_tickTime + FCS_UPDATE_DELAY];
};
_forceUpdateTime = _args select 2;
_vehicle = vehicle _shooter;
_weapon = currentWeapon _vehicle;
TRACE_1("", _args);
if(!alive _shooter || isNull _vehicle || isNull _laserTarget || !GVAR(laserActive) ) exitWith {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
[] call FUNC(laserHudDesignateOff);
};
if(!([ACE_player] call FUNC(unitTurretHasDesignator)) ) exitWith {
[] call FUNC(laserHudDesignateOff);
};
// Retrieve the gunner and turret memory point information
_gunnerInfo = [_vehicle, _weapon] call CBA_fnc_getFirer;
_turretInfo = [_vehicle, _gunnerInfo select 1] call EFUNC(common,getTurretDirection);
_povPos = _turretInfo select 0;
_povDir = _turretInfo select 1;
_turret = [_vehicle, _gunnerInfo select 1] call CBA_fnc_getTurret;
_pov = getText (_turret >> "memoryPointGunnerOptics");
_gunBeg = getText (_turret >> "gunBeg");
_gunEnd = getText (_turret >> "gunEnd");
TRACE_3("", _pov, _gunBeg, _gunEnd);
// Pull the PIP pov or barrel direction, depending on how the model is set up
_povPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _pov ) );
_povDir = [0,0,0];
if(_pov == "pip0_pos") then {
_pipDir = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition "pip0_dir" ) );
_povDir = [_povPos, _pipDir] call BIS_fnc_vectorDiff;
} else {
_gunBeginPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _gunBeg ) );
_gunEndPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _gunEnd ) );
_povDir = [_gunEndPos, _gunBeginPos] call BIS_fnc_vectorDiff;
};
TRACE_4("", _povDir, _povPos, _gunBeginPos, _gunEndPos);
_result = [_povPos, _povDir] call EFUNC(laser,shootCone);
if((count _result) > 0) then {
_resultPositions = _result select 2;
@ -64,18 +61,43 @@ FUNC(laserHudDesignatePFH) = {
// 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 {
TRACE_5("", diag_tickTime, _forceUpdateTime, getPosASL _laserTarget, _pos, ((getPosASL _laserTarget) distance _pos));
if(diag_tickTime > _forceUpdateTime) then {
TRACE_1("FCS Update", "");
["ace_fcs_forceUpdate", []] call ace_common_fnc_localEvent;
};
if( ((getPosASL _laserTarget) vectorDistance _pos) > 2) then {
TRACE_1("LaserPos Update", "");
_laserTarget setPosATL (ASLToATL _pos);
//};
};
if(diag_tickTime > _forceUpdateTime) then {
_args set[3, diag_tickTime + FCS_UPDATE_DELAY];
};
#ifdef DEBUG_MODE_FULL
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLToATL _pos, 0.75, 0.75, 0, "", 0.5, 0.025, "TahomaB"];
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], (getPosATL _laserTarget), 0.75, 0.75, 0, "", 0.5, 0.025, "TahomaB"];
{
private["_position"];
_position = _x select 0;
drawLine3d [ASLToATL _povPos, ASLToATL _position, [0,0,1,1] ];
} forEach _resultPositions;
#endif
};
};
_this set[0, _args];
};
private "_laserTarget";
private "_handle";
if(isNil QGVAR(laser)) then {
_laserTarget = "LaserTarget" createVehicle (getpos player);
_laserTarget = "LaserTargetW" createVehicle (getpos player);
GVAR(laserActive) = true;

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

@ -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);
_p0Pos = _unit modelToWorld (_unit selectionPosition "righthand");
_p0Pos = _unit modelToWorldVisual (_unit selectionPosition "righthand");
// Convert _p0Pos to ASL
_p0 = + _p0Pos;

View File

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

View File

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

View File

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

View File

@ -10,14 +10,12 @@ class CfgWeapons {
type = 0;
class ItemInfo: InventoryFirstAidKitItem_Base_F {
mass = 4;
type = 201;
};
};
class Medikit: ItemCore {
type = 0;
class ItemInfo: MedikitItem {
mass = 60;
type = 201;
};
};
@ -32,10 +30,9 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_BANDAGE_BASIC_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 1;
type=201;
};
};
class ACE_packingBandage: ItemCore {
class ACE_packingBandage: ACE_ItemCore {
scope = 2;
value = 1;
count = 1;
@ -47,10 +44,9 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_PACKING_BANDAGE_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 1;
type=201;
};
};
class ACE_elasticBandage: ItemCore {
class ACE_elasticBandage: ACE_ItemCore {
scope = 2;
value = 1;
count = 1;
@ -62,10 +58,9 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_BANDAGE_ELASTIC_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 1;
type=201;
};
};
class ACE_tourniquet: ItemCore {
class ACE_tourniquet: ACE_ItemCore {
scope = 2;
value = 1;
count = 1;
@ -77,10 +72,9 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_TOURNIQUET_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 1;
type=201;
};
};
class ACE_morphine: ItemCore {
class ACE_morphine: ACE_ItemCore {
scope = 2;
value = 1;
count = 1;
@ -92,10 +86,9 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_MORPHINE_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 1;
type=201;
};
};
class ACE_atropine: ItemCore {
class ACE_atropine: ACE_ItemCore {
scope = 2;
value = 1;
count = 1;
@ -107,10 +100,10 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_ATROPINE_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 1;
type=201;
};
};
class ACE_epinephrine: ItemCore {
class ACE_epinephrine: ACE_ItemCore {
scope = 2;
value = 1;
count = 1;
@ -122,10 +115,9 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_EPINEPHRINE_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 1;
type=201;
};
};
class ACE_plasmaIV: ItemCore {
class ACE_plasmaIV: ACE_ItemCore {
scope = 2;
value = 1;
count = 1;
@ -135,24 +127,21 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_PLASMA_IV_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 10;
type = 201;
};
};
class ACE_plasmaIV_500: ACE_plasmaIV {
displayName = $STR_ACE_MEDICAL_PLASMA_IV_500;
class ItemInfo: InventoryItem_Base_F {
mass = 5;
type = 201;
};
};
class ACE_plasmaIV_250: ACE_plasmaIV {
displayName = $STR_ACE_MEDICAL_PLASMA_IV_250;
class ItemInfo: InventoryItem_Base_F {
mass = 2.5;
type = 201;
};
};
class ACE_bloodIV: ItemCore {
class ACE_bloodIV: ACE_ItemCore {
scope = 2;
value = 1;
count = 1;
@ -163,24 +152,21 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_BLOOD_IV_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 10;
type = 201;
};
};
class ACE_bloodIV_500: ACE_bloodIV {
displayName = $STR_ACE_MEDICAL_BLOOD_IV_500;
class ItemInfo: InventoryItem_Base_F {
mass = 5;
type = 201;
};
};
class ACE_bloodIV_250: ACE_bloodIV {
displayName = $STR_ACE_MEDICAL_BLOOD_IV_250;
class ItemInfo: InventoryItem_Base_F {
mass = 2.5;
type = 201;
};
};
class ACE_salineIV: ItemCore {
class ACE_salineIV: ACE_ItemCore {
scope = 2;
value = 1;
count = 1;
@ -190,24 +176,21 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_SALINE_IV_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 10;
type = 201;
};
};
class ACE_salineIV_500: ACE_salineIV {
displayName = $STR_ACE_MEDICAL_SALINE_IV_500;
class ItemInfo: InventoryItem_Base_F {
mass = 2.5;
type = 201;
};
};
class ACE_salineIV_250: ACE_salineIV {
displayName = $STR_ACE_MEDICAL_SALINE_IV_250;
class ItemInfo: InventoryItem_Base_F {
mass = 2.5;
type = 201;
};
};
class ACE_quikclot: ItemCore {
class ACE_quikclot: ACE_ItemCore {
scope = 2;
value = 1;
count = 1;
@ -218,25 +201,22 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_QUIKCLOT_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 1;
type = 201;
};
};
class ACE_personalAidKit: ItemCore {
class ACE_personalAidKit: ACE_ItemCore {
scope = 2;
value = 1;
count = 1;
type = 16;
displayName = $STR_ACE_MEDICAL_AID_KIT_DISPLAY;
picture = QUOTE(PATHTOF(ui\items\personal_aid_kit.paa));
//model = QUOTE(PATHTOF(equipment\Personal-aidkits\MTP.p3d));
descriptionShort = $STR_ACE_MEDICAL_AID_KIT_DESC_SHORT;
descriptionUse = $STR_ACE_MEDICAL_AID_KIT_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 2;
type = 201;
};
};
class ACE_surgicalKit: ItemCore {
class ACE_surgicalKit: ACE_ItemCore {
scope=2;
displayName= $STR_ACE_MEDICAL_SURGICALKIT_DISPLAY;
model = QUOTE(PATHTOF(data\surgical_kit.p3d));
@ -245,10 +225,9 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_SURGICALKIT_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 5;
type = 201;
};
};
class ACE_bodyBag: ItemCore {
class ACE_bodyBag: ACE_ItemCore {
scope=2;
displayName= $STR_ACE_MEDICAL_BODYBAG_DISPLAY;
model = QUOTE(PATHTOF(data\bodybagItem.p3d));
@ -257,7 +236,6 @@ class CfgWeapons {
descriptionUse = $STR_ACE_MEDICAL_BODYBAG_DESC_USE;
class ItemInfo: InventoryItem_Base_F {
mass = 15;
type = 201;
};
};
};

View File

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

View File

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

View File

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

View File

@ -61,6 +61,18 @@ if (_show) then {
_genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_PAIN", [1, 1, 1, 1]];
};
_totalIvVolume = 0;
{
private "_value";
_value = _target getvariable _x;
if !(isnil "_value") then {
_totalIvVolume = _totalIvVolume + (_target getvariable [_x, 0]);
};
}foreach GVAR(IVBags);
if (_totalIvVolume >= 1) then {
_genericMessages pushback [format[localize "STR_ACE_MEDICAL_receivingIvVolume", floor _totalIvVolume], [1, 1, 1, 1]];
};
_selectionBloodLoss = [0,0,0,0,0,0];
if (GVAR(level) >= 2) then {
_openWounds = _target getvariable [QGVAR(openWounds), []];
@ -74,24 +86,45 @@ if (_show) then {
if (_amountOf > 0) then {
if (_amountOf >= 1) then {
// TODO localization
_allInjuryTexts pushback format["%2x %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6, _amountOf];
_allInjuryTexts pushback [format["%2x %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6, _amountOf], [1,1,1,1]];
} else {
// TODO localization
_allInjuryTexts pushback format["Partial %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6];
_allInjuryTexts pushback [format["Partial %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6], [1,1,1,1]];
};
};
};
}foreach _openWounds;
_bandagedwounds = _target getvariable [QGVAR(bandagedWounds), []];
{
_amountOf = _x select 3;
// Find how much this bodypart is bleeding
//if (_selectionBloodLoss select (_x select 2) == 0) then {
// _selectionBloodLoss set [(_x select 2), (_selectionBloodLoss select (_x select 2)) + (15 * ((_x select 4) * _amountOf))];
//};
if (GVAR(currentSelectedSelectionN) == (_x select 2)) then {
// Collect the text to be displayed for this injury [ Select injury class type definition - select the classname DisplayName (6th), amount of injuries for this]
if (_amountOf > 0) then {
if (_amountOf >= 1) then {
// TODO localization
_allInjuryTexts pushback [format["[B] %2x %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6, _amountOf], [1,0.5,0.5,1]];
} else {
// TODO localization
_allInjuryTexts pushback [format["[B] Partial %1", (GVAR(AllWoundInjuryTypes) select (_x select 1)) select 6], [1,0.5,0.5,1]];
};
};
};
}foreach _bandagedwounds;
} else {
{
_selectionBloodLoss set [_forEachIndex, _target getHitPointDamage _x];
if (_target getHitPointDamage _x > 0.1) then {
// @todo localize
_allInjuryTexts pushBack format ["%1 %2",
_allInjuryTexts pushBack [format ["%1 %2",
["Lightly wounded", "Heavily wounded"] select (_target getHitPointDamage _x > 0.5),
["head", "torso", "left arm", "right arm", "left leg", "right leg"] select _forEachIndex
];
], [1,1,1,1]];
};
} forEach ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"];
};
@ -125,7 +158,8 @@ if (_show) then {
_lbCtrl lbSetColor [_foreachIndex, _x select 1];
}foreach _genericMessages;
{
_lbCtrl lbAdd _x;
_lbCtrl lbAdd (_x select 0);
_lbCtrl lbSetColor [_foreachIndex, _x select 1];
}foreach _allInjuryTexts;
if (count _allInjuryTexts == 0) then {
_lbCtrl lbAdd "No injuries on this bodypart..";

View File

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

View File

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

View File

@ -44,6 +44,12 @@ if (_bloodVolume < 100.0) then {
_unit setvariable [_x,_ivVolume];
};
}foreach GVAR(IVBags);
} else {
{
if ((_unit getvariable [_x, 0]) > 0) then {
_unit setvariable [_x, 0]; // lets get rid of exessive IV volume
};
}foreach GVAR(IVBags);
};
_bloodVolumeChange;

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 {};
_lastTimeValuesSynced = _unit getvariable [QGVAR(lastMomentValuesSynced), 0];
_syncValues = time - _lastTimeValuesSynced >= (10 + floor(random(10)));
_syncValues = (time - _lastTimeValuesSynced >= (10 + floor(random(10))) && GVAR(keepLocalSettingsSynced));
if (_syncValues) then {
_unit setvariable [QGVAR(lastMomentValuesSynced), time];
};
@ -167,4 +167,15 @@ if (GVAR(level) >= 2) then {
[_unit] call FUNC(setCardiacArrest);
};
};
// syncing any remaining values
if (_syncValues) then {
{
private "_value";
_value = _unit getvariable _x;
if !(isnil "_value") then {
_unit setvariable [_x,(_unit getvariable [_x, 0]), true];
};
}foreach GVAR(IVBags);
};
};

View File

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

View File

@ -37,7 +37,7 @@ _medicalFacility =
"USMC_WarfareBFieldhHospital"
];
_objects = (lineIntersectsWith [_unit modelToWorld [0, 0, (_eyePos select 2)], _unit modelToWorld [0, 0, (_eyePos select 2) +10], _unit]);
_objects = (lineIntersectsWith [_unit modelToWorldVisual [0, 0, (_eyePos select 2)], _unit modelToWorldVisual [0, 0, (_eyePos select 2) +10], _unit]);
{
if (((typeOf _x) in _medicalFacility) || (_x getVariable [QGVAR(isMedicalFacility),false])) exitwith {
_isInBuilding = true;

View File

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

View File

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

View File

@ -10,7 +10,7 @@
* Return Value:
* Succesful treatment started <BOOL>
*
* Public: Yes
* Public: No
*/
#include "script_component.hpp"
@ -82,18 +82,17 @@ if (_effectivenessFound == -1) exitwith {}; // Seems everything is patched up on
// TODO refactor this part
// Find the impact this bandage has and reduce the amount this injury is present
_impact = if ((_mostEffectiveInjury select 3) >= _effectivenessFound) then {_effectivenessFound} else { (_mostEffectiveInjury select 3) };
_mostEffectiveInjury set [ 3, ((_mostEffectiveInjury select 3) - _effectivenessFound) max 0];
_mostEffectiveInjury set [ 3, ((_mostEffectiveInjury select 3) - _impact) max 0];
_openWounds set [_mostEffectiveSpot, _mostEffectiveInjury];
_target setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC];
if (USE_WOUND_EVENT_SYNC) then {
["medical_propagateWound", [_unit, _mostEffectiveInjury]] call EFUNC(common,globalEvent);
["medical_propagateWound", [_target, _mostEffectiveInjury]] call EFUNC(common,globalEvent);
};
// Handle the reopening of bandaged wounds
if (_impact > 0) then {
// TODO handle reopening of bandaged wounds
// [_target, _impact, _part,_highestSpot, _removeItem] call FUNC(handleBandageOpening);
if (_impact > 0 && {GVAR(enableAdvancedWounds)}) then {
[_target, _impact, _part, _mostEffectiveSpot, _mostEffectiveInjury, _bandage] call FUNC(handleBandageOpening);
};
// If all wounds have been bandaged, we will reset all damage to 0, so the unit is not showing any blood on the model anymore.

View File

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

View File

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

View File

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

View File

@ -3,6 +3,7 @@
FUNC(guidance_DIRECT_LOAL_PFH) = {
//TRACE_1("enter", _this);
private["_args", "_shooter", "_dagr", "_curVelocity", "_targets", "_target", "_yVec", "_xVec", "_zVec", "_dagrPos", "_shooterPos", "_distanceToTarget", "_distanceToShooter", "_def"];
_args = _this select 0;
//PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
_shooter = _args select 0;
@ -30,8 +31,11 @@ FUNC(guidance_DIRECT_LOAL_PFH) = {
_dagrPos = getPosASL _dagr;
// player sideChat "G!";
_targetPos = getPosASL _target;
_shooterPos = getPosASL _shooter;
if((count _targetPos) > 0) then {
_distanceToTarget = _dagrPos vectorDistance _targetPos;
_distanceToShooter = _dagrPos vectorDistance _shooterPos;
_addHeight = [0,0,(_dagrPos distance _targetPos)*0.02];
#ifdef DEBUG_MODE_FULL
@ -40,7 +44,10 @@ FUNC(guidance_DIRECT_LOAL_PFH) = {
_targetPos = _targetPos vectorAdd _addHeight;
_def = 0.0050;
_def = 0.0040;
if(_distanceToShooter > 100) then {
_def = 0.0025;
};
_targetVectorSeeker = [_dagr, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace);
// _targetVectorSeeker = _dagr worldToModel (ASLtoATL _targetPos);
@ -76,7 +83,7 @@ FUNC(guidance_DIRECT_LOAL_PFH) = {
if(accTime > 0) then {
_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;
_vectorTo = _dagrPos vectorFromTo _outVector;

View File

@ -73,7 +73,7 @@ FUNC(guidance_LGB_LOAL_PFH) = {
if(accTime > 0) then {
_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;
_vectorTo = _lgbPos vectorFromTo _outVector;

View File

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

View File

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

View File

@ -26,7 +26,7 @@ if (count _sound < 3) then {_sound pushBack 1};
if (count _sound < 4) then {_sound pushBack 0};
private "_position";
_position = _unit modelToWorld (_unit selectionPosition "RightHand");
_position = _unit modelToWorldVisual (_unit selectionPosition "RightHand");
_position set [2, (_position select 2) + ((getPosASLW _unit select 2) - (getPosATL _unit select 2) max 0)];
playSound3D [_sound select 0, objNull, false, _position, _sound select 1, _sound select 2, _sound select 3];

View File

@ -27,7 +27,7 @@ if (count _sound < 4) then {_sound pushBack 0};
private "_position";
_position = _unit modelToWorld (_unit selectionPosition "RightHand");
_position = _unit modelToWorldVisual (_unit selectionPosition "RightHand");
_position set [2, (_position select 2) + ((getPosASLW _unit select 2) - (getPosATL _unit select 2) max 0)];
playSound3D [_sound select 0, objNull, false, _position, _sound select 1, _sound select 2, _sound select 3];

View File

@ -7,6 +7,7 @@ class Extended_PreInit_EventHandlers {
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_post_init));
clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit));
};
};

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.
- [walterpearce](https://github.com/walterpearce)
- [jaynus](https://github.com/walterpearce)
- [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"
NO_DEDICATED;

View File

@ -1,7 +1,15 @@
#include "script_component.hpp"
PREP(fired);
PREP(onGetLockedTarget);
PREP(translateToWeaponSpace);
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 "CfgOptics.hpp"
#include "RscInGameUI.hpp"
#include "CfgSounds.hpp"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,19 @@
#define DEBUG_MODE_FULL
#include "script_component.hpp"
TRACE_1("enter", _this);
private["_player", "_currentFireMode"];
_currentFireMode = ACE_player getVariable["ACE_FIRE_SELECTION", ACE_JAV_FIREMODE_TOP];
if(_currentFireMode == ACE_JAV_FIREMODE_DIR) then {
_currentFireMode = ACE_JAV_FIREMODE_TOP;
__JavelinIGUITop ctrlSetTextColor __ColorGreen;
__JavelinIGUIDir ctrlSetTextColor __ColorGray;
} else {
_currentFireMode = ACE_JAV_FIREMODE_DIR;
__JavelinIGUITop ctrlSetTextColor __ColorGray;
__JavelinIGUIDir ctrlSetTextColor __ColorGreen;
};
ACE_player setVariable["ACE_FIRE_SELECTION", _currentFireMode, false];

View File

@ -1,48 +1,39 @@
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
//_this=[TEST_AI_HELICOPTER,"missiles_DAGR","missiles_DAGR","Far_AI","M_PG_AT","24Rnd_PG_missiles",163988: rocket_01_fly_f.p3d]
TRACE_1("enter", _this);
TRACE_1("Launch", _this);
PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
FUNC(guidance_Javelin_LOBL_HI_PFH) = {
FUNC(guidance_Javelin_LOBL_DIR_PFH) = {
TRACE_1("enter", _this);
private["_pitch", "_yaw", "_wentTerminal", "_target", "_targetPos", "_curVelocity", "_missile" ];
private["_pitch", "_yaw", "_wentTerminal", "_target", "_targetPos", "_curVelocity", "_missile",
"_launchPos", "_targetStartPos", "_defPitch", "_defYaw"];
_args = _this select 0;
//PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
_shooter = _args select 0;
_missile = _args select 6;
if((count _this) > 2) then {
_wentTerminal = _this select 2;
if((count _args) > 7) then {
_saveArgs = _args select 7;
_target = _saveArgs select 0;
_targetStartPos = _saveArgs select 1;
_launchPos = _saveArgs select 2;
_wentTerminal = _saveArgs select 3;
} else {
_this set[2, false];
_wentTerminal = false;
_launchPos = getPosASL _shooter;
_target = ACE_player getVariable[QGVAR(currentTarget), objNull];
_targetStartPos = ACE_player getVariable[QGVAR(currentTargetPos), [0,0,0]];
};
if((count _this) > 3) then {
_targets = _this select 3;
_target = _targets select 0;
_targetPos = _targets select 1;
} else {
_this set[3, [GVAR(currentTarget),GVAR(currentTargetPos)] ];
_target = GVAR(currentTarget);
_targetPos = GVAR(currentTargetPos);
};
_curVelocity = velocity _missile;
if(!alive _missile || isNull _missile) exitWith {
if(!alive _missile || isNull _missile || isNull _target) exitWith {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
};
_targetPos = getPosASL _target;
_curVelocity = velocity _missile;
_launchPos = _shooter getVariable [QGVAR(launchPos), nil];
if(isNil "_launchPos") then {
TRACE_1("Setting launch parameters", "");
_launchPos = getPosASL _shooter;
_shooter setVariable [QGVAR(launchPos), _launchPos, false];
_shooter setVariable [QGVAR(launchTime), diag_tickTime, false];
};
TRACE_4("", _target, _targetPos, _launchPos, _targetStartPos);
_addHeight = [0,0,0];
if(!isNil "_target") then {
@ -58,23 +49,30 @@ FUNC(guidance_Javelin_LOBL_HI_PFH) = {
if((count _targetPos) > 0) then {
_distanceToTarget = [(_missilePos select 0), (_missilePos select 1), (_targetPos select 2)] vectorDistance _targetPos;
_defPitch = 0.25;
if( (_missilePos select 2) < (_targetPos select 2) + 60 && !_wentTerminal) then {
_addHeight = [0,0,(_targetPos select 2) + 120];
_defPitch = 0.15;
_defYaw = 0.035;
if( (_missilePos select 2) < (_targetPos select 2) + 160 && !_wentTerminal) then {
_addHeight = [0,0,(_targetPos select 2) + ( (_distanceToTarget * 2) + 160)];
TRACE_1("Climb phase", _addHeight);
} else {
_wentTerminal = true;
_this set[2, _wentTerminal];
_defPitch = 0.15;
_defYaw = 0.035;
TRACE_1("TERMINAL", "");
};
_targetPos = _targetPos vectorAdd _addHeight;
_defYaw = 0.0035;
_targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace);
_yaw = 0.0;
TRACE_5("", _missile, _xVec, _yVec, _zVec, _targetPos);
_yaw = 0.0;
_pitch = 0.0;
if((_targetVectorSeeker select 0) < 0) then {
_yaw = -_defYaw;
} else {
@ -83,7 +81,6 @@ FUNC(guidance_Javelin_LOBL_HI_PFH) = {
};
};
_pitch = 0.0;
if((_targetVectorSeeker select 2) < 0) then {
_pitch = -_defPitch;
} else {
@ -105,10 +102,132 @@ FUNC(guidance_Javelin_LOBL_HI_PFH) = {
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _missilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"];
drawLine3D [ASLtoATL _missilePos, ASLtoATL _targetPos, [1,0,0,1]];
_distance = ([getPos startPos, _missilePos] call BIS_fnc_distance2D);
_marker = createMarkerLocal [format["m%1", MARKERCOUNT], [_distance, _missilePos select 2]];
_marker setMarkerTypeLocal "mil_dot";
_marker setMarkerColorLocal "ColorRed";
MARKERCOUNT = MARKERCOUNT + 1;
#endif
if(accTime > 0) then {
TRACE_5("", _xVec, _yVec, _zVec, _yaw, _pitch);
_outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace);
_vectorTo = _missilePos vectorFromTo _outVector;
TRACE_3("", _missile, _outVector, _vectorTo);
_missile setVectorDirAndUp [_vectorTo, vectorUp _missile];
};
#ifdef DEBUG_MODE_FULL
hintSilent format["d: %1", _distanceToTarget];
#endif
};
};
_saveArgs = [_target,_targetStartPos, _launchPos, _wentTerminal];
_args set[7, _saveArgs ];
_this set[0, _args];
};
FUNC(guidance_Javelin_LOBL_TOP_PFH) = {
TRACE_1("enter", _this);
private["_pitch", "_yaw", "_wentTerminal", "_target", "_targetPos", "_curVelocity", "_missile",
"_launchPos", "_targetStartPos", "_defPitch", "_defYaw"];
_args = _this select 0;
//PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
_shooter = _args select 0;
_missile = _args select 6;
if((count _args) > 7) then {
_saveArgs = _args select 7;
_target = _saveArgs select 0;
_targetStartPos = _saveArgs select 1;
_launchPos = _saveArgs select 2;
_wentTerminal = _saveArgs select 3;
} else {
_wentTerminal = false;
_launchPos = getPosASL _shooter;
_target = ACE_player getVariable[QGVAR(currentTarget), objNull];
_targetStartPos = ACE_player getVariable[QGVAR(currentTargetPos), [0,0,0]];
};
if(!alive _missile || isNull _missile || isNull _target) exitWith {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
};
_targetPos = getPosASL _target;
_curVelocity = velocity _missile;
TRACE_4("", _target, _targetPos, _launchPos, _targetStartPos);
_addHeight = [0,0,0];
if(!isNil "_target") then {
_yVec = vectorDir _missile;
_zVec = vectorUp _missile;
_xVec = vectorNormalized (_yVec vectorCrossProduct _zVec);
_missilePos = getPosASL _missile;
// player sideChat "G!";
TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos));
if((count _targetPos) > 0) then {
_distanceToTarget = [(_missilePos select 0), (_missilePos select 1), (_targetPos select 2)] vectorDistance _targetPos;
if( (_missilePos select 2) < (_targetPos select 2) + 200 && !_wentTerminal) then {
_addHeight = [0,0, ( (_distanceToTarget * 2) + 400)];
_defPitch = 0.25;
_defYaw = 0.035;
TRACE_1("Climb phase", _addHeight);
} else {
_wentTerminal = true;
_this set[2, _wentTerminal];
_defPitch = 0.25;
_defYaw = 0.25;
TRACE_1("TERMINAL", "");
};
_targetPos = _targetPos vectorAdd _addHeight;
_targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace);
TRACE_5("", _missile, _xVec, _yVec, _zVec, _targetPos);
_yaw = 0.0;
_pitch = 0.0;
// Stop jinking on terminal final decent
if((_missilePos distance _targetPos) < 150) then {
_defPitch = 0.0015;
_defYaw = 0.0015;
};
if((_targetVectorSeeker select 0) < 0) then {
_yaw = -_defYaw;
} else {
if((_targetVectorSeeker select 0) > 0) then {
_yaw = _defYaw;
};
};
if((_targetVectorSeeker select 2) < 0) then {
_pitch = -_defPitch;
} else {
if((_targetVectorSeeker select 2) > 0) then {
_pitch = _defPitch;
};
};
TRACE_3("", _targetVectorSeeker, _pitch, _yaw);
#ifdef DEBUG_MODE_FULL
drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]];
_light = "#lightpoint" createVehicleLocal (getPos _missile);
_light setLightBrightness 1.0;
_light setLightAmbient [1.0, 0.0, 0.0];
_light setLightColor [1.0, 0.0, 0.0];
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _missilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"];
drawLine3D [ASLtoATL _missilePos, ASLtoATL _targetPos, [1,0,0,1]];
MARKERCOUNT = MARKERCOUNT + 1;
#endif
@ -127,25 +246,40 @@ FUNC(guidance_Javelin_LOBL_HI_PFH) = {
#endif
};
};
_saveArgs = [_target,_targetStartPos, _launchPos, _wentTerminal];
_args set[7, _saveArgs ];
_this set[0, _args];
};
FUNC(guidance_Javelin_LOBL_HI) = {
FUNC(guidance_Javelin_LOBL_TOP) = {
PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
GVAR(lastTime) = time;
[FUNC(guidance_Javelin_LOBL_HI_PFH), 0, _this] call cba_fnc_addPerFrameHandler;
[FUNC(guidance_Javelin_LOBL_TOP_PFH), 0, _this] call cba_fnc_addPerFrameHandler;
};
FUNC(guidance_Javelin_LOBL_DIR) = {
PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
GVAR(lastTime) = time;
[FUNC(guidance_Javelin_LOBL_DIR_PFH), 0, _this] call cba_fnc_addPerFrameHandler;
};
if(!local _shooter) exitWith { false };
if(_ammo == "M_Titan_AT") then {
_fireMode = _shooter getVariable ["ACE_FIRE_SELECTION", ACE_DEFAULT_FIRE_SELECTION];
_fireMode = _shooter getVariable ["ACE_FIRE_SELECTION", ACE_JAV_FIREMODE_TOP];
switch (_fireMode select 0) do {
switch (_fireMode) do {
// Default to FIREMODE_DIRECT_LOAL
// FIREMODE_DIRECT_LOAL
case ACE_JAV_FIREMODE_DIR: {
LOG("Initiating Javelin FIREMODE_LOBL_DIR");
_this call FUNC(guidance_Javelin_LOBL_DIR);
};
default {
LOG("Initiating Javelin FIREMODE_LOBL_HI");
_this call FUNC(guidance_Javelin_LOBL_HI);
LOG("Initiating Javelin FIREMODE_LOBL_TOP");
_this call FUNC(guidance_Javelin_LOBL_TOP);
};
};
};

View File

@ -0,0 +1,3 @@
#define DEBUG_MODE_FULL
#include "script_component.hpp"
TRACE_1("enter", _this);

View File

@ -0,0 +1,3 @@
#define DEBUG_MODE_FULL
#include "script_component.hpp"
TRACE_1("enter", _this);

View File

@ -1,8 +0,0 @@
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
// Store the current cursor target for guidance
GVAR(currentTarget) = cursorTarget;
GVAR(currentTargetPos) = screenToWorld [0.5,0.5];
TRACE_2("Tracking optics target draw", GVAR(currentTarget), GVAR(currentTargetPos));

View File

@ -0,0 +1,132 @@
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
//TRACE_1("enter", _this);
#define __TRACKINTERVAL 0.1 // how frequent the check should be.
#define __LOCKONTIME 1.85 // Lock on won't occur sooner
#define __LOCKONTIMERANDOM 0.3 // Deviation in lock on time
#define __SENSORSQUARE 1 // Locking on sensor square side in angles
#define __ConstraintTop (((ctrlPosition __JavelinIGUITargetingConstrainTop) select 1) + ((ctrlPosition (__JavelinIGUITargetingConstrainTop)) select 3))
#define __ConstraintBottom ((ctrlPosition __JavelinIGUITargetingConstrainBottom) select 1)
#define __ConstraintLeft (((ctrlPosition __JavelinIGUITargetingConstrainLeft) select 0) + ((ctrlPosition (__JavelinIGUITargetingConstrainLeft)) select 2))
#define __ConstraintRight ((ctrlPosition __JavelinIGUITargetingConstrainRight) select 0)
#define __OffsetX ((ctrlPosition __JavelinIGUITargetingLineV) select 0) - 0.5
#define __OffsetY ((ctrlPosition __JavelinIGUITargetingLineH) select 1) - 0.5
private["_args", "_lastTick", "_runTime", "_soundTime", "_lockTime", "_newTarget", "_currentTarget", "_range", "_pos", "_targetArray"];
// Reset arguments if we havnt rendered in over a second
_args = uiNamespace getVariable[QGVAR(arguments), [] ];
if( (count _args) > 0) then {
_lastTick = _args select 0;
if(diag_tickTime - _lastTick > 1) then {
[] call FUNC(onOpticLoad);
};
};
// Pull the arguments
_currentTarget = _args select 1;
_runTime = _args select 2;
_lockTime = _args select 3;
_soundTime = _args select 4;
// Find a target within the optic range
_newTarget = objNull;
// Bail on fast movement
if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} && {cameraOn == ACE_player}) exitWith { // keep it steady.
ACE_player switchCamera "INTERNAL";
};
// Only start locking on holding tab
if(!GVAR(isLockKeyDown)) exitWith { false };
_range = parseNumber (ctrlText __JavelinIGUIRangefinder);
if (_range > 50 && {_range < 2500}) then {
_pos = positionCameraToWorld [0,0,_range];
_targetArray = _pos nearEntities ["AllVehicles", _range/25];
if (count (_targetArray) > 0) then {
_newTarget = _targetArray select 0;
};
};
if (isNull _newTarget) then {
_newTarget = cursorTarget;
};
if (isNull _newTarget) then {
// No targets found
_currentTarget = objNull;
_lockTime = 0;
__JavelinIGUISeek ctrlSetTextColor __ColorGray;
__JavelinIGUINFOV ctrlSetTextColor __ColorGreen;
__JavelinIGUITargetingConstrains ctrlShow false;
__JavelinIGUITargetingGate ctrlShow false;
__JavelinIGUITargetingLines ctrlShow false;
ACE_player setVariable [QGVAR(currentTarget),nil, false];
// Disallow fire
//if (ACE_player ammo "Javelin" > 0 || {ACE_player ammo "ACE_Javelin_Direct" > 0}) then {ACE_player setWeaponReloadingTime //[player, "Javelin", 0.2];};
} else {
if (_newTarget distance ACE_player < 2500
// && {(call CBA_fnc_getFoV) select 1 > 7}
// && { (currentVisionMode ACE_player == 2)}
) then {
// Lock on after 3 seconds
if(_currentTarget != _newTarget) then {
TRACE_1("New Target, reseting locking", _newTarget);
_lockTime = diag_tickTime;
_currentTarget = _newTarget;
playSound "ACE_Javelin_Locking";
} else {
if(diag_tickTime - _lockTime > 3) then {
TRACE_2("LOCKED!", _currentTarget, _lockTime);
__JavelinIGUISeek ctrlSetTextColor __ColorGreen;
__JavelinIGUINFOV ctrlSetTextColor __ColorNull;
__JavelinIGUITargetingConstrains ctrlShow true;
ACE_player setVariable[QGVAR(currentTarget), _currentTarget, false];
ACE_player setVariable[QGVAR(currentTargetPos), getPosASL _currentTarget, false];
if(diag_tickTime > _soundTime) then {
playSound "ACE_Javelin_Locked";
_soundTime = diag_tickTime + 0.25;
};
} else {
if(diag_tickTime > _soundTime) then {
playSound "ACE_Javelin_Locking";
_soundTime = diag_tickTime + 0.25;
};
};
};
} else {
// Something is wrong with our seek
_currentTarget = objNull;
__JavelinIGUISeek ctrlSetTextColor __ColorGray;
__JavelinIGUINFOV ctrlSetTextColor __ColorGray;
__JavelinIGUITargetingConstrains ctrlShow false;
__JavelinIGUITargetingGate ctrlShow false;
__JavelinIGUITargetingLines ctrlShow false;
ACE_player setVariable [QGVAR(currentTarget),nil, false];
};
};
//TRACE_2("", _newTarget, _currentTarget);
// Save arguments for next run
_args set[0, diag_tickTime];
_args set[1, _currentTarget];
_args set[2, _runTime];
_args set[3, _lockTime];
_args set[4, _soundTime];
uiNamespace setVariable[QGVAR(arguments), _args ];

View File

@ -0,0 +1,17 @@
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
TRACE_1("enter", _this);
if((count _this) > 0) then {
uiNameSpace setVariable ['ACE_RscOptics_javelin',_this select 0];
};
uiNameSpace setVariable [QGVAR(arguments),
[
0, // Last runtime
objNull, // currentTargetObject
0, // Run Time
0, // Lock Time
0 // Sound timer
]
];

View File

@ -1,3 +1,7 @@
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
TRACE_1("enter", _this);
_object = _this select 0;
_origin = getPosASL _object;
_matrix = _this select 1;

View File

@ -1,3 +1,6 @@
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
TRACE_1("enter", _this);
_object = _this select 0;
_origin = getPosASL _object;

View File

@ -0,0 +1,30 @@
// by commy2
["ACE3", QGVAR(lockTarget), localize "STR_ACE_WEP_JAVELIN_LockTarget",
{
if (GETGVAR(isLockKeyDown,false)) exitWith {false};
GVAR(isLockKeyDown) = true;
// Statement
[ACE_player] call FUNC(lockKeyDown);
// Return false so it doesn't block the rest weapon action
false
},
{
// prevent holding down
GVAR(isLockKeyDown) = false;
// Statement
[ACE_player] call FUNC(lockKeyUp);
false
},
[15, [false, false, false]], false] call cba_fnc_addKeybind; //Tab Key
["ACE3", QGVAR(cycleFireMode), localize "STR_ACE_WEP_JAVELIN_CycleFireMode",
{ false },
{
[ACE_player] call FUNC(cycleFireMode);
false
},
[15, [false, true, false]], false] call cba_fnc_addKeybind; //Shift+Tab Key

View File

@ -10,3 +10,44 @@
#endif
#include "\z\ace\Addons\main\script_macros.hpp"
#define ACE_JAV_FIREMODE_DIR 1
#define ACE_JAV_FIREMODE_TOP 2
// Javelin IGUI defines
#define __JavelinIGUI (uinamespace getVariable "ACE_RscOptics_javelin")
// Custom controls
#define __JavelinIGUISeek (__JavelinIGUI displayCtrl 699000)
#define __JavelinIGUITop (__JavelinIGUI displayCtrl 699001)
#define __JavelinIGUIDir (__JavelinIGUI displayCtrl 699002)
#define __JavelinIGUINFOV (__JavelinIGUI displayCtrl 699003)
// Constrains
#define __JavelinIGUITargetingConstrains (__JavelinIGUI displayCtrl 699100)
#define __JavelinIGUITargetingConstrainTop (__JavelinIGUI displayCtrl 699101)
#define __JavelinIGUITargetingConstrainBottom (__JavelinIGUI displayCtrl 699102)
#define __JavelinIGUITargetingConstrainLeft (__JavelinIGUI displayCtrl 699103)
#define __JavelinIGUITargetingConstrainRight (__JavelinIGUI displayCtrl 699104)
// Targeting gate
#define __JavelinIGUITargetingGate (__JavelinIGUI displayCtrl 699200)
#define __JavelinIGUITargetingGateTL (__JavelinIGUI displayCtrl 699201)
#define __JavelinIGUITargetingGateTR (__JavelinIGUI displayCtrl 699202)
#define __JavelinIGUITargetingGateBL (__JavelinIGUI displayCtrl 699203)
#define __JavelinIGUITargetingGateBR (__JavelinIGUI displayCtrl 699204)
// Rangefinder
#define __JavelinIGUIRangefinder (__JavelinIGUI displayCtrl 151)
// Targeting lines
#define __JavelinIGUITargetingLines (__JavelinIGUI displayCtrl 699300)
#define __JavelinIGUITargetingLineH (__JavelinIGUI displayCtrl 699301)
#define __JavelinIGUITargetingLineV (__JavelinIGUI displayCtrl 699302)
// Colors for controls
#define __ColorOrange [0.9255,0.5216,0.1216,1]
#define __ColorGreen [0.2941,0.8745,0.2157,1]
#define __ColorGray [0.2941,0.2941,0.2941,1]
#define __ColorNull [0,0,0,0]

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-19 -->
<Project name="ACE">
<Package name="WEP_JAVELIN">
<Key ID="STR_ACE_WEP_JAVELIN_LockTarget">
<English>Lock Target (Hold)</English>
<German>Lock Target (Hold)</German>
<French>Lock Target (Hold)</French>
<Polish>Lock Target (Hold)</Polish>
<Czech>Lock Target (Hold)</Czech>
<Spanish>Lock Target (Hold)</Spanish>
<Russian>Lock Target (Hold)</Russian>
</Key>
<Key ID="STR_ACE_WEP_JAVELIN_CycleFireMode">
<English>Cycle Fire Mode</English>
<German>Cycle Fire Mode</German>
<French>Cycle Fire Mode</French>
<Polish>Cycle Fire Mode</Polish>
<Czech>Cycle Fire Mode</Czech>
<Spanish>Cycle Fire Mode</Spanish>
<Russian>Cycle Fire Mode</Russian>
</Key>
</Package>
</Project>

31
extensions/CMakeLists.txt Normal file
View File

@ -0,0 +1,31 @@
cmake_minimum_required (VERSION 3.0)
project (ACE)
if (NOT CMAKE_BUILD_TYPE AND CMAKE_COMPILER_IS_GNUCXX)
message(STATUS "No build type selected, default to Debug")
set(CMAKE_BUILD_TYPE "Debug")
endif()
option(USE_64BIT_BUILD "USE_64BIT_BUILD" OFF)
option(USE_STATIC_LINKING "USE_STATIC_LINKING" ON)
if(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS "-std=c++11 -march=i686 -m32 -O2 -s -fPIC -fpermissive")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(CMAKE_SHARED_LINKER_FLAGS "-static-libgcc -static-libstdc++")
else()
set(CMAKE_CXX_FLAGS_DEBUG "/D _DEBUG /MTd /Zi /Ob0 /Od /RTC1")
set(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG")
endif()
file(GLOB ACE_COMMON_SOURCES common/*.h common/*.hpp common/*.c common/*.cpp)
add_library(ace_common STATIC ${ACE_COMMON_SOURCES})
include_directories(AFTER "common")
# Add extensions to build here
add_subdirectory(fcs)
message("Build Type: ${CMAKE_BUILD_TYPE}")

4
extensions/build/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View File

@ -0,0 +1,4 @@
int test(int var) {
return var;
}

View File

@ -0,0 +1,4 @@
#pragma once
#include "targetver.h"

View File

@ -0,0 +1,8 @@
#pragma once
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#else
#endif

View File

@ -0,0 +1,11 @@
set(ACE_EXTENSION_NAME "ace_fcs")
file(GLOB SOURCES *.h *.hpp *.c *.cpp)
add_library( ${ACE_EXTENSION_NAME} SHARED ${SOURCES})
add_dependencies(${ACE_EXTENSION_NAME} ace_common)
SET_TARGET_PROPERTIES(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "")
if(CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_START_STATIC 1)
set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_END_STATIC 1)
endif()

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