Merge branch 'master' of https://github.com/KoffeinFlummi/ACE3 into ATragMX

This commit is contained in:
ulteq 2015-04-07 20:33:44 +02:00
commit 2dfc9d7919
350 changed files with 10092 additions and 6129 deletions

Binary file not shown.

View File

@ -1,5 +1,19 @@
class CfgAmmo { class CfgAmmo {
class BulletBase;
class B_20mm;
class ACE_20mm_HEDP : B_20mm {
hit = 80;
indirectHit = 12;
indirectHitRange = 2; //2;
caliber = 1.4;
tracerStartTime = 0.02;
timeToLive = 40;
explosive = 1.8;
};
// adjust minigun caliber and deflection to other ammo // adjust minigun caliber and deflection to other ammo
class SubmunitionBullet; class SubmunitionBullet;
class B_65x39_Minigun_Caseless: SubmunitionBullet { class B_65x39_Minigun_Caseless: SubmunitionBullet {
@ -13,7 +27,6 @@ class CfgAmmo {
}; };
// also adjust tracer, "muh lightshow"; also adjust splash damage radius // also adjust tracer, "muh lightshow"; also adjust splash damage radius
class BulletBase;
class Gatling_30mm_HE_Plane_CAS_01_F: BulletBase { class Gatling_30mm_HE_Plane_CAS_01_F: BulletBase {
hit = 80; hit = 80;
indirectHit = 12; indirectHit = 12;
@ -22,6 +35,7 @@ class CfgAmmo {
deflecting = 3; deflecting = 3;
fuseDistance = 3; fuseDistance = 3;
tracerStartTime = 0.02; tracerStartTime = 0.02;
timeToLive = 40;
}; };
// helper projectiles to simulate a rof > fps // helper projectiles to simulate a rof > fps

View File

@ -10,6 +10,7 @@ class CfgMagazines {
// an extended magazine for the comanche // an extended magazine for the comanche
class 300Rnd_20mm_shells; class 300Rnd_20mm_shells;
class ACE_500Rnd_20mm_shells_Comanche: 300Rnd_20mm_shells { class ACE_500Rnd_20mm_shells_Comanche: 300Rnd_20mm_shells {
ammo = "ACE_20mm_HEDP";
count = 500; count = 500;
}; };
}; };

View File

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

View File

@ -4,6 +4,23 @@ class Mode_Burst;
class Mode_FullAuto; class Mode_FullAuto;
class CfgWeapons { class CfgWeapons {
class RocketPods;
class ACE_AIR_SAFETY : RocketPods
{
CanLock = 0;
displayName = "SAFE";
displayNameMagazine = "SAFE";
shortNameMagazine = "SAFE";
nameSound = "cannon";
cursor = "EmptyCursor";
cursorAim = "EmptyCursor";
magazines[] = {"FakeMagazine"};
burst = 0;
reloadTime = 0.01;
magazineReloadTime = 0.1;
};
// Manual Switching Of Flare Mode // Manual Switching Of Flare Mode
class SmokeLauncher; class SmokeLauncher;
class CMFlareLauncher: SmokeLauncher { class CMFlareLauncher: SmokeLauncher {
@ -37,24 +54,24 @@ class CfgWeapons {
class manual: manual { class manual: manual {
reloadTime = 0.04; reloadTime = 0.04;
dispersion = 0.0022; dispersion = 0.006;
displayName = "$STR_ACE_Aircraft_gatling_20mm_Name"; displayName = "$STR_ACE_Aircraft_gatling_20mm_Name";
}; };
class close: close { class close: close {
reloadTime = 0.04; reloadTime = 0.04;
dispersion = 0.0022; dispersion = 0.006;
}; };
class short: short { class short: short {
reloadTime = 0.04; reloadTime = 0.04;
dispersion = 0.0022; dispersion = 0.006;
}; };
class medium: medium { class medium: medium {
reloadTime = 0.04; reloadTime = 0.04;
dispersion = 0.0022; dispersion = 0.006;
}; };
class far: far { class far: far {
reloadTime = 0.04; reloadTime = 0.04;
dispersion = 0.0022; dispersion = 0.006;
}; };
}; };

File diff suppressed because one or more lines are too long

View File

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

View File

@ -0,0 +1,581 @@
class RscControlsGroup;
class RscText;
class RangeText: RscText{};
class RscPicture;
class RscOpticsText;
class RscIGProgress;
class RscOpticsValue;
class VScrollbar;
class HScrollbar;
class RscLadderPicture;
class RscControlsGroupNoScrollbars;
class RscInGameUI
{
class RscUnitInfo;
class Rsc_ACE_Helo_UI_Turret: RscUnitInfo
{
idd = 300;
controls[] = {"CA_IGUI_elements_group","CA_VehicleToggles"};
class VScrollbar;
class HScrollbar;
class CA_IGUI_elements_group: RscControlsGroup
{
idc = 170;
class VScrollbar: VScrollbar
{
width = 0;
};
class HScrollbar: HScrollbar
{
height = 0;
};
x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))";
y = "0 * (0.025 * SafezoneH) + (SafezoneY)";
w = "53.5 * (0.01875 * SafezoneH)";
h = "40 * (0.025 * SafezoneH)";
class controls
{
class CA_Distance: RscText
{
idc = 151;
style = 2;
sizeEx = "0.0295*SafezoneH";
shadow = 0;
font = "EtelkaMonospacePro";
x = "24.78 * (0.01875 * SafezoneH)";
y = "30.88 * (0.025 * SafezoneH)";
w = "4 * (0.01875 * SafezoneH)";
h = "1.2 * (0.025 * SafezoneH)";
};
class CA_Speed: RangeText
{
idc = 188;
style = 2;
sizeEx = "0.0295*SafezoneH";
shadow = 0;
font = "EtelkaMonospacePro";
text = "120";
x = "14.78 * (0.01875 * SafezoneH)";
y = "30.88 * (0.025 * SafezoneH)";
w = "4 * (0.01875 * SafezoneH)";
h = "1.2 * (0.025 * SafezoneH)";
};
class CA_Alt: RangeText
{
idc = 189;
style = 2;
sizeEx = "0.0295*SafezoneH";
shadow = 0;
font = "EtelkaMonospacePro";
text = "3825";
x = "34.78 * (0.01875 * SafezoneH)";
y = "30.88 * (0.025 * SafezoneH)";
w = "4 * (0.01875 * SafezoneH)";
h = "1.2 * (0.025 * SafezoneH)";
};
class CA_VisionMode: RscText
{
idc = 152;
style = 0;
sizeEx = "0.0295*SafezoneH";
shadow = 0;
font = "EtelkaMonospacePro";
text = "VIS";
x = "12.58 * (0.01875 * SafezoneH)";
y = "8 * (0.025 * SafezoneH)";
w = "4 * (0.01875 * SafezoneH)";
h = "1.2 * (0.025 * SafezoneH)";
};
class CA_FlirMode: RscText
{
idc = 153;
style = 0;
sizeEx = "0.0295*SafezoneH";
shadow = 0;
font = "EtelkaMonospacePro";
text = "BHOT";
x = "15.78 * (0.01875 * SafezoneH)";
y = "8 * (0.025 * SafezoneH)";
w = "4.5 * (0.01875 * SafezoneH)";
h = "1.2 * (0.025 * SafezoneH)";
};
class ValueGrid: RangeText
{
idc = 172;
font = "EtelkaMonospacePro";
style = 2;
sizeEx = "0.0295*SafezoneH";
shadow = 0;
x = "12.20 * (0.01875 * SafezoneH)";
y = "3.5 * (0.025 * SafezoneH)";
w = "6 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
};
class TextTADS: RangeText
{
idc = 1010;
text = "TADS";
font = "EtelkaMonospacePro";
style = 2;
shadow = 0;
x = "12.30 * (0.01875 * SafezoneH)";
y = "5 * (0.025 * SafezoneH)";
w = "4 * (0.01875 * SafezoneH)";
h = "1.2 * (0.025 * SafezoneH)";
};
class ValueTime: RangeText
{
idc = 190;
text = "20:28:35";
font = "EtelkaMonospacePro";
style = 2;
sizeEx = "0.0295*SafezoneH";
shadow = 0;
x = "12.1 * (0.01875 * SafezoneH)";
y = "6.5 * (0.025 * SafezoneH)";
w = "6 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
};
class CA_Laser: RscText
{
idc = 158;
style = "0x30 + 0x800";
sizeEx = "0.038*SafezoneH";
shadow = 0;
font = "EtelkaMonospacePro";
text = PATHTOF(data\Helo_LaserON.paa);
x = "20.45 * (0.01875 * SafezoneH)";
y = "14.1 * (0.025 * SafezoneH)";
w = "12.5 * (0.01875 * SafezoneH)";
h = "12 * (0.025 * SafezoneH)";
};
class CA_Heading: RscText
{
idc = 156;
style = 0;
sizeEx = "0.038*SafezoneH";
shadow = 0;
font = "EtelkaMonospacePro";
text = "023";
x = "24.83 * (0.01875 * SafezoneH)";
y = "6 * (0.025 * SafezoneH)";
w = "4 * (0.01875 * SafezoneH)";
h = "1.2 * (0.025 * SafezoneH)";
};
};
};
};
class Rsc_ACE_Helo_UI_01: RscUnitInfo
{
controls[] = {"WeaponInfoControlsGroupRight","CA_TextFlaresMode","CA_TextFlares","CA_VehicleToggles","CA_Radar"};
};
class Rsc_ACE_Helo_UI_02: RscUnitInfo
{
controls[] = {"CA_TextFlaresMode","CA_TextFlares","CA_VehicleToggles","CA_Radar"};
};
class Rsc_ACE_Drones_UI_Turret: RscUnitInfo
{
idd = 300;
controls[] = {"CA_Zeroing","CA_IGUI_elements_group","CA_VehicleToggles"};
class CA_IGUI_elements_group: RscControlsGroup
{
idc = 170;
class VScrollbar: VScrollbar
{
width = 0;
};
class HScrollbar: HScrollbar
{
height = 0;
};
x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))";
y = "0 * (0.025 * SafezoneH) + (SafezoneY)";
w = "53.5 * (0.01875 * SafezoneH)";
h = "40 * (0.025 * SafezoneH)";
class controls
{
class CA_Distance: RscText
{
idc = 151;
style = 2;
sizeEx = "0.0295*SafezoneH";
shadow = 0;
font = "EtelkaMonospacePro";
x = "24.78 * (0.01875 * SafezoneH)";
y = "30.88 * (0.025 * SafezoneH)";
w = "4 * (0.01875 * SafezoneH)";
h = "1.2 * (0.025 * SafezoneH)";
};
class CA_Speed: RangeText
{
idc = 188;
style = 2;
sizeEx = "0.0295*SafezoneH";
shadow = 0;
font = "EtelkaMonospacePro";
text = "120";
x = "14.78 * (0.01875 * SafezoneH)";
y = "30.88 * (0.025 * SafezoneH)";
w = "4 * (0.01875 * SafezoneH)";
h = "1.2 * (0.025 * SafezoneH)";
};
class CA_Alt: RangeText
{
idc = 189;
style = 2;
sizeEx = "0.0295*SafezoneH";
shadow = 0;
font = "EtelkaMonospacePro";
text = "3825";
x = "34.78 * (0.01875 * SafezoneH)";
y = "30.88 * (0.025 * SafezoneH)";
w = "4 * (0.01875 * SafezoneH)";
h = "1.2 * (0.025 * SafezoneH)";
};
class ValueTime: RangeText
{
idc = 190;
text = "20:28:35";
font = "EtelkaMonospacePro";
style = 2;
sizeEx = "0.0295*SafezoneH";
shadow = 0;
x = "1.75 * (0.01875 * SafezoneH)";
y = "10.5 * (0.025 * SafezoneH)";
w = "6 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
};
class CA_VisionMode: RscText
{
idc = 152;
style = 0;
sizeEx = "0.0295*SafezoneH";
shadow = 0;
font = "EtelkaMonospacePro";
text = "VIS";
align = "right";
x = "2.6 * (0.01875 * SafezoneH)";
y = "12.0 * (0.025 * SafezoneH)";
w = "4 * (0.01875 * SafezoneH)";
h = "1.0 * (0.025 * SafezoneH)";
};
class CA_FlirMode: RscText
{
idc = 153;
style = 0;
sizeEx = "0.0295*SafezoneH";
shadow = 0;
font = "EtelkaMonospacePro";
text = "BHOT";
align = "right";
x = "6.18 * (0.01875 * SafezoneH)";
y = "12.0 * (0.025 * SafezoneH)";
w = "4.5 * (0.01875 * SafezoneH)";
h = "1.0 * (0.025 * SafezoneH)";
};
class TgT_Grid_text: RangeText
{
idc = 1005;
text = "TGT:";
font = "EtelkaMonospacePro";
style = 2;
sizeEx = "0.0295*SafezoneH";
shadow = 0;
x = "1.20 * (0.01875 * SafezoneH)";
y = "13.5 * (0.025 * SafezoneH)";
w = "6 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
};
class TGT_ValueGrid: RangeText
{
idc = 172;
font = "EtelkaMonospacePro";
colorText[] = {0.706,0.0745,0.0196,0.8};
style = 2;
sizeEx = "0.0295*SafezoneH";
shadow = 0;
x = "5.20 * (0.01875 * SafezoneH)";
y = "13.5 * (0.025 * SafezoneH)";
w = "6 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
};
class OWN_Grid_text: RangeText
{
idc = 1005;
text = "OWN:";
font = "EtelkaMonospacePro";
style = 2;
sizeEx = "0.0295*SafezoneH";
shadow = 0;
x = "1.20 * (0.01875 * SafezoneH)";
y = "15 * (0.025 * SafezoneH)";
w = "6 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
};
class OWN_ValueGrid: RangeText
{
idc = 171;
font = "EtelkaMonospacePro";
colorText[] = {0.15,1,0.15,0.8};
style = 2;
sizeEx = "0.0295*SafezoneH";
shadow = 0;
x = "5.20 * (0.01875 * SafezoneH)";
y = "15 * (0.025 * SafezoneH)";
w = "6 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
};
class CA_Laser: RscText
{
idc = 158;
style = "0x30 + 0x800";
sizeEx = "0.038*SafezoneH";
shadow = 0;
align = "right";
font = "EtelkaMonospacePro";
text = PATHTOF(data\Helo_LaserON.paa);
x = "20.45 * (0.01875 * SafezoneH)";
y = "14.1 * (0.025 * SafezoneH)";
w = "12.5 * (0.01875 * SafezoneH)";
h = "12 * (0.025 * SafezoneH)";
};
class CA_Heading: RscText
{
idc = 156;
style = 0;
sizeEx = "0.038*SafezoneH";
shadow = 0;
font = "EtelkaMonospacePro";
text = "023";
align = "right";
x = "25 * (0.01875 * SafezoneH)";
y = "5 * (0.025 * SafezoneH)";
w = "4 * (0.01875 * SafezoneH)";
h = "1.2 * (0.025 * SafezoneH)";
};
};
};
};
class Rsc_ACE_Drones_UI_Pilots: RscUnitInfo
{
idd = 300;
controls[] = {"WeaponInfoControlsGroupRight","CA_BackgroundVehicle","CA_BackgroundVehicleTitle","CA_BackgroundVehicleTitleDark","CA_BackgroundFuel","CA_Vehicle","CA_VehicleRole","CA_HitZones","CA_SpeedBackground","CA_SpeedUnits","CA_Speed","CA_ValueFuel","CA_AltBackground","CA_AltUnits","CA_Alt","CA_VehicleToggles","CA_Radar","DriverOpticsGroup"};
class DriverOpticsGroup: RscControlsGroup
{
idc = 392;
class VScrollbar: VScrollbar
{
width = 0;
};
class HScrollbar: HScrollbar
{
height = 0;
};
x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))";
y = "0 * (0.025 * SafezoneH) + (SafezoneY)";
w = "53.5 * (0.01875 * SafezoneH)";
h = "40 * (0.025 * SafezoneH)";
class controls
{
class TextGrid: RscText
{
style = 0;
sizeEx = "0.02*SafezoneH";
shadow = 0;
font = "EtelkaMonospacePro";
idc = 1005;
text = "GRID:";
x = "5.8 * (0.01875 * SafezoneH)";
y = "31.8 * (0.025 * SafezoneH)";
w = "5 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
};
class ValueGrid: TextGrid
{
idc = 189;
text = "382546";
x = "10.3 * (0.01875 * SafezoneH)";
y = "31.8 * (0.025 * SafezoneH)";
w = "6 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
};
class TextTime: TextGrid
{
idc = 1010;
text = "TIME [UTC]:";
x = "5.8 * (0.01875 * SafezoneH)";
y = "32.6 * (0.025 * SafezoneH)";
w = "5 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
};
class ValueTime: TextGrid
{
idc = 101;
text = "20:28:35";
x = "10 * (0.01875 * SafezoneH)";
y = "32.6 * (0.025 * SafezoneH)";
w = "6 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
};
class TextMag: TextGrid
{
idc = 1011;
text = "CAM MAG:";
x = "5.8 * (0.01875 * SafezoneH)";
y = "7 * (0.025 * SafezoneH)";
w = "5 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
};
class OpticsZoom: TextGrid
{
idc = 192;
text = "28x";
x = "10.3 * (0.01875 * SafezoneH)";
y = "7 * (0.025 * SafezoneH)";
w = "6 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
};
class BorderLineSpdTop: RscPicture
{
idc = 1203;
text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\border_line_ca.paa";
x = "3.343 * (0.01875 * SafezoneH)";
y = "12.4 * (0.025 * SafezoneH)";
w = "3 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
};
class BorderLineSpdBottom: RscPicture
{
idc = 1207;
text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\border_line_ca.paa";
x = "3.343 * (0.01875 * SafezoneH)";
y = "26.5 * (0.025 * SafezoneH)";
w = "3 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
};
class BorderLineAltTop: RscPicture
{
idc = 1205;
text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\border_line_ca.paa";
x = "47.16 * (0.01875 * SafezoneH)";
y = "12.4 * (0.025 * SafezoneH)";
w = "3 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
};
class BorderLineAltBottom: RscPicture
{
idc = 1206;
text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\border_line_ca.paa";
x = "47.16 * (0.01875 * SafezoneH)";
y = "26.5 * (0.025 * SafezoneH)";
w = "3 * (0.01875 * SafezoneH)";
h = "1 * (0.025 * SafezoneH)";
};
class TextSpd: TextGrid
{
idc = 1004;
text = "SPD";
x = "4.8 * (0.01875 * SafezoneH)";
y = "11.8 * (0.025 * SafezoneH)";
w = "5 * (0.01875 * SafezoneH)";
h = "1.2 * (0.025 * SafezoneH)";
};
class SpeedValueBorder: RscPicture
{
idc = 1200;
text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\altimeter_value_ca.paa";
x = "6.3 * (0.01875 * SafezoneH)";
y = "19 * (0.025 * SafezoneH)";
w = "5 * (0.01875 * SafezoneH)";
h = "2 * (0.025 * SafezoneH)";
};
class CA_Speed: TextGrid
{
idc = 190;
sizeEx = "0.03*SafezoneH";
text = "120";
x = "7.5 * (0.01875 * SafezoneH)";
y = "19.5 * (0.025 * SafezoneH)";
w = "6 * (0.01875 * SafezoneH)";
h = "1.2 * (0.025 * SafezoneH)";
};
class AnalogueSpeed: RscLadderPicture
{
idc = 384;
topValue = 1312;
bottomValue = -345;
visibleRange = -1;
text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\UAVspeedLadder_ca.paa";
x = "1.5 * (0.01875 * SafezoneH)";
y = "13 * (0.025 * SafezoneH)";
w = "5 * (0.01875 * SafezoneH)";
h = "14 * (0.025 * SafezoneH)";
};
class TextAlt: TextGrid
{
idc = 1006;
text = "ALT";
x = "46.9 * (0.01875 * SafezoneH)";
y = "11.8 * (0.025 * SafezoneH)";
w = "5 * (0.01875 * SafezoneH)";
h = "1.2 * (0.025 * SafezoneH)";
};
class AltValueBorder: RscPicture
{
idc = 1201;
text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\airspeed_value_ca.paa";
x = "42.25 * (0.01875 * SafezoneH)";
y = "19 * (0.025 * SafezoneH)";
w = "5 * (0.01875 * SafezoneH)";
h = "2 * (0.025 * SafezoneH)";
};
class CA_Alt: TextGrid
{
idc = 191;
sizeEx = "0.03*SafezoneH";
style = 1;
text = "3825";
x = "43 * (0.01875 * SafezoneH)";
y = "19.5 * (0.025 * SafezoneH)";
w = "3.2 * (0.01875 * SafezoneH)";
h = "1.2 * (0.025 * SafezoneH)";
};
class AnalogueAlt: RscLadderPicture
{
idc = 385;
topValue = 14430;
bottomValue = -2110;
visibleRange = -1;
text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\UAValtLadder_ca.paa";
x = "47 * (0.01875 * SafezoneH)";
y = "13 * (0.025 * SafezoneH)";
w = "2.5 * (0.01875 * SafezoneH)";
h = "14 * (0.025 * SafezoneH)";
};
class AnalogueHorizon: RscLadderPicture
{
idc = 383;
topValue = 90;
bottomValue = -90;
visibleRange = -1;
text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\horizon_ladder_ca.paa";
x = "16.75 * (0.01875 * SafezoneH)";
y = "5 * (0.025 * SafezoneH)";
w = "20 * (0.01875 * SafezoneH)";
h = "30 * (0.025 * SafezoneH)";
};
class HorizonCenter: RscPicture
{
idc = 1202;
text = "\A3\Ui_f\data\IGUI\Cfg\HelicopterHUD\horizon_aircraft_ca.paa";
x = "24.75 * (0.01875 * SafezoneH)";
y = "19 * (0.025 * SafezoneH)";
w = "4 * (0.01875 * SafezoneH)";
h = "2 * (0.025 * SafezoneH)";
};
};
};
};
};

View File

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

Binary file not shown.

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,20 @@
class CfgAmmo {
class BulletCore;
class BulletBase: BulletCore {
timeToLive = 15; // Default: 6, doubleplusgood all munition range.
};
class B_20mm : BulletBase {
timeToLive = 30;
};
class B_25mm : BulletBase {
timeToLive = 30;
};
class B_35mm_AA : BulletBase {
timeToLive = 30;
};
class B_30mm_AP : BulletBase {
timeToLive = 30;
};
};

View File

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

View File

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

View File

@ -73,6 +73,16 @@ PREP(getStringFromMissionSQM);
PREP(getTargetAzimuthAndInclination); PREP(getTargetAzimuthAndInclination);
PREP(getTargetDistance); PREP(getTargetDistance);
PREP(getTargetObject); PREP(getTargetObject);
PREP(getTurnedOnLights);
PREP(getTurretCommander);
PREP(getTurretConfigPath);
PREP(getTurretCopilot);
PREP(getTurretGunner);
PREP(getTurretIndex);
PREP(getTurrets);
PREP(getTurretsFFV);
PREP(getTurretsOther);
PREP(getTurretDirection);
PREP(getUavControlPosition); PREP(getUavControlPosition);
PREP(getVehicleCargo); PREP(getVehicleCargo);
PREP(getVehicleCodriver); PREP(getVehicleCodriver);
@ -102,6 +112,7 @@ PREP(isModLoaded);
PREP(isPlayer); PREP(isPlayer);
PREP(isTurnedOut); PREP(isTurnedOut);
PREP(letterToCode); PREP(letterToCode);
PREP(lightIntensityFromObject);
PREP(loadPerson); PREP(loadPerson);
PREP(loadPersonLocal); PREP(loadPersonLocal);
PREP(loadSettingsFromProfile); PREP(loadSettingsFromProfile);
@ -113,6 +124,7 @@ PREP(moveToTempGroup);
PREP(muteUnit); PREP(muteUnit);
PREP(numberToDigits); PREP(numberToDigits);
PREP(numberToDigitsString); PREP(numberToDigitsString);
PREP(numberToString);
PREP(onAnswerRequest); PREP(onAnswerRequest);
PREP(onLoadRscDisplayChannel); PREP(onLoadRscDisplayChannel);
PREP(owned); PREP(owned);
@ -179,6 +191,8 @@ PREP(getConfigGunner);
PREP(getConfigCommander); PREP(getConfigCommander);
PREP(getHitPoints); PREP(getHitPoints);
PREP(getHitPointsWithSelections); PREP(getHitPointsWithSelections);
PREP(getReflectorsWithSelections);
PREP(getLightProperties);
PREP(getVehicleCrew); PREP(getVehicleCrew);
// turrets // turrets

View File

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

View File

@ -11,4 +11,4 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
sunOrMoon * sunOrMoon * (1 - overcast * 0.25) + (moonIntensity/5 min 1) * (1 - overcast) (sunOrMoon * sunOrMoon * (1 - overcast * 0.25) + (moonIntensity/5) * (1 - overcast)) min 1

View File

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

View File

@ -19,40 +19,35 @@ private ["_projectile", "_adjustDir", "_adjustUp", "_adjustSpeed", "_vdir", "_di
_projectile = _this select 0; _projectile = _this select 0;
_adjustDir = _this select 1; _adjustDir = _this select 1;
_adjustUp = _this select 2; _adjustUp = _this select 2;
_adjustSpeed = _this select 3;
if (isNil "_adjustSpeed") then { _adjustSpeed = if (count _this > 3) then {
_adjustSpeed = 0; _this select 3
} else {
0
}; };
["CPD", [_fnc_scriptNameParent, _adjustDir, _adjustUp, _adjustSpeed], nil, false] call FUNC(log); ["CPD", [_fnc_scriptNameParent, _adjustDir, _adjustUp, _adjustSpeed], nil, false] call FUNC(log);
// get old direction vector // get old direction vector
_vdir = vectorDir _projectile; _vdir = vectorNormalized velocity _projectile;
// get azimuth and inclination and apply corrections // get azimuth and inclination and apply corrections
_dir = (_vdir select 0) atan2 (_vdir select 1) + _adjustDir; _dir = (_vdir select 0) atan2 (_vdir select 1) + _adjustDir;
_up = sqrt ((_vdir select 1) ^ 2 + (_vdir select 0) ^ 2) atan2 - (_vdir select 2) + _adjustUp; _up = asin (_vdir select 2) + _adjustUp;
// get new direction vector (this is a unit vector) // get new direction vector (this is a unit vector)
_vdir = [ _vdir = [
sin _dir * sin _up, sin _dir * cos _up,
cos _dir * sin _up, cos _dir * cos _up,
- cos _up sin _up
]; ];
// get best up vector // get best up vector
_l = sqrt ((_vdir select 0) ^ 2 + (_vdir select 1) ^ 2); if (_l == 0) then {diag_log text format ["[ACE] ERROR: %1, %2, %3, %4, %5, %6, %7", _projectile, _adjustDir, _adjustUp, vectorDir _projectile, _vdir, _dir, _up]}; _vlat = vectorNormalized (_vdir vectorCrossProduct [0,0,1]);
_r = -(_vdir select 2) / _l; _vup = _vlat vectorCrossProduct _vdir;
_vup = [
(_vdir select 0) * _r,
(_vdir select 1) * _r,
_l
];
// get new speed vector. Keep total speed, but change to new direction. Yay for vector commands. // get new speed vector. Keep total speed, but change to new direction. Yay for vector commands.
_vel = _vdir vectorMultiply _adjustSpeed + vectorMagnitude velocity _projectile; _vel = _vdir vectorMultiply (_adjustSpeed + vectorMagnitude velocity _projectile);
// set projectile direction dir and up. Projectiles are long objects, especially with tracers, so it would look dumb otherwise. // set projectile direction dir and up. Projectiles are long objects, especially with tracers, so it would look dumb otherwise.
_projectile setVectorDirAndUp [_vdir, _vup]; _projectile setVectorDirAndUp [_vdir, _vup];

View File

@ -0,0 +1,63 @@
/*
* Author: commy2
* Read properties of given vehicles light.
*
* Arguments:
* 0: Object with lights (Object)
* 1: Light classname (String)
*
* Return Value:
* Stuff from config (Array)
*
*/
#include "script_component.hpp"
private ["_vehicle", "_light"];
_vehicle = _this select 0;
_light = _this select 1;
private "_config";
_config = configFile >> "CfgVehicles" >> typeOf _vehicle >> "Reflectors" >> _light;
private ["_intensity", "_position", "_direction", "_innerAngle", "_outerAngle"];
_intensity = getNumber (_config >> "intensity");
_position = getText (_config >> "position");
_direction = getText (_config >> "direction");
_innerAngle = getNumber (_config >> "innerAngle");
_outerAngle = getNumber (_config >> "outerAngle");
[_intensity, _position, _direction, _innerAngle, _outerAngle]
/*
class Reflectors
{
class Light_1
{
color[] = {1000,1000,1100};
ambient[] = {10,10,11};
intensity = 5;
size = 1;
innerAngle = 90;
outerAngle = 130;
coneFadeCoef = 2;
position = "Light_1_pos";
direction = "Light_1_dir";
hitpoint = "Light_1_hitpoint";
selection = "Light_1_hide";
useFlare = 1;
flareSize = 0.9;
flareMaxDistance = 85;
class Attenuation
{
start = 0;
constant = 0;
linear = 0;
quadratic = 0.9;
hardLimitStart = 40;
hardLimitEnd = 60;
};
};
};
*/

View File

@ -0,0 +1,45 @@
/*
* Author: commy2
*
* Returns all lighting hitpoints of any vehicle.
* Note: These are actual selections that are affected by setHit and getHit, not getHitPointDamage or setHitpointDamage.
* They behave like having an armor value of 0.
*
* Arguments:
* 0: A vehicle, not the classname (Object)
*
* Return Value:
* The light names and selections (Array)
*/
#include "script_component.hpp"
private ["_vehicle", "_config", "_hitpoints", "_selections"];
_vehicle = _this select 0;
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_hitpoints = [];
_selections = [];
// iterate through all parents
while {isClass _config} do {
private "_class";
_class = _config >> "Reflectors";
for "_i" from 0 to (count _class - 1) do {
private ["_entry", "_selection"];
_entry = _class select _i;
_selection = getText (_entry >> "hitpoint");
if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then {
_hitpoints pushBack configName _entry;
_selections pushBack _selection;
};
};
_config = inheritsFrom _config;
};
[_hitPoints, _selections]

View File

@ -0,0 +1,36 @@
/*
* Author: commy2
*
* Returns all turned on lights of any vehicle or streetlamp.
*
* Arguments:
* 0: A vehicle, not the classname (Object)
*
* Return Value:
* All burning lights (Array)
*/
#include "script_component.hpp"
private "_vehicle";
_vehicle = _this select 0;
if (!isLightOn _vehicle) exitWith {[]};
private ["_reflectorsWithSelections", "_lights", "_hitpoints"];
_reflectorsWithSelections = [_vehicle] call FUNC(getReflectorsWithSelections);
_lights = _reflectorsWithSelections select 0;
_hitpoints = _reflectorsWithSelections select 1;
private "_turnedOnLights";
_turnedOnLights = [];
{
if (_vehicle getHit _x <= 0.9) then {
_turnedOnLights pushBack (_lights select _forEachIndex);
};
} forEach _hitpoints;
_turnedOnLights

View File

@ -0,0 +1,37 @@
/*
* Author: jaynus
*
* Get the absolute turret direction for FOV/PIP turret.
*
* Argument:
* 0: Vehicle (Object)
* 1: Turret Position
*
* Return value:
* [position, direction]
*/
#include "script_component.hpp"
EXPLODE_2_PVT(_this,_vehicle,_position);
private ["_turrets", "_turret", "_config", "_turret", "_povPos", "_povDir", "_gunBeginPos", "_gunEndPos", "_pov"];
_turret = [_vehicle, _position] call CBA_fnc_getTurret;
_pov = getText (_turret >> "memoryPointGunnerOptics");
_gunBeg = getText (_turret >> "gunBeg");
_gunEnd = getText (_turret >> "gunEnd");
TRACE_3("", _pov, _gunBeg, _gunEnd);
// Pull the PIP pov or barrel direction, depending on how the model is set up
_povPos = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition _pov ) );
_povDir = [0,0,0];
if(_pov == "pip0_pos") then {
_pipDir = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition "pip0_dir" ) );
_povDir = _pipDir vectorDiff _povPos;
} else {
_gunBeginPos = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition _gunBeg ) );
_gunEndPos = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition _gunEnd ) );
_povDir = _gunBeginPos vectorDiff _gunEndPos;
};
[_povPos, _povDir]

View File

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

View File

@ -0,0 +1,56 @@
/*
* Author: commy2
* Calculate light intensity object 1 recieves from object 2
*
* Arguments:
* 0: Object that recieves light (Object)
* 1: Object that emits light (Object)
*
* Return Value:
* Brightest light level
*
*/
#include "script_component.hpp"
private ["_unit", "_lightSource"];
_unit = _this select 0;
_lightSource = _this select 1;
private "_unitPos";
_unitPos = _unit modelToWorld (_unit selectionPosition "spine3");
private ["_lights", "_lightLevel"];
_lights = [_lightSource] call FUNC(getTurnedOnLights);
_lightLevel = 0;
{
private ["_properties", "_intensity", "_innerAngle", "_outerAngle", "_position", "_direction", "_directionToUnit", "_distance", "_angle"];
_properties = [_lightSource, _x] call FUNC(getLightProperties);
// @todo intensity affects range?
//_intensity = _properties select 0;
_innerAngle = (_properties select 3) / 2;
_outerAngle = (_properties select 4) / 2;
// get world position and direction
_position = _lightSource modelToWorld (_lightSource selectionPosition (_properties select 1));
_direction = _lightSource modelToWorld (_lightSource selectionPosition (_properties select 2));
_direction = _position vectorFromTo _direction;
_directionToUnit = _position vectorFromTo _unitPos;
_distance = _unitPos distance _position;
_angle = acos (_direction vectorDotProduct _directionToUnit);
_lightLevel = _lightLevel max ((linearConversion [0, 30, _distance, 1, 0, true]) * (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true]));
//systemChat format ["%1 %2", (linearConversion [0, 30, _distance, 1, 0, true]), (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true])];
} forEach _lights;
_lightLevel

View File

@ -15,11 +15,13 @@
GVAR(settings) = []; GVAR(settings) = [];
// Load settings from main config _parseConfigForSettings = {
_countOptions = count (configFile >> "ACE_Settings"); private ["_config", "_countOptions", "_optionEntry", "_index"];
for "_index" from 0 to (_countOptions - 1) do {
_optionEntry = (configFile >> "ACE_Settings") select _index;
_config = _this select 0;
_countOptions = count _config;
for "_index" from 0 to (_countOptions - 1) do {
_optionEntry = _config select _index;
[_optionEntry] call FUNC(setSettingFromConfig); [_optionEntry] call FUNC(setSettingFromConfig);
}; };
// Check if all settings should be forced // Check if all settings should be forced
@ -28,38 +30,22 @@ if (GVAR(forceAllSettings)) then {
_x set [6, true]; _x set [6, true];
} forEach GVAR(settings); } forEach GVAR(settings);
}; };
};
// @todo // Order is this way because:
// Load settings from server userconfig only if the ACE_ServerSettings is loaded // ACE_Settings should never force any setting by default. Loading it first ensures that all settings from ACE_Settings exist.
/*if (isClass (configFile >> "CfgPatches" >> "ACE_ServerSettings")) then { // This way, ACE_ServerSettings will override ACE_Settings, even if no force is used.
DFUNC(serverUserConfig) = compile preprocessFileLineNumbers "\userconfig\ACE\ACE_Settings.hpp"; // Mission settings will override the server config settings, if no force is used.
if !(isNil DFUNC(serverUserConfig)) then { // This ensures that all settings are of their correct type, in case an outdated or corrupt server config is used , as well as have their correct localized display name and description
[] call FUNC(serverUserConfig);
};
// Check if all settings should be forced
if (GVAR(forceAllSettings)) then {
{
if !(missionNamespace getVariable format ["%1_forced", _x]) then {
missionNamespace setVariable format ["%1_forced", _x, true];
publicVariable format ["%1_forced", _name];
};
} forEach GVAR(settingsList);
};
};*/
// Load settings from mission config // Regular config
_countOptions = count (missionConfigFile >> "ACE_Settings"); [configFile >> "ACE_Settings"] call _parseConfigForSettings;
for "_index" from 0 to (_countOptions - 1) do {
_optionEntry = (missionConfigFile >> "ACE_Settings") select _index;
[_optionEntry] call FUNC(setSettingFromConfig); // Server config
}; [configFile >> "ACE_ServerSettings"] call _parseConfigForSettings;
// Check if all settings should be forced
if (GVAR(forceAllSettings)) then { // mission side settings
{ [missionConfigFile >> "ACE_Settings"] call _parseConfigForSettings;
_x set [6, true];
} forEach GVAR(settings);
};
// Publish all settings data // Publish all settings data
publicVariable QGVAR(settings); publicVariable QGVAR(settings);

View File

@ -0,0 +1,25 @@
/*
* Author: commy2
*
* Converts a number to a string without losing as much precission as str or format.
*
* Argument:
* 0: A number (Number)
*
* Return value:
* The number as string (String)
*/
#include "script_component.hpp"
private ["_number", "_decimals"];
_number = _this select 0;
_decimals = str (abs(_number) mod 1);
_decimals = toArray _decimals;
_decimals deleteAt 0;
if (_number < 0) exitWith {
format ["-%1%2", floor abs(_number), toString _decimals];
};
format ["%1%2", floor _number, toString _decimals];

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-16 --> <!-- Edited with tabler - 2015-04-06 -->
<Project name="ACE"> <Project name="ACE">
<Package name="Common"> <Package name="Common">
<Key ID="STR_ACE_Common_ACETeam"> <Key ID="STR_ACE_Common_ACETeam">
@ -296,24 +296,24 @@
<Hungarian>Nincs hang</Hungarian> <Hungarian>Nincs hang</Hungarian>
</Key> </Key>
<Key ID="STR_ACE_ACTION_ACCEPT_REQUEST_KEY_TITLE"> <Key ID="STR_ACE_ACTION_ACCEPT_REQUEST_KEY_TITLE">
<Original>Accept Requests</Original>
<Polish>Akceptuj prośby</Polish> <Polish>Akceptuj prośby</Polish>
<Spanish>Aceptar Peticiones</Spanish> <Spanish>Aceptar Peticiones</Spanish>
<English>Accept Requests</English>
</Key> </Key>
<Key ID="STR_ACE_ACTION_DECLINE_REQUEST_KEY_TITLE"> <Key ID="STR_ACE_ACTION_DECLINE_REQUEST_KEY_TITLE">
<Original>Decline Requests</Original>
<Polish>Ignoruj prośby</Polish> <Polish>Ignoruj prośby</Polish>
<Spanish>Rechazar Peticiones</Spanish> <Spanish>Rechazar Peticiones</Spanish>
<English>Decline Requests</English>
</Key> </Key>
<Key ID="STR_ACE_ACTION_ACCEPT_REQUEST_KEY_TOOLTIP"> <Key ID="STR_ACE_ACTION_ACCEPT_REQUEST_KEY_TOOLTIP">
<Original>Accept Requests send by other players. These can be requests to use / share equipment, perform certain actions.</Original>
<Polish>Akceptuj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności.</Polish> <Polish>Akceptuj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności.</Polish>
<Spanish>Acepta Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones.</Spanish> <Spanish>Acepta Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones.</Spanish>
<English>Accept Requests send by other players. These can be requests to use / share equipment, perform certain actions.</English>
</Key> </Key>
<Key ID="STR_ACE_ACTION_DECLINE_REQUEST_KEY_TOOLTIP"> <Key ID="STR_ACE_ACTION_DECLINE_REQUEST_KEY_TOOLTIP">
<Original>Decline Requests send by other players. These can be requests to use / share equipment, perform certain actions.</Original>
<Polish>Ignoruj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności.</Polish> <Polish>Ignoruj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności.</Polish>
<Spanish>Rechazar Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones.</Spanish> <Spanish>Rechazar Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones.</Spanish>
<English>Decline Requests send by other players. These can be requests to use / share equipment, perform certain actions.</English>
</Key> </Key>
<Key ID="STR_ACE_Common_SettingFeedbackIconsName"> <Key ID="STR_ACE_Common_SettingFeedbackIconsName">
<English>Feedback icons</English> <English>Feedback icons</English>
@ -339,7 +339,6 @@
<Key ID="STR_ACE_Common_SettingDisplayTextFontColorDesc"> <Key ID="STR_ACE_Common_SettingDisplayTextFontColorDesc">
<English>The color of the text font from the ACE hints. This color is the default color for all text displayed through the ACE Hint system, if the hint text has no other color specified.</English> <English>The color of the text font from the ACE hints. This color is the default color for all text displayed through the ACE Hint system, if the hint text has no other color specified.</English>
</Key> </Key>
<Key ID="STR_ACE_Common_bananaDisplayName"> <Key ID="STR_ACE_Common_bananaDisplayName">
<English>Banana</English> <English>Banana</English>
</Key> </Key>
@ -347,5 +346,4 @@
<English>A banana is an edible fruit, botanically a berry, produced by several kinds of large herbaceous flowering plants in the genus Musa.</English> <English>A banana is an edible fruit, botanically a berry, produced by several kinds of large herbaceous flowering plants in the genus Musa.</English>
</Key> </Key>
</Package> </Package>
</Project> </Project>

View File

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

View File

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

View File

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

View File

@ -1,13 +1,12 @@
class CfgVehicles { class CfgVehicles {
class Man; class Man;
class CAManBase: Man { class CAManBase: Man {
class ACE_SelfActions { class ACE_SelfActions {
class ACE_Explosives { class ACE_Explosives {
displayName = $STR_ACE_Explosives_Menu; displayName = $STR_ACE_Explosives_Menu;
condition = QUOTE(!(_player getVariable [ARR_2('ace_explosives_PlantingExplosive',false)])); condition = QUOTE(!(_player getVariable [ARR_2('ace_explosives_PlantingExplosive',false)]));
statement = ""; statement = "";
exceptions[] = {"isNotSwimming"}; exceptions[] = {"isNotSwimming", "isNotInside"};
showDisabled = 1; showDisabled = 1;
priority = 4; priority = 4;
icon = PATHTOF(UI\Explosives_Menu_ca.paa); icon = PATHTOF(UI\Explosives_Menu_ca.paa);
@ -16,8 +15,9 @@ class CfgVehicles {
class ACE_Detonate { class ACE_Detonate {
displayName = $STR_ACE_Explosives_Detonate; displayName = $STR_ACE_Explosives_Detonate;
condition = QUOTE([_player] call FUNC(canDetonate)); condition = QUOTE([_player] call FUNC(canDetonate));
statement = QUOTE([_player] call FUNC(openTransmitterUI);); statement = "";
exceptions[] = {"isNotSwimming"}; insertChildren = QUOTE([_player] call FUNC(addTransmitterActions););
exceptions[] = {"isNotSwimming", "isNotInside"};
showDisabled = 1; showDisabled = 1;
icon = PATHTOF(UI\Explosives_Menu_ca.paa); icon = PATHTOF(UI\Explosives_Menu_ca.paa);
priority = 2; priority = 2;
@ -26,28 +26,19 @@ class CfgVehicles {
class ACE_Place { class ACE_Place {
displayName = $STR_ACE_Explosives_Place; displayName = $STR_ACE_Explosives_Place;
condition = QUOTE((vehicle _player == _player) and {[_player] call FUNC(hasExplosives)}); condition = QUOTE((vehicle _player == _player) and {[_player] call FUNC(hasExplosives)});
statement = QUOTE([_player] call FUNC(openPlaceUI);); statement = "";
insertChildren = QUOTE([_player] call FUNC(addExplosiveActions););
exceptions[] = {"isNotSwimming"}; exceptions[] = {"isNotSwimming"};
showDisabled = 1; showDisabled = 1;
icon = PATHTOF(UI\Place_Explosive_ca.paa); icon = PATHTOF(UI\Place_Explosive_ca.paa);
priority = 1; priority = 1;
hotkey = "P"; hotkey = "P";
}; };
class ACE_Defuse {
displayName = $STR_ACE_Explosives_Defuse;
condition = QUOTE([_player] call FUNC(canDefuse));
statement = QUOTE([ARR_2(_player,EGVAR(Interaction,Target))] call FUNC(startDefuse););
exceptions[] = {"isNotSwimming"};
showDisabled = 0;
icon = PATHTOF(UI\Defuse_ca.paa);
priority = 0.8;
hotkey = "F";
};
class ACE_Cellphone { class ACE_Cellphone {
displayName = $STR_ACE_Explosives_cellphone_displayName; displayName = $STR_ACE_Explosives_cellphone_displayName;
condition = "('ACE_Cellphone' in (items ace_player))"; condition = "('ACE_Cellphone' in (items ace_player))";
statement = "closeDialog 0;createDialog 'Rsc_ACE_PhoneInterface';"; statement = "closeDialog 0;createDialog 'Rsc_ACE_PhoneInterface';";
exceptions[] = {"isNotSwimming"}; exceptions[] = {"isNotSwimming", "isNotInside"};
showDisabled = 0; showDisabled = 0;
icon = PATHTOF(Data\UI\Cellphone_UI.paa); icon = PATHTOF(Data\UI\Cellphone_UI.paa);
priority = 0.8; priority = 0.8;
@ -57,7 +48,38 @@ class CfgVehicles {
}; };
class Items_base_F; class Items_base_F;
class ACE_DefuseObject: Items_base_F {
XEH_ENABLED;
author = "ACE";
_generalMacro = "ACE_DefuseObject";
displayName = "ACE Defuse Helper";
mapSize = 0.2;
icon = "iconObject_1x2";
model = "\A3\Weapons_f\dummyweapon.p3d";
scope = 2;
scopeCurator = 1;
vehicleClass = "Cargo";
class ACE_Actions {
class ACE_MainActions {
selection = "";
distance = 5;
condition = "true";
class ACE_Defuse {
displayName = $STR_ACE_Explosives_Defuse;
condition = QUOTE([ARR_2(_player,_target)] call FUNC(canDefuse));
statement = QUOTE([ARR_2(_player,_target)] call FUNC(startDefuse););
exceptions[] = {"isNotSwimming"};
showDisabled = 0;
icon = PATHTOF(UI\Defuse_ca.paa);
priority = 0.8;
hotkey = "F";
distance = 5;
};
};
};
};
class ACE_Explosives_Place: Items_base_F { class ACE_Explosives_Place: Items_base_F {
XEH_ENABLED;
author = "ACE"; author = "ACE";
_generalMacro = "ACE_Explosives_Place"; _generalMacro = "ACE_Explosives_Place";
displayName = "Multi-meter"; displayName = "Multi-meter";
@ -68,6 +90,36 @@ class CfgVehicles {
scopeCurator = 1; scopeCurator = 1;
vehicleClass = "Cargo"; vehicleClass = "Cargo";
ACE_offset[] = {0,0,0}; ACE_offset[] = {0,0,0};
class ACE_Actions {
class ACE_MainActions {
selection = "";
distance = 5;
condition = "true";
class ACE_SetTrigger {
selection = "";
displayName = "$STR_ACE_Explosives_TriggerMenu";
distance = 4;
condition = "true";
statement = "";
insertChildren = QUOTE([ARR_3(_target getVariable QUOTE(QGVAR(class)),_target,_player)] call FUNC(addTriggerActions););
showDisabled = 0;
exceptions[] = {};
priority = 5;
icon = QUOTE(PATHTOF(UI\Explosives_Menu_ca.paa));
};
class ACE_PickUp {
selection = "";
displayName = "$STR_ACE_Explosives_Pickup";
distance = 4;
condition = "true";
statement = QUOTE([ARR_2(_player,_target getVariable QUOTE(QGVAR(class)))] call EFUNC(common,addToInventory);deleteVehicle _target;);
showDisabled = 0;
exceptions[] = {};
priority = 5;
icon = "\A3\ui_f\data\IGUI\Cfg\Actions\Obsolete\ui_action_takemine_ca.paa";
};
};
};
}; };
class ACE_Explosives_Place_DemoCharge:ACE_Explosives_Place { class ACE_Explosives_Place_DemoCharge:ACE_Explosives_Place {

View File

@ -19,7 +19,11 @@ ADDON = false;
PREP(addCellphoneIED); PREP(addCellphoneIED);
PREP(addClacker); PREP(addClacker);
PREP(addDetonateActions);
PREP(addExplosiveActions);
PREP(addToSpeedDial); PREP(addToSpeedDial);
PREP(addTransmitterActions);
PREP(addTriggerActions);
PREP(canDefuse); PREP(canDefuse);
PREP(canDetonate); PREP(canDetonate);
PREP(defuseExplosive); PREP(defuseExplosive);
@ -36,11 +40,9 @@ PREP(getDetonators);
PREP(getPlacedExplosives); PREP(getPlacedExplosives);
PREP(getSpeedDialExplosive); PREP(getSpeedDialExplosive);
PREP(openDetonateUI); PREP(onLanded);
PREP(openPlaceUI);
PREP(openTransmitterUI);
PREP(openTimerSetUI); PREP(openTimerSetUI);
PREP(openTriggerSelectionUI);
PREP(place_Approve); PREP(place_Approve);
PREP(place_Cancel); PREP(place_Cancel);

View File

@ -5,7 +5,7 @@ class CfgPatches {
units[] = {}; units[] = {};
weapons[] = {"ACE_Clacker", "ACE_DefusalKit", "ACE_M26_Clacker", "ACE_DeadManSwitch", "ACE_Cellphone"}; weapons[] = {"ACE_Clacker", "ACE_DefusalKit", "ACE_M26_Clacker", "ACE_DeadManSwitch", "ACE_Cellphone"};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common", "ace_interaction"}; requiredAddons[] = {"ace_interaction"};
author[] = {"Garth 'L-H' de Wet"}; author[] = {"Garth 'L-H' de Wet"};
authorUrl = "http://garth.snakebiteink.co.za/"; authorUrl = "http://garth.snakebiteink.co.za/";
VERSION_CONFIG; VERSION_CONFIG;

View File

@ -17,10 +17,8 @@
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_explosive", "_clacker", "_config", "_magazineClass", "_requiredItems", "_hasRequired"]; private ["_clacker", "_config", "_requiredItems", "_hasRequired"];
_unit = _this select 0; EXPLODE_3_PVT(_this,_unit,_explosive,_magazineClass);
_explosive = _this select 1;
_magazineClass = _this select 2;
// Config is the last item in the list of passed in items. // Config is the last item in the list of passed in items.
_config = (_this select 3) select (count (_this select 3) - 1); _config = (_this select 3) select (count (_this select 3) - 1);
@ -38,7 +36,9 @@ _config = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> co
_clacker = _unit getVariable [QGVAR(Clackers), []]; _clacker = _unit getVariable [QGVAR(Clackers), []];
GVAR(PlacedCount) = GVAR(PlacedCount) + 1; GVAR(PlacedCount) = GVAR(PlacedCount) + 1;
_clacker pushBack [_explosive, getNumber(_config >> "FuseTime"), format [localize "STR_ACE_Explosives_DetonateCode", _clacker pushBack [_explosive, getNumber(_config >> "FuseTime"), format [localize "STR_ACE_Explosives_DetonateCode",
GVAR(PlacedCount)], _magazineClass, configName ((_this select 3) select (count (_this select 3) - 1))]; GVAR(PlacedCount)], _magazineClass, configName ((_this select 3) select (count (_this select 3) - 1))];
_unit setVariable [QGVAR(Clackers), _clacker, true]; _unit setVariable [QGVAR(Clackers), _clacker, true];
_unit sideChat format [localize "STR_ACE_Explosives_DetonateCode", GVAR(PlacedCount)]; _unit sideChat format [localize "STR_ACE_Explosives_DetonateCode", GVAR(PlacedCount)];

View File

@ -0,0 +1,49 @@
/*
* Author: Garth 'L-H' de Wet
* Opens the UI for explosive detonation selection
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Trigger classname <STRING>
*
* Return Value:
* None
*
* Example:
* [player, "ACE_M26_Clacker"] call ACE_Explosives_fnc_addDetonateActions;
*
* Public: No
*/
#include "script_component.hpp"
private ["_result", "_item", "_children"];
call EFUNC(interaction,hideMenu);
EXPLODE_2_PVT(_this,_unit,_detonator);
_range = GetNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "ACE_Range");
_result = [_unit] call FUNC(getPlacedExplosives);
_children = [];
{
if (!isNull(_x select 0)) then {
_required = getArray (ConfigFile >> "CfgACE_Triggers" >> (_x select 4) >> "requires");
if (_detonator in _required) then {
_item = ConfigFile >> "CfgMagazines" >> (_x select 3);
_children pushBack
[
[
format ["Explosive_%1", _forEachIndex],
_x select 2,
getText(_item >> "picture"),
{(_this select 2) call FUNC(detonateExplosive);},
{true},
{},
[ACE_player,_range,_x]
] call EFUNC(interact_menu,createAction),
[],
ACE_Player
];
};
};
} foreach _result;
_children

View File

@ -0,0 +1,56 @@
/*
* Author: Garth 'L-H' de Wet and CAA-Picard
*
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Actions
*
* Public: No
*/
#include "script_component.hpp"
private ["_mags", "_item", "_index", "_children"];
EXPLODE_1_PVT(_this,_unit);
_mags = magazines _unit;
_list = [];
_itemCount = [];
{
_item = ConfigFile >> "CfgMagazines" >> _x;
if (getNumber(_item >> "ACE_Placeable") == 1) then {
_index = _list find _item;
if (_index != -1) then {
_itemCount set [_index, (_itemCount select _index) + 1];
} else {
_list pushBack _item;
_itemCount pushBack 1;
};
};
} forEach _mags;
_children = [];
{
private "_name";
_name = if(isText(_x >> "displayNameShort") && {getText(_x >> "displayNameShort") != ""}) then
{getText (_x >> "displayNameShort")}else{getText(_x >> "displayName")};
_children pushBack
[
[
format ["Explosive_%1", _forEachIndex],
format [_name + " (%1)", _itemCount select _foreachIndex],
getText(_x >> "picture"),
{(_this select 2) call FUNC(setupExplosive);},
{true},
{},
[_unit, configName _x]
] call EFUNC(interact_menu,createAction),
[],
_unit
];
} foreach _list;
_children

View File

@ -0,0 +1,39 @@
/*
* Author: Garth 'L-H' de Wet
* Opens the UI for selecting the transmitter
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [player] call ACE_Explosives_fnc_addTransmitterActions;
*
* Public: No
*/
#include "script_component.hpp"
private ["_items", "_unit", "_children", "_config"];
_unit = _this select 0;
_detonators = [_unit] call FUNC(getDetonators);
_children = [];
{
_config = ConfigFile >> "CfgWeapons" >> _x;
_children pushBack
[
[
format ["Trigger_%1", _forEachIndex],
getText(_config >> "displayName"),
getText(_config >> "picture"),
{},
{true},
{(_this select 2) call FUNC(addDetonateActions);},
[ACE_player,_x]
] call EFUNC(interact_menu,createAction),
[],
ACE_Player
];
} foreach _detonators;
_children

View File

@ -0,0 +1,56 @@
/*
* Author: Garth 'L-H' de Wet
* Opens the UI for explosive trigger selection
*
* Arguments:
* 0: Explosive Magazine <STRING>
* 1: Explosive <OBJECT>
*
* Return Value:
* None
*
* Example:
* [lbData [8866, lbCurSel 8866], _explosive] call ACE_Explosives_fnc_addTriggerActions;
*
* Public: No
*/
#include "script_component.hpp"
private ["_hasRequiredItems","_triggerTypes", "_children",
"_detonators", "_required", "_magTriggers"];
EXPLODE_2_PVT(_this,_magazine,_explosive);
_detonators = [ACE_player] call FUNC(getDetonators);
_triggerTypes = [_magazine] call FUNC(triggerType);
_magTriggers = ConfigFile >> "CfgMagazines" >> _magazine >> "ACE_Triggers";
_children = [];
{
_required = getArray (_x >> "requires");
_hasRequiredItems = true;
{
if !(_x in _detonators) exitWith {
_hasRequiredItems = false;
};
} count _required;
if (_hasRequiredItems) then {
_children pushBack
[
[
format ["Trigger_%1", _forEachIndex],
if(isText(_magTriggers >> configName _x >> "displayName"))then
{getText(_magTriggers >> configName _x >> "displayName")}
else{getText(_x >> "displayName")},
if(isText(_magTriggers >> configName _x >> "picture"))then
{getText(_magTriggers >> configName _x >> "picture")}
else{getText(_x >> "picture")},
{(_this select 2) call FUNC(selectTrigger);},
{true},
{},
[_explosive, _magazine, configName _x]
] call EFUNC(interact_menu,createAction),
[],
ACE_Player
];
};
} foreach _triggerTypes;
_children

View File

@ -14,25 +14,15 @@
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private "_unit"; private ["_specialist"];
_unit = _this select 0; EXPLODE_2_PVT(_this,_unit,_target);
if (isNull(_target getVariable [QGVAR(Explosive),objNull])) exitWith {
deleteVehicle _target;
false
};
if (vehicle _unit != _unit || {!("ACE_DefusalKit" in (items _unit))}) exitWith {false}; if (vehicle _unit != _unit || {!("ACE_DefusalKit" in (items _unit))}) exitWith {false};
_isSpecialist = [_unit] call EFUNC(Common,isEOD); _isSpecialist = [_unit] call EFUNC(Common,isEOD);
if (GVAR(RequireSpecialist) && {!_isSpecialist}) exitWith {false}; if (GVAR(RequireSpecialist) && {!_isSpecialist}) exitWith {false};
_timeBombCore = nearestObject [_unit, "TimeBombCore"]; true
_mineBase = nearestObject [_unit, "MineBase"];
_distCore = _unit distance _timeBombCore;
_distBase = _unit distance _mineBase;
_distance = 10;
if (_distCore < _distBase) then {
_distance = _distCore;
EGVAR(interaction,Target) = _timeBombCore;
}else{
_distance = _distBase;
EGVAR(interaction,Target) = _mineBase;
};
if (isNil "_distance") exitWith {false};
_distance < 4

View File

@ -15,12 +15,16 @@
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_explosive"]; EXPLODE_2_PVT(_this,_unit,_explosive);
_unit = _this select 0;
_explosive = _this select 1;
if (getNumber (ConfigFile >> "CfgAmmo" >> typeof _explosive >> "ACE_explodeOnDefuse") == 1) exitWith { if (getNumber (ConfigFile >> "CfgAmmo" >> typeof _explosive >> "ACE_explodeOnDefuse") == 1) exitWith {
[_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive); [_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive);
}; };
{
detach _x;
deleteVehicle _x;
false
} count (attachedObjects (_explosive));
_unit action ["Deactivate", _unit, _explosive]; _unit action ["Deactivate", _unit, _explosive];

View File

@ -19,15 +19,19 @@
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_item","_result", "_ignoreRange", "_unit", "_range"]; private ["_result", "_ignoreRange", "_helper"];
_unit = _this select 0; EXPLODE_3_PVT(_this,_unit,_range,_item);
_range = _this select 1;
_item = _this select 2;
_ignoreRange = (_range == -1); _ignoreRange = (_range == -1);
_result = true; _result = true;
if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {false}; if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {false};
_helper = (attachedTo (_item select 0));
if (!isNull(_helper)) then {
detach (_item select 0);
deleteVehicle _helper;
};
if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhenDestroyed") == 0) then { if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhenDestroyed") == 0) then {
private ["_exp", "_previousExp"]; private ["_exp", "_previousExp"];
_previousExp = _item select 0; _previousExp = _item select 0;

View File

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

View File

@ -27,7 +27,7 @@ _adjustedList = false;
_clackerList = _unit getVariable [QGVAR(Clackers), []]; _clackerList = _unit getVariable [QGVAR(Clackers), []];
_list = []; _list = [];
{ {
if isNull (_x select 0) then { if (isNull (_x select 0)) then {
_clackerList set [_foreachIndex, "X"]; _clackerList set [_foreachIndex, "X"];
_adjustedList = true; _adjustedList = true;
} else { } else {

View File

@ -14,7 +14,6 @@
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_obj"];
if (isNull(GVAR(Setup)) || {ACE_Modifier == 0} || !GVAR(pfeh_running)) exitWith {false}; if (isNull(GVAR(Setup)) || {ACE_Modifier == 0} || !GVAR(pfeh_running)) exitWith {false};
_this = _this * 5; _this = _this * 5;
GVAR(Setup) setDir ((getDir GVAR(Setup)) + _this); GVAR(Setup) setDir ((getDir GVAR(Setup)) + _this);

View File

@ -20,7 +20,9 @@ _activated = _this select 2;
if !(_activated) exitWith {}; if !(_activated) exitWith {};
[_logic, QGVAR(RequireSpecialist), "RequireSpecialist" ] call EFUNC(Common,readSettingFromModule); [_logic, QGVAR(RequireSpecialist), "RequireSpecialist"]
[_logic, QGVAR(PunishNonSpecialists), "PunishNonSpecialists" ] call EFUNC(Common,readSettingFromModule); call EFUNC(Common,readSettingFromModule);
[_logic, QGVAR(PunishNonSpecialists),"PunishNonSpecialists"]
call EFUNC(Common,readSettingFromModule);
diag_log text "[ACE]: Explosive Module Initialized."; diag_log text "[ACE]: Explosive Module Initialized.";

View File

@ -0,0 +1,39 @@
/*
* Author: Garth 'L-H' de Wet
*
* Arguments:
*
* Return Value:
* None
*
* Example:
* object addEventHandler ["EpeContactStart", ACE_explosive_fnc_onLanded];
*
* Public: No
*/
#include "script_component.hpp"
EXPLODE_2_PVT(_this,_explosive,_hitTarget);
if ((_explosive getVariable [QGVAR(Handled), false])) exitWith {};
_explosive setVariable [QGVAR(Handled), true];
if (!isNull _hitTarget && {_hitTarget isKindOf "AllVehicles"}) then {
_explosive attachTo [_hitTarget];
private "_dir";
_dir = _setup getVariable [QGVAR(Direction), 0];
_dir = _dir - (getDir _hitTarget);
[[_explosive, _dir, 0], QFUNC(setPosition)] call EFUNC(common,execRemoteFnc);
} else {
[{
EXPLODE_2_PVT(_this,_player,_explosive);
private "_pos";
_player setVariable [QGVAR(PlantingExplosive), false];
if (surfaceIsWater _pos) then {
_pos = getPosASL _explosive;
_explosive setPosASL _pos;
}else{
_pos = getPosATL _explosive;
_explosive setPosATL _pos;
};
}, [ACE_player, _explosive], 0.5, 0.1] call EFUNC(common,waitAndExecute);
};

View File

@ -1,61 +0,0 @@
/*
* Author: Garth 'L-H' de Wet
* Opens the UI for explosive detonation selection
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Trigger classname <STRING>
*
* Return Value:
* None
*
* Example:
* [player, "ACE_M26_Clacker"] call ACE_Explosives_fnc_openDetonateUI;
*
* Public: No
*/
#include "script_component.hpp"
private ["_unit","_result", "_item"];
call EFUNC(interaction,hideMenu);
_unit = _this select 0;
_detonator = _this select 1;
_range = GetNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "ACE_Range");
_result = [_unit] call FUNC(getPlacedExplosives);
_actions = [localize "STR_ACE_Explosives_DetonateMenu", localize "STR_ACE_Explosives_Detonate"]
call EFUNC(interaction,prepareSelectMenu);
_count = 0;
{
if (!isNull(_x select 0)) then {
_required = getArray (ConfigFile >> "CfgACE_Triggers" >> (_x select 4) >> "requires");
if (_detonator in _required) then {
_item = ConfigFile >> "CfgMagazines" >> (_x select 3);
_actions = [
_actions,
_x select 2,
getText(_item >> "picture"),
[_foreachIndex, _range]
] call EFUNC(interaction,AddSelectableItem);
_count = _count + 1;
};
};
} foreach _result;
if (_count > 0) then {
[
_actions,
{
[
ACE_player,
[_this select 1] call EFUNC(common,toNumber),
(ACE_player getVariable [QGVAR(Clackers), []]) select ([_this select 0] call EFUNC(common,toNumber)),
false
] call FUNC(detonateExplosive);
call EFUNC(interaction,hideMenu);
},
{[ACE_player] call FUNC(openTransmitterUI);}
] call EFUNC(interaction,openSelectMenu);
}else{
call EFUNC(interaction,hideMenu);
[ACE_player] call FUNC(openTransmitterUI);
[localize "STR_ACE_Explosives_NoExplosivesAvailable"] call EFUNC(common,displayTextStructured);
};

View File

@ -1,55 +0,0 @@
/*
* Author: Garth 'L-H' de Wet
* Opens the UI for explosive placement selection
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player] call ACE_Explosives_fnc_openPlaceUI;
*
* Public: No
*/
#include "script_component.hpp"
private ["_unit","_mags", "_item", "_index", "_actions"];
_unit = _this select 0;
call FUNC(place_Cancel);
_mags = magazines _unit;
_list = [];
_itemCount = [];
{
_item = ConfigFile >> "CfgMagazines" >> _x;
if (getNumber(_item >> "ACE_Placeable") == 1) then {
_index = _list find _item;
if (_index != -1) then {
_itemCount set [_index, (_itemCount select _index) + 1];
} else {
_list pushBack _item;
_itemCount pushBack 1;
};
};
} forEach _mags;
_actions = [localize "STR_ACE_Explosives_PlaceMenu", localize "STR_ACE_Explosives_Place"]
call EFUNC(interaction,prepareSelectMenu);
{
_actions = [
_actions,
format [getText(_x >> "displayName") + " (%1)", _itemCount select _foreachIndex],
getText(_x >> "picture"),
configName _x
] call EFUNC(interaction,AddSelectableItem);
} foreach _list;
[
_actions,
{
[_this] call FUNC(openTriggerSelectionUI);
},
{
call EFUNC(interaction,hideMenu);
}
] call EFUNC(interaction,openSelectMenu);

View File

@ -3,24 +3,39 @@
* Opens the UI for timer setting of an explosive * Opens the UI for timer setting of an explosive
* *
* Arguments: * Arguments:
* 0: Magazine <STRING> * 0: Explosive <OBJECT>
* 1: Magazine <STRING>
* *
* Return Value: * Return Value:
* None * None
* *
* Example: * Example:
* ["SatchelCharge_Remote_Mag"] call ACE_Explosives_fnc_openTimerSetUI; * [_explosive, "SatchelCharge_Remote_Mag"] call ACE_Explosives_fnc_openTimerSetUI;
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_mag"]; EXPLODE_2_PVT(_this,_explosive,_mag);
_mag = _this select 0;
createDialog "RscACE_SelectTimeUI"; createDialog "RscACE_SelectTimeUI";
sliderSetRange [8845, 5, 900]; // 5seconds - 15minutes sliderSetRange [8845, 5, 900]; // 5seconds - 15minutes
sliderSetPosition [8845, 30]; sliderSetPosition [8845, 30];
buttonSetAction [8860, format[QUOTE([ARR_4(ACE_player,'%1','Timer',floor sliderPosition 8845)] call FUNC(setupExplosive);closeDialog 0;), _mag]]; GVAR(explosive) = _explosive;
buttonSetAction [8855, format[QUOTE(['%1'] call FUNC(openTriggerSelectionUI);), _mag]];
DFUNC(SetTimer) = {
[
ACE_player,
getPosATL GVAR(explosive),
GVAR(explosive) getVariable QGVAR(Direction),
GVAR(explosive) getVariable QGVAR(class),
"Timer",
[floor sliderPosition 8845],
GVAR(explosive)
] call FUNC(placeExplosive);
closeDialog 0;
};
buttonSetAction [8860, QUOTE(call DFUNC(SetTimer);)];
buttonSetAction [8855, QUOTE(closeDialog 0;)];
ctrlSetText [8870, format[localize "STR_ACE_Explosives_TimerMenu",0, 30]]; ctrlSetText [8870, format[localize "STR_ACE_Explosives_TimerMenu",0, 30]];

View File

@ -1,48 +0,0 @@
/*
* Author: Garth 'L-H' de Wet
* Opens the UI for selecting the transmitter
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [player] call ACE_Explosives_fnc_openTransmitterUI;
*
* Public: No
*/
#include "script_component.hpp"
private ["_items", "_unit", "_count", "_actions", "_config"];
_unit = _this select 0;
_items = (items _unit);
_actions = [localize "STR_ACE_Explosives_TriggerMenu", localize "STR_ACE_Explosives_SelectTrigger"]
call EFUNC(interaction,prepareSelectMenu);
_detonators = [_unit] call FUNC(getDetonators);
{
_config = ConfigFile >> "CfgWeapons" >> _x;
_actions = [
_actions,
getText(_config >> "displayName"),
getText(_config >> "picture"),
_x
] call EFUNC(interaction,addSelectableItem);
} count _detonators;
if (count _detonators == 0) then {
call EFUNC(interaction,hideMenu);
"ACE_Explosives" call EFUNC(interaction,openMenuSelf);
[format[localize "STR_ACE_Explosives_NoTriggersAvailable", "player"]] call EFUNC(Common,displayTextStructured);
}else{
[
_actions,
{
[ACE_player, _this] call FUNC(openDetonateUI);
},
{
call EFUNC(interaction,hideMenu);
}
] call EFUNC(interaction,openSelectMenu);
};

View File

@ -1,57 +0,0 @@
/*
* Author: Garth 'L-H' de Wet
* Opens the UI for explosive trigger selection
*
* Arguments:
* 0: Explosive Magazine <STRING>
*
* Return Value:
* None
*
* Example:
* [lbData [8866, lbCurSel 8866]] call ACE_Explosives_fnc_openTriggerSelectionUI;
*
* Public: No
*/
#include "script_component.hpp"
private ["_magazine", "_hasRequiredItems","_triggerTypes", "_actions", "_detonators", "_required", "_magTriggers"];
_magazine = _this select 0;
_detonators = [ACE_player] call FUNC(getDetonators);
_triggerTypes = [_magazine] call FUNC(triggerType);
_magTriggers = ConfigFile >> "CfgMagazines" >> _magazine >> "ACE_Triggers";
_actions = [localize "STR_ACE_Explosives_TriggerMenu", localize "STR_ACE_Explosives_SelectTrigger"]
call EFUNC(interaction,prepareSelectMenu);
_count = 0;
{
_required = getArray (_x >> "requires");
_hasRequiredItems = true;
{
if !(_x in _detonators) exitWith {
_hasRequiredItems = false;
};
} count _required;
if (_hasRequiredItems) then {
_actions = [
_actions,
if(isText(_magTriggers >> configName _x >> "displayName"))then{getText(_magTriggers >> configName _x >> "displayName")}else{getText(_x >> "displayName")},
if(isText(_magTriggers >> configName _x >> "picture"))then{getText(_magTriggers >> configName _x >> "picture")}else{getText(_x >> "picture")},
[configName _x, _magazine]
] call EFUNC(interaction,addSelectableItem);
_count = _count + 1;
};
} count _triggerTypes;
if (_count == 0) then {
[ACE_player] call FUNC(openPlaceUI);
[format[localize "STR_ACE_Explosives_NoTriggersAvailable",
getText(configFile >> "CfgMagazines" >> _magazine >> "DisplayName")]] call EFUNC(Common,displayTextStructured);
}else{
[
_actions,
{
[_this select 1, _this select 0] call FUNC(selectTrigger);
},
{[ACE_player] call FUNC(openPlaceUI);}
] call EFUNC(interaction,openSelectMenu);
};

View File

@ -7,30 +7,24 @@
* 1: Position to place explosive <POSITION> * 1: Position to place explosive <POSITION>
* 2: Rotation <NUMBER> * 2: Rotation <NUMBER>
* 3: Magazine class <STRING> * 3: Magazine class <STRING>
* 4: Config of trigger <CONFIG> * 4: Config of trigger <STRING>
* 5: Variables required for the trigger type <ARRAY> * 5: Variables required for the trigger type <ARRAY>
* 6: Should direction be set <BOOL> * 6: Explosive placeholder <OBJECT> <OPTIONAL>
* *
* Return Value: * Return Value:
* Placed explosive <OBJECT> * Placed explosive <OBJECT>
* *
* Example: * Example:
* _explosive = [player, player modelToWorld [0,0.5, 0.1], 134, * _explosive = [player, player modelToWorldVisual [0,0.5, 0.1], 134,
* "SatchelCharge_Remote_Mag", "Command", []] call ACE_Explosives_fnc_placeExplosive; * "SatchelCharge_Remote_Mag", "Command", []] call ACE_Explosives_fnc_placeExplosive;
* *
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_pos", "_dir", "_magazineClass", "_ammo", "_triggerSpecificVars", "_unit", "_triggerConfig", "_explosive"]; private ["_ammo", "_explosive"];
_unit = _this select 0; EXPLODE_6_PVT(_this,_unit,_pos,_dir,_magazineClass,_triggerConfig,_triggerSpecificVars);
_pos = _this select 1;
_dir = _this select 2;
_magazineClass = _this select 3;
_triggerConfig = _this select 4;
_triggerSpecificVars = _this select 5;
_setDir = true;
if (count _this > 6) then { if (count _this > 6) then {
_setDir = _this select 6; deleteVehicle (_this select 6);
}; };
if (isNil "_triggerConfig") exitWith { if (isNil "_triggerConfig") exitWith {
@ -51,11 +45,19 @@ if (isText(_magazineTrigger >> "ammo")) then {
_ammo = getText (_magazineTrigger >> "ammo"); _ammo = getText (_magazineTrigger >> "ammo");
}; };
_triggerSpecificVars pushBack _triggerConfig; _triggerSpecificVars pushBack _triggerConfig;
private ["_defuseHelper"];
_defuseHelper = createVehicle ["ACE_DefuseObject", _pos, [], 0, "NONE"];
_defuseHelper setPosATL _pos;
_explosive = createVehicle [_ammo, _pos, [], 0, "NONE"]; _explosive = createVehicle [_ammo, _pos, [], 0, "NONE"];
_defuseHelper attachTo [_explosive, [0,0,0], ""];
_defuseHelper setVariable [QGVAR(Explosive),_explosive,true];
_expPos = getPosATL _explosive;
_defuseHelper setPosATL (((getPosATL _defuseHelper) vectorAdd (_pos vectorDiff _expPos)));
_explosive setPosATL _pos;
if (isText(_triggerConfig >> "onPlace") && {[_unit,_explosive,_magazineClass,_triggerSpecificVars] if (isText(_triggerConfig >> "onPlace") && {[_unit,_explosive,_magazineClass,_triggerSpecificVars]
call compile (getText (_triggerConfig >> "onPlace"))}) exitWith {_explosive}; call compile (getText (_triggerConfig >> "onPlace"))}) exitWith {_explosive};
if (_setDir) then { [[_explosive, _dir, getNumber (_magazineTrigger >> "pitch")], QFUNC(setPosition)] call EFUNC(common,execRemoteFnc);
[[_explosive, _dir, getNumber (_magazineTrigger >> "pitch")], QFUNC(setPosition)]
call EFUNC(common,execRemoteFnc);
};
_explosive _explosive

View File

@ -23,10 +23,10 @@ private ["_mag", "_setup", "_player"];
_setup = GVAR(Setup); _setup = GVAR(Setup);
GVAR(Setup) = objNull; GVAR(Setup) = objNull;
[GVAR(placer), "ACE_Explosives", false] call EFUNC(Common,setForceWalkStatus); [GVAR(placer), "ACE_Explosives", false] call EFUNC(Common,setForceWalkStatus);
[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Place), -1]] call EFUNC(Common,removeActionEventHandler);
[ACE_player, "MenuBack", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
GVAR(placer) = objNull; GVAR(placer) = objNull;
_player = ACE_player; _player = ACE_player;
[_player, "DefaultAction", _player getVariable [QGVAR(Place), -1]] call EFUNC(Common,removeActionEventHandler);
[_player, "MenuBack", _player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
call EFUNC(interaction,hideMouseHint); call EFUNC(interaction,hideMouseHint);
if ((_setup getVariable [QGVAR(Class), ""]) == "") exitWith { if ((_setup getVariable [QGVAR(Class), ""]) == "") exitWith {
deleteVehicle _setup; deleteVehicle _setup;
@ -39,67 +39,7 @@ if (_dir > 180) then {
}; };
_setup setVariable [QGVAR(Direction), _dir]; _setup setVariable [QGVAR(Direction), _dir];
_player setVariable [QGVAR(PlantingExplosive), true]; _player setVariable [QGVAR(PlantingExplosive), true];
_setup addEventHandler ["EpeContactStart", { _setup addEventHandler ["EpeContactStart", FUNC(onLanded)];
if (!((_this select 0) getVariable [QGVAR(Handled), false])) then {
private ["_player", "_pos", "_attachTo"];
_player = ACE_player;
_player setVariable [QGVAR(PlantingExplosive), false];
_pos = getPosATL (_this select 0);
(_this select 0) enableSimulationGlobal false;
if (surfaceIsWater _pos) then {
_pos = getPosASL (_this select 0);
(_this select 0) setPosASL _pos;
}else{
(_this select 0) setPosATL _pos;
};
(_this select 0) setVariable [QGVAR(Handled), true];
_attachTo = objNull;
if (!isNull (_this select 1) && {(_this select 1) isKindOf "AllVehicles"}) then {
_attachTo = (_this select 1);
};
[(_this select 0),_attachTo, _pos] spawn { // TODO: Change to scheduled delay execution
private ["_mag", "_setup", "_dir", "_player"];
_setup = _this select 0;
_player = ACE_player;
_mag = _setup getVariable [QGVAR(Class), ""];
_dir = _setup getVariable [QGVAR(Direction), 0];
sleep getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "ACE_DelayTime");
_explosive = [_player, _this select 2, _dir, _mag, _setup getVariable QGVAR(Trigger),
[_setup getVariable QGVAR(Timer)], isNull (_this select 1)] call FUNC(placeExplosive);
deleteVehicle _setup;
if (!isNull(_explosive)) then {
_player RemoveMagazine _mag;
if (!isNull (_this select 1)) then {
_explosive attachTo [(_this select 1)];
_dir = _dir - (getDir (_this select 1));
[[_explosive, _dir, 0], QFUNC(setPosition)] call EFUNC(common,execRemoteFnc);
};
};
};
};
}];
_setup enableSimulationGlobal true; _setup enableSimulationGlobal true;
_player playActionNow "MedicOther"; _player playActionNow "MedicOther";
[_setup] spawn { // TODO: Change to scheduled delay execution _player removeMagazine (_setup getVariable [QGVAR(Class), ""]);
private ["_setup", "_player"];
_setup = _this select 0;
_player = ACE_player;
sleep 5;
_player setVariable [QGVAR(PlantingExplosive), false];
if (!isNull _setup) then {
private ["_mag", "_dir", "_delayTime"];
_mag = _setup getVariable [QGVAR(Class), ""];
_dir = _setup getVariable [QGVAR(Direction), 0];
_delayTime = (getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "ACE_DelayTime")) - 5;
if (_delayTime > 0) then {
sleep _delayTime;
};
if (!isNull _setup) then {
[_player, GetPosATL _setup, _dir, _mag, _setup getVariable QGVAR(Trigger),
[_setup getVariable QGVAR(Timer)], true] call FUNC(placeExplosive);
deleteVehicle _setup;
_player RemoveMagazine _mag;
};
};
};

View File

@ -29,4 +29,4 @@ if (isNil {GVAR(placer)}) then {
GVAR(placer) = objNull; GVAR(placer) = objNull;
call EFUNC(interaction,hideMouseHint); call EFUNC(interaction,hideMouseHint);
[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Place), -1]] call EFUNC(Common,removeActionEventHandler); [ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Place), -1]] call EFUNC(Common,removeActionEventHandler);
[ACE_player, "MenuBack", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); [ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);

View File

@ -3,26 +3,26 @@
* Selects a trigger for an explosive. * Selects a trigger for an explosive.
* *
* Arguments: * Arguments:
* 0: Magazine <STRING> * 0: Explosive <OBJECT>
* 1: Trigger mode <STRING> * 1: Magazine <STRING>
* 2: Trigger mode <STRING>
* *
* Return Value: * Return Value:
* None * None
* *
* Example: * Example:
* ["SatchelCharge_Remote_Mag","Timer"] call ACE_Explosives_fnc_selectTrigger; * [_explosive, "SatchelCharge_Remote_Mag","Timer"] call ACE_Explosives_fnc_selectTrigger;
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_magazine","_trigger"]; private ["_config"];
closeDialog 0; closeDialog 0;
_magazine = _this select 0;
_trigger = _this select 1;
_config = ConfigFile >> "CfgACE_Triggers" >> _trigger;
call EFUNC(interaction,hideMenu); call EFUNC(interaction,hideMenu);
EXPLODE_3_PVT(_this,_explosive,_magazine,_trigger);
_config = ConfigFile >> "CfgACE_Triggers" >> _trigger;
// If the onSetup function returns true, it is handled elsewhere // If the onSetup function returns true, it is handled elsewhere
if (isText(_config >> "onSetup") && {[_magazine] call compile getText (_config >> "onSetup")}) exitWith {}; if (isText(_config >> "onSetup") && {[_explosive,_magazine] call compile getText (_config >> "onSetup")}) exitWith {};
[ACE_player, _magazine, _trigger] call FUNC(setupExplosive); [ACE_player, getPosATL _explosive, _explosive getVariable [QGVAR(Direction), 0],_magazine, _trigger, [], _explosive] call ACE_Explosives_fnc_placeExplosive;

View File

@ -16,10 +16,8 @@
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private "_ex"; EXPLODE_3_PVT(_this,_explosive,_direction,_pitch);
_ex = _this select 0; _explosive setDir _direction;
_ex setDir (_this select 1); if (_pitch != 0) then {
if ((_this select 2) != 0) then { [_explosive, _pitch, 0] call CALLSTACK(BIS_fnc_setPitchBank);
[_ex, _this select 2, 0] call CALLSTACK(BIS_fnc_setPitchBank);
}; };
//_ex setVectorUp (surfaceNormal _pos);

View File

@ -5,43 +5,28 @@
* Arguments: * Arguments:
* 0: Unit <OBJECT> * 0: Unit <OBJECT>
* 1: Classname of explosive to place. (CfgMagazine class) <STRING> * 1: Classname of explosive to place. (CfgMagazine class) <STRING>
* 2: Trigger Config <CONFIG>
* 3: Timer (optional) <NUMBER>
* *
* Return Value: * Return Value:
* None * None
* *
* Example: * Example:
* [player, "SatchelCharge_Remote_Mag", "Command"] call ACE_Explosives_fnc_SetupExplosive; * [player, "SatchelCharge_Remote_Mag"] call ACE_Explosives_fnc_SetupExplosive;
* *
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_class", "_config", "_timer"]; closeDialog 0;
_unit = _this select 0; EXPLODE_2_PVT(_this,_unit,_class);
_class = _this select 1;
_config = _this select 2;
_timer = _this select 3;
GVAR(placer) = _unit; GVAR(placer) = _unit;
// Commented out due to the fact there is a distinction between who can deactivate mines and who can plant them in standard configs. // TODO: check MP performance and MP compatible.
// Would require custom config entries (ACE_ExplosiveSpecialist/ACE_Specialist) which excludes custom mods. GVAR(Setup) = createVehicle [getText(ConfigFile >> "CfgMagazines" >> _class >> "ACE_SetupObject"),[0,0,-10000],[], 0, "NONE"];
//if (ACE_Explosives_RequireSpecialist && {!([_unit] call ACE_Core_fnc_isEOD)}) exitWith {};
if (isNil "_config") then {
_config = getArray(ConfigFile >> "CfgMagazines" >> _class >> "ACE_Triggers" >> "SupportedTriggers") select 0;
};
GVAR(Setup) = getText(ConfigFile >> "CfgMagazines" >> _class >> "ACE_SetupObject") createVehicleLocal [0,0,-10000];
GVAR(Setup) enableSimulationGlobal false; GVAR(Setup) enableSimulationGlobal false;
GVAR(Setup) setVariable [QGVAR(Class), _class]; GVAR(Setup) setVariable [QGVAR(class), _class, true];
GVAR(Setup) setVariable [QGVAR(Trigger), _config];
//GVAR(Setup) setVariable [QGVAR(Offset), GetArray(ConfigFile >> "CfgVehicles" >> typeof GVAR(Setup) >> "ACE_Offset")];
if (!isNil "_timer") then {
GVAR(Setup) setVariable [QGVAR(Timer), _timer];
};
[_unit, "ACE_Explosives", true] call EFUNC(common,setForceWalkStatus); [_unit, "ACE_Explosives", true] call EFUNC(common,setForceWalkStatus);
GVAR(TweakedAngle) = 180; GVAR(TweakedAngle) = 180;
[QGVAR(Placement),"OnEachFrame", { [QGVAR(Placement),"OnEachFrame", {
private "_player"; private "_player";
_player = ACE_player; _player = ACE_player;
@ -50,15 +35,15 @@ GVAR(TweakedAngle) = 180;
}; };
GVAR(pfeh_running) = true; GVAR(pfeh_running) = true;
_pos = (ASLtoATL eyePos _player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]); _pos = (ASLtoATL eyePos _player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]);
//_pos = _pos vectorAdd ((VectorDir GVAR(Setup)) vectorCrossProduct (GVAR(Setup) getVariable [QGVAR(Offset), [0,0,0]]));
GVAR(Setup) setPosATL _pos; GVAR(Setup) setPosATL _pos;
if (ACE_Modifier == 0) then { if (ACE_Modifier == 0) then {
GVAR(Setup) setDir (GVAR(TweakedAngle) + getDir _player); GVAR(Setup) setDir (GVAR(TweakedAngle) + getDir _player);
}; };
}] call CALLSTACK(BIS_fnc_addStackedEventHandler); }] call CALLSTACK(BIS_fnc_addStackedEventHandler);
[localize "STR_ACE_Explosives_PlaceAction", localize "STR_ACE_Explosives_CancelAction", [localize "STR_ACE_Explosives_PlaceAction", localize "STR_ACE_Explosives_CancelAction",
localize "STR_ACE_Explosives_ScrollAction"] call EFUNC(interaction,showMouseHint); localize "STR_ACE_Explosives_ScrollAction"] call EFUNC(interaction,showMouseHint);
_unit setVariable [QGVAR(Place), [_unit, "DefaultAction", _unit setVariable [QGVAR(Place), [_unit, "DefaultAction",
{GVAR(pfeh_running) AND !isNull (GVAR(Setup))}, {call FUNC(place_Approve);}] call EFUNC(common,AddActionEventHandler)]; {GVAR(pfeh_running) AND !isNull (GVAR(Setup))}, {call FUNC(place_Approve);}] call EFUNC(common,AddActionEventHandler)];
_unit setVariable [QGVAR(Cancel), [_unit, "MenuBack", _unit setVariable [QGVAR(Cancel), [_unit, "zoomtemp",
{GVAR(pfeh_running) AND !isNull (GVAR(Setup))}, {call FUNC(place_Cancel);}] call EFUNC(common,AddActionEventHandler)]; {GVAR(pfeh_running) AND !isNull (GVAR(Setup))}, {call FUNC(place_Cancel);}] call EFUNC(common,AddActionEventHandler)];

View File

@ -15,18 +15,17 @@
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit","_target"]; EXPLODE_2_PVT(_this,_unit,_target);
_unit = _this select 0; _target = attachedTo (_target);
_target = _this select 1;
_fnc_DefuseTime = { _fnc_DefuseTime = {
_target = _this select 1; EXPLODE_2_PVT(_this,_specialist,_target);
_defuseTime = 5; _defuseTime = 5;
if (isNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime")) then { if (isNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime")) then {
_defuseTime = getNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime"); _defuseTime = getNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime");
}; };
if (!(_this select 0) && {GVAR(PunishNonSpecialists)}) then { if (!_specialist && {GVAR(PunishNonSpecialists)}) then {
_defuseTime = _defuseTime * 1.5; _defuseTime = _defuseTime * 1.5;
}; };
_defuseTime _defuseTime

View File

@ -21,6 +21,6 @@ EXPLODE_2_PVT(_this,_explosive,_delay);
[{ [{
_explosive = _this; _explosive = _this;
if (!isNull _explosive) then { if (!isNull _explosive) then {
[_explosive, -1, [_explosive, 0], true] call FUNC(detonateExplosive); [_explosive, -1, [_explosive, 0]] call FUNC(detonateExplosive);
}; };
}, _explosive, _delay, 0] call EFUNC(common,waitAndExecute); }, _explosive, _delay, 0] call EFUNC(common,waitAndExecute);

View File

@ -490,5 +490,8 @@
<Hungarian>Robbanóanyagok távoli robbantásához</Hungarian> <Hungarian>Robbanóanyagok távoli robbantásához</Hungarian>
<Russian>Используется для дистанционного подрыва, после смерти оператора.</Russian> <Russian>Используется для дистанционного подрыва, после смерти оператора.</Russian>
</Key> </Key>
<Key ID="STR_ACE_Explosives_Pickup">
<English>Pick up</English>
</Key>
</Package> </Package>
</Project> </Project>

View File

@ -147,6 +147,14 @@ class RscInGameUI {
MACRO_RANGEFINDER MACRO_RANGEFINDER
}; };
}; };
};
class Rsc_ACE_Helo_UI_Turret: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
}; };
class RscOptics_Heli_Attack_01_gunner: RscUnitInfo { class RscOptics_Heli_Attack_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";

View File

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

View File

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

View File

@ -48,7 +48,14 @@ _offset = 0;
_velocityCorrection = (vectorMagnitude velocity _projectile) - _velocityCorrection = (vectorMagnitude velocity _projectile) -
getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, _velocityCorrection] call EFUNC(common,changeProjectileDirection); [_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, -_velocityCorrection] call EFUNC(common,changeProjectileDirection);
// Remove the platform velocity
if( (vectorMagnitude velocity _vehicle) > 2) then {
_sumVelocity = (velocity _projectile) vectorDiff (velocity _vehicle);
_projectile setVelocity _sumVelocity;
};
// Air burst missile // Air burst missile
// handle locally only // handle locally only

View File

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

View File

@ -28,24 +28,22 @@ if((count _this) > 2) then {
_pos = _this select 2; _pos = _this select 2;
} else { } else {
if(typeName (_actionData select 7) == "ARRAY") then { if(typeName (_actionData select 7) == "ARRAY") then {
_pos = _object modelToWorld (_actionData select 7); _pos = _object modelToWorldVisual (_actionData select 7);
} else { } else {
if ((_actionData select 7) == "weapon") then { if ((_actionData select 7) == "weapon") then {
// Craft a suitable position for weapon interaction // Craft a suitable position for weapon interaction
_weaponDir = _object weaponDirection currentWeapon _object; _weaponDir = _object weaponDirection currentWeapon _object;
_ref = _weaponDir call EFUNC(common,createOrthonormalReference); _ref = _weaponDir call EFUNC(common,createOrthonormalReference);
_pos = (_object modelToWorld (_object selectionPosition "righthand")) vectorAdd ((_ref select 2) vectorMultiply 0.1); _pos = (_object modelToWorldVisual (_object selectionPosition "righthand")) vectorAdd ((_ref select 2) vectorMultiply 0.1);
} else { } else {
_pos = _object modelToWorld (_object selectionPosition (_actionData select 7)); _pos = _object modelToWorldVisual (_object selectionPosition (_actionData select 7));
}; };
}; };
// Compensate for movement during the frame to get rid of jittering
_pos = _pos vectorAdd ((visiblePositionASL _object) vectorDiff (getPosASL _object));
}; };
// For non-self actions, exit if the action is too far away // For non-self actions, exit if the action is too far away
if (GVAR(openedMenuType) == 0 && vehicle ACE_player == ACE_player && if (GVAR(openedMenuType) == 0 && vehicle ACE_player == ACE_player &&
{(ACE_player modelToWorld (ACE_player selectionPosition "pilot")) distance _pos >= _distance}) exitWith {false}; {(ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot")) distance _pos >= _distance}) exitWith {false};
// Exit if the action is behind you // Exit if the action is behind you
_sPos = if (count _pos != 2) then { _sPos = if (count _pos != 2) then {

View File

@ -19,7 +19,7 @@ if(!(isNil "ACE_LASERS")) then {
{ {
if(!(isNull _x)) then { if(!(isNull _x)) then {
_sensorPos = ATLtoASL(_missile modelToWorld _offset); _sensorPos = ATLtoASL(_missile modelToWorldVisual _offset);
_vectorTo = [_sensorPos, ([_x] call FUNC(getPosASL))] call BIS_fnc_vectorFromXToY; _vectorTo = [_sensorPos, ([_x] call FUNC(getPosASL))] call BIS_fnc_vectorFromXToY;
_polarTo = _vectorTo call CBA_fnc_vect2polar; _polarTo = _vectorTo call CBA_fnc_vect2polar;
_dir = _polarTo select 1; _dir = _polarTo select 1;

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,57 @@
/*
* 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;
GVAR(initializedClasses) = _initializedClasses;
{
private ["_turretConfig","_onAction","_offAction"];
_turretConfig = [configFile >> "CfgVehicles" >> _type, _x] call EFUNC(common,getTurretConfigPath);
if (getNumber (_turretConfig >> QGVAR(Enabled)) == 1) exitWith {
// @todo: Add the state variables to the vehicle, instead of to the client
// e.g.: _vehicle setVariable [format ["%1_%2", QGVAR(laserActive), _x], false];
// Add actions
_onAction = [QGVAR(LaserOn), localize "STR_ACE_Laser_SelfDesignate_DesignatorOn", "",
{
// Statement
_this call FUNC(laserHudDesignateOn)
},
{
// Condition
!GVAR(laserActive) && {[ACE_player] call FUNC(unitTurretHasDesignator)}
}] call EFUNC(interact_menu,createAction);
_offAction = [QGVAR(LaserOff), localize "STR_ACE_Laser_SelfDesignate_DesignatorOff", "",
{
// Statement
_this call FUNC(laserHudDesignateOff)
},
{
// Condition
GVAR(laserActive) && {[ACE_player] call FUNC(unitTurretHasDesignator)}
}] call EFUNC(interact_menu,createAction);
[_type, 1, ["ACE_SelfActions"], _onAction] call EFUNC(interact_menu,addActionToClass);
[_type, 1, ["ACE_SelfActions"], _offAction] call EFUNC(interact_menu,addActionToClass);
};
} forEach allTurrets _vehicle;

View File

@ -3,6 +3,8 @@
TRACE_1("enter", _this); TRACE_1("enter", _this);
#define FCS_UPDATE_DELAY 1
FUNC(magnitude) = { FUNC(magnitude) = {
_this distance [0, 0, 0] _this distance [0, 0, 0]
}; };
@ -17,42 +19,37 @@ FUNC(mat_normalize3d) = {
}; };
FUNC(laserHudDesignatePFH) = { FUNC(laserHudDesignatePFH) = {
private["_args", "_laserTarget", "_shooter", "_vehicle", "_weapon", "_gunnerInfo", "_turret", "_pov", "_gunBeg", "_gunEnd", "_povPos", "_povDir", "_result", "_resultPositions", "_firstResult", "_forceUpdateTime"];
_args = _this select 0; _args = _this select 0;
_laserTarget = _args select 0; _laserTarget = _args select 0;
_shooter = _args select 1; _shooter = _args select 1;
if( (count _args) < 3) then {
_args set[2, diag_tickTime + FCS_UPDATE_DELAY];
};
_forceUpdateTime = _args select 2;
_vehicle = vehicle _shooter; _vehicle = vehicle _shooter;
_weapon = currentWeapon _vehicle; _weapon = currentWeapon _vehicle;
TRACE_1("", _args);
if(!alive _shooter || isNull _vehicle || isNull _laserTarget || !GVAR(laserActive) ) exitWith { 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 // Retrieve the gunner and turret memory point information
_gunnerInfo = [_vehicle, _weapon] call CBA_fnc_getFirer; _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); _result = [_povPos, _povDir] call EFUNC(laser,shootCone);
if((count _result) > 0) then { if((count _result) > 0) then {
_resultPositions = _result select 2; _resultPositions = _result select 2;
@ -64,22 +61,46 @@ FUNC(laserHudDesignatePFH) = {
// Just regular use of lasers will commonly make them move this much, // Just regular use of lasers will commonly make them move this much,
// but not across multiple close frames. // but not across multiple close frames.
// This loses accuracy a little, but saves position updates per frame. // 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( (_laserTarget distance _pos) > 0.1) then {
TRACE_1("LaserPos Update", "");
_laserTarget setPosATL (ASLToATL _pos); _laserTarget setPosATL (ASLToATL _pos);
//}; };
if(diag_tickTime > _forceUpdateTime) then {
_args set[2, diag_tickTime + FCS_UPDATE_DELAY];
};
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLToATL _pos, 0.75, 0.75, 0, "", 0.5, 0.025, "TahomaB"]; drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], (getPosATL _laserTarget), 0.75, 0.75, 0, "", 0.5, 0.025, "TahomaB"];
{
private["_position"];
_position = _x select 0;
drawLine3d [ASLToATL _povPos, ASLToATL _position, [0,0,1,1] ];
} forEach _resultPositions;
#endif #endif
}; };
}; };
_this set[0, _args];
}; };
private "_laserTarget";
private "_handle";
if(isNil QGVAR(laser)) then { if(isNil QGVAR(laser)) then {
_laserTarget = "LaserTarget" createVehicle (getpos player);
_laserTarget = "LaserTargetW" createVehicle (getpos player);
GVAR(laserActive) = true; GVAR(laserActive) = true;
_handle = [FUNC(laserHudDesignatePFH), 0, [_laserTarget, player]] call cba_fnc_addPerFrameHandler; _handle = [FUNC(laserHudDesignatePFH), 0.1, [_laserTarget, player]] call cba_fnc_addPerFrameHandler;
_laserTarget setVariable ["ACE_PFH_HANDLE", _handle, false]; _laserTarget setVariable ["ACE_PFH_HANDLE", _handle, false];
GVAR(laser) = _laserTarget; GVAR(laser) = _laserTarget;

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

@ -1,6 +1,9 @@
// by commy2 // by commy2
#include "script_component.hpp" #include "script_component.hpp"
// fixes laser when being captured. Needed, because the selectionpsoition of the right hand is used
["SetHandcuffed", {if (_this select 1) then {(_this select 0) action ["GunLightOff", _this select 0]};}] call EFUNC(common,addEventHandler);
if !(hasInterface) exitWith {}; if !(hasInterface) exitWith {};
GVAR(nearUnits) = []; GVAR(nearUnits) = [];

View File

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

View File

@ -17,7 +17,6 @@
</Key> </Key>
<Key ID="STR_ACE_Laserpointer_useLaser"> <Key ID="STR_ACE_Laserpointer_useLaser">
<Original>&lt;t color='#9cf953'&gt;Use: &lt;/t&gt;Turn Laser ON/OFF</Original>
<English>&lt;t color='#9cf953'&gt;Use: &lt;/t&gt;Turn Laser ON/OFF</English> <English>&lt;t color='#9cf953'&gt;Use: &lt;/t&gt;Turn Laser ON/OFF</English>
<Czech>&lt;t color='#9cf953'&gt;Použití: &lt;/t&gt;Zapnout/vypnout laser</Czech> <Czech>&lt;t color='#9cf953'&gt;Použití: &lt;/t&gt;Zapnout/vypnout laser</Czech>
<French>&lt;t color='#9cf953'&gt;Utiliser : &lt;/t&gt;laser on/off</French> <French>&lt;t color='#9cf953'&gt;Utiliser : &lt;/t&gt;laser on/off</French>

View File

@ -1,13 +0,0 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_FiredBIS_EventHandlers {
class AllVehicles {
class ADDON {
firedBIS = QUOTE(_this call FUNC(forceMagazineMuzzleVelocity));
};
};
};

View File

@ -22,7 +22,6 @@ class CfgMagazines {
descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_mag_SDDescription"; descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_mag_SDDescription";
picture = "\A3\weapons_f\data\ui\m_30stanag_caseless_green_CA.paa"; picture = "\A3\weapons_f\data\ui\m_30stanag_caseless_green_CA.paa";
initSpeed = 320; initSpeed = 320;
GVAR(forceMagazineMuzzleVelocity) = 1;
}; };
class ACE_30Rnd_65x39_caseless_mag_AP: 30Rnd_65x39_caseless_mag { class ACE_30Rnd_65x39_caseless_mag_AP: 30Rnd_65x39_caseless_mag {
@ -58,7 +57,6 @@ class CfgMagazines {
displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_SDNameShort"; displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_SDNameShort";
descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_SDDescription"; descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_SDDescription";
initSpeed = 320; initSpeed = 320;
GVAR(forceMagazineMuzzleVelocity) = 1;
}; };
class ACE_30Rnd_65x39_caseless_green_mag_AP: 30Rnd_65x39_caseless_green { class ACE_30Rnd_65x39_caseless_green_mag_AP: 30Rnd_65x39_caseless_green {
@ -90,7 +88,6 @@ class CfgMagazines {
displayNameShort = "$STR_ACE_30Rnd_556x45_mag_SDNameShort"; displayNameShort = "$STR_ACE_30Rnd_556x45_mag_SDNameShort";
descriptionShort = "$STR_ACE_30Rnd_556x45_mag_SDDescription"; descriptionShort = "$STR_ACE_30Rnd_556x45_mag_SDDescription";
initSpeed = 320; initSpeed = 320;
GVAR(forceMagazineMuzzleVelocity) = 1;
picture = "\A3\weapons_f\data\ui\m_30stanag_green_ca.paa"; picture = "\A3\weapons_f\data\ui\m_30stanag_green_ca.paa";
}; };
@ -130,7 +127,6 @@ class CfgMagazines {
displayNameShort = "$STR_ACE_20Rnd_762x51_mag_SDNameShort"; displayNameShort = "$STR_ACE_20Rnd_762x51_mag_SDNameShort";
descriptionShort = "$STR_ACE_20Rnd_762x51_mag_SDDescription"; descriptionShort = "$STR_ACE_20Rnd_762x51_mag_SDDescription";
initSpeed = 320; initSpeed = 320;
GVAR(forceMagazineMuzzleVelocity) = 1;
}; };
class ACE_20Rnd_762x51_Mag_AP: 20Rnd_762x51_Mag { class ACE_20Rnd_762x51_Mag_AP: 20Rnd_762x51_Mag {

View File

@ -1,7 +0,0 @@
#include "script_component.hpp"
ADDON = false;
PREP(forceMagazineMuzzleVelocity);
ADDON = true;

View File

@ -12,8 +12,6 @@ class CfgPatches {
}; };
}; };
#include "CfgEventHandlers.hpp"
#include "CfgAmmo.hpp" #include "CfgAmmo.hpp"
#include "CfgMagazines.hpp" #include "CfgMagazines.hpp"
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"

View File

@ -1,41 +0,0 @@
/*
* Author: commy2
*
* DESCRIPTION.
*
* Arguments:
* firedBIS
*
* Return Value:
* None
*/
#include "script_component.hpp"
private ["_weapon", "_magazine", "_projectile"];
_weapon = _this select 1;
_magazine = _this select 5;
_projectile = _this select 6;
if (getNumber (configFile >> "CfgMagazines" >> _magazine >> QGVAR(forceMagazineMuzzleVelocity)) != 1) exitWith {
//hint str (speed _projectile / 3.6);
};
private ["_initSpeedWeapon", "_initSpeedMagazine"];
_initSpeedWeapon = getNumber (configFile >> "CfgWeapons" >> _weapon >> "initSpeed");
_initSpeedMagazine = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
//systemChat format ["W: %1m/s, M: %2m/s", _initSpeedWeapon, _initSpeedMagazine];
// force magazine initSpeed
private ["_credit", "_debit"];
_credit = vectorMagnitude velocity _projectile;
_debit = _credit + (_initSpeedMagazine - _initSpeedWeapon);
_projectile setVelocity ((velocity _projectile) vectorMultiply (_debit / _credit));
//hint str (speed _projectile / 3.6);

View File

@ -1 +0,0 @@
#include "\z\ace\addons\magazines\script_component.hpp"

View File

@ -77,21 +77,9 @@ class ACE_Medical_Actions {
callbackProgress = ""; callbackProgress = "";
animationPatient = ""; animationPatient = "";
animationPatientUnconscious = ""; animationPatientUnconscious = "";
itemConsumed = 0; itemConsumed = 1;
litter[] = {}; litter[] = {};
}; };
/*class PersonalAidKit: Bandage {
displayName = "";
displayNameProgress = "";
items[] = {"ACE_personalAidKit"};
treatmentLocations[] = {"All"};
requiredMedic = 1;
treatmentTime = 15;
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_fullHeal));
itemConsumed = 0;
animationCaller = "AinvPknlMstpSlayW[wpn]Dnon_medic";
litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"}}, {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}, {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} };
};*/
}; };
class Advanced { class Advanced {
@ -204,7 +192,7 @@ class ACE_Medical_Actions {
displayName = ""; displayName = "";
displayNameProgress = ""; displayNameProgress = "";
items[] = {"ACE_surgicalKit"}; items[] = {"ACE_surgicalKit"};
treatmentLocations[] = {"MedicalFacility", "MedicalVehicle"}; treatmentLocations[] = {QGVAR(useLocation_SurgicalKit)};
requiredMedic = QGVAR(medicSetting_SurgicalKit); requiredMedic = QGVAR(medicSetting_SurgicalKit);
treatmentTime = 10; treatmentTime = 10;
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_surgicalKit)); callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_surgicalKit));
@ -216,7 +204,7 @@ class ACE_Medical_Actions {
displayName = ""; displayName = "";
displayNameProgress = ""; displayNameProgress = "";
items[] = {"ACE_personalAidKit"}; items[] = {"ACE_personalAidKit"};
treatmentLocations[] = {"All"}; treatmentLocations[] = {QGVAR(useLocation_PAK)};
requiredMedic = QGVAR(medicSetting_PAK); requiredMedic = QGVAR(medicSetting_PAK);
treatmentTime = 10; treatmentTime = 10;
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_fullHeal)); callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_fullHeal));
@ -265,7 +253,7 @@ class ACE_Medical_Actions {
condition = "((_this select 1) getvariable ['ACE_medical_inCardiacArrest', false])"; condition = "((_this select 1) getvariable ['ACE_medical_inCardiacArrest', false])";
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR)); callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR));
callbackFailure = ""; callbackFailure = "";
callbackProgress = "((_this select 1) getvariable ['ACE_medical_inCardiacArrest', false])"; callbackProgress = "(((_this select 0) select 1) getvariable ['ACE_medical_inCardiacArrest', false])";
animationPatient = ""; animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationCaller = "AinvPknlMstpSlayWnonDnon_medic"; animationCaller = "AinvPknlMstpSlayWnonDnon_medic";
@ -288,7 +276,7 @@ class ACE_Medical_Actions {
callbackProgress = ""; callbackProgress = "";
animationPatient = ""; animationPatient = "";
animationPatientUnconscious = ""; animationPatientUnconscious = "";
itemConsumed = 0; itemConsumed = 1;
litter[] = {}; litter[] = {};
}; };
}; };

View File

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

View File

@ -17,6 +17,11 @@ class Extended_Init_EventHandlers {
init = QUOTE(call COMPILE_FILE(XEH_init)); init = QUOTE(call COMPILE_FILE(XEH_init));
}; };
}; };
class ACE_bodyBagObject {
class ADDON {
init = QUOTE(_this call DEFUNC(dragging,initObject));
};
};
}; };
class Extended_Respawn_EventHandlers { class Extended_Respawn_EventHandlers {

View File

@ -128,6 +128,12 @@ class CfgVehicles {
typeName = "NUMBER"; typeName = "NUMBER";
defaultValue = 1; defaultValue = 1;
}; };
class keepLocalSettingsSynced {
displayName = "Sync status";
description = "Keep unit status synced. Recommended on.";
typeName = "BOOL";
defaultValue = 1;
};
}; };
class ModuleDescription { class ModuleDescription {
description = "Provides a medical system for both players and AI."; description = "Provides a medical system for both players and AI.";
@ -135,7 +141,7 @@ class CfgVehicles {
}; };
}; };
class ACE_moduleTreatmentConfiguration: ACE_Module { class ACE_moduleTreatmentSettings: ACE_Module {
scope = 2; scope = 2;
displayName = "Treatment Settings [ACE]"; displayName = "Treatment Settings [ACE]";
icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa));
@ -198,7 +204,7 @@ class CfgVehicles {
defaultValue = 1800; defaultValue = 1800;
}; };
class medicSetting_PAK { class medicSetting_PAK {
displayName = "Allow PAK"; displayName = "Allow PAK (Adv)";
description = "Who can use the PAK for full heal?"; description = "Who can use the PAK for full heal?";
typeName = "NUMBER"; typeName = "NUMBER";
class values { class values {
@ -208,7 +214,7 @@ class CfgVehicles {
}; };
}; };
class consumeItem_PAK { class consumeItem_PAK {
displayName = "Remove PAK on use"; displayName = "Remove PAK on use (Adv)";
description = "Should PAK be removed on usage?"; description = "Should PAK be removed on usage?";
typeName = "NUMBER"; typeName = "NUMBER";
class values { class values {
@ -216,14 +222,30 @@ class CfgVehicles {
class remove { name = "Yes"; value = 1; default = 1; }; class remove { name = "Yes"; value = 1; default = 1; };
}; };
}; };
class useLocation_PAK {
displayName = "Locations PAK (Adv)";
description = "Where can the personal aid kit be used?";
typeName = "NUMBER";
class values {
class anywhere { name = "Anywhere"; value = 0; };
class vehicle { name = "Medical Vehicles"; value = 1; };
class facility { name = "Medical facility"; value = 2; };
class vehicleAndFacility { name = "Vehicles & facility"; value = 3; default = 1; };
class disabled { name = "Disabled"; value = 4;};
};
};
class medicSetting_SurgicalKit: medicSetting_PAK { class medicSetting_SurgicalKit: medicSetting_PAK {
displayName = "Allow Surgical kit"; displayName = "Allow Surgical kit (Adv)";
description = "Who can use the surgical kit?"; description = "Who can use the surgical kit?";
}; };
class consumeItem_SurgicalKit: consumeItem_PAK { class consumeItem_SurgicalKit: consumeItem_PAK {
displayName = "Remove Surgical kit"; displayName = "Remove Surgical kit (Adv)";
description = "Should Surgical kit be removed on usage?"; description = "Should Surgical kit be removed on usage?";
}; };
class useLocation_SurgicalKit: useLocation_PAK {
displayName = "Locations Surgical kit (Adv)";
description = "Where can the Surgical kit be used?";
};
}; };
class ModuleDescription { class ModuleDescription {
@ -591,12 +613,26 @@ class CfgVehicles {
}; };
}; };
class MapBoard_altis_F; class MapBoard_altis_F;
class ACE_bodyBag: MapBoard_altis_F { class ACE_bodyBagObject: MapBoard_altis_F {
XEH_ENABLED;
scope = 1; scope = 1;
side = -1; side = -1;
model = QUOTE(PATHTOF(data\bodybag.p3d)); model = QUOTE(PATHTOF(data\bodybag.p3d));
icon = ""; icon = "";
displayName = $STR_ACE_MEDICAL_BODYBAG_DISPLAY; displayName = $STR_ACE_MEDICAL_BODYBAG_DISPLAY;
EGVAR(dragging,canDrag) = 1;
EGVAR(dragging,dragPosition[]) = {0,1.2,0};
EGVAR(dragging,dragDirection) = 0;
class ACE_Actions {
class ACE_MainActions {
displayName = "$STR_ACE_Interaction_MainAction";
distance = 5;
condition = QUOTE(true);
statement = "";
icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa";
selection = "";
};
};
}; };
// Medical litter classes // Medical litter classes
@ -850,7 +886,7 @@ class CfgVehicles {
scope = 2; scope = 2;
accuracy = 1000; accuracy = 1000;
displayName = "[ACE] Medical Supply Crate"; displayName = "[ACE] Medical Supply Crate";
model = "\A3\weapons_F\AmmoBoxes\AmmoBox_F"; model = PATHTOF(data\ace_medcrate.p3d);
author = "$STR_ACE_Common_ACETeam"; author = "$STR_ACE_Common_ACETeam";
class TransportItems { class TransportItems {
class ACE_fieldDressing { class ACE_fieldDressing {

View File

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

View File

@ -13,6 +13,28 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"];
["medical_woundUpdateRequest", FUNC(onWoundUpdateRequest)] call ace_common_fnc_addEventHandler; ["medical_woundUpdateRequest", FUNC(onWoundUpdateRequest)] call ace_common_fnc_addEventHandler;
["interactMenuClosed", {[objNull, false] call FUNC(displayPatientInformation); }] call ace_common_fnc_addEventHandler; ["interactMenuClosed", {[objNull, false] call FUNC(displayPatientInformation); }] call ace_common_fnc_addEventHandler;
["medical_onUnconscious", {
if (local (_this select 0)) then {
_unit = _this select 0;
if (_this select 1) then {
_unit setVariable ["tf_globalVolume", 0.4];
_unit setVariable ["tf_voiceVolume", 0, true];
_unit setVariable ["tf_unable_to_use_radio", true, true];
_unit setVariable ["acre_sys_core_isDisabled", true, true];
_unit setVariable ["acre_sys_core_globalVolume", 0.4];
} else {
_unit setVariable ["tf_globalVolume", 1];
_unit setVariable ["tf_voiceVolume", 1, true];
_unit setVariable ["tf_unable_to_use_radio", true, true];
_unit setVariable ["acre_sys_core_isDisabled", true, true];
_unit setVariable ["acre_sys_core_globalVolume", 1];
};
};
}] call ace_common_fnc_addEventHandler;
// Initialize all effects // Initialize all effects
_fnc_createEffect = { _fnc_createEffect = {
private ["_type", "_layer", "_default"]; private ["_type", "_layer", "_default"];

View File

@ -45,6 +45,7 @@ PREP(handleDamage_wounds);
PREP(handleUnitVitals); PREP(handleUnitVitals);
PREP(handleKilled); PREP(handleKilled);
PREP(handleLocal); PREP(handleLocal);
PREP(handleBandageOpening);
PREP(hasItem); PREP(hasItem);
PREP(hasItems); PREP(hasItems);
PREP(hasMedicalEnabled); PREP(hasMedicalEnabled);
@ -53,6 +54,7 @@ PREP(init);
PREP(isBeingCarried); PREP(isBeingCarried);
PREP(isBeingDragged); PREP(isBeingDragged);
PREP(isInMedicalFacility); PREP(isInMedicalFacility);
PREP(isInMedicalVehicle);
PREP(isMedic); PREP(isMedic);
PREP(isMedicalVehicle); PREP(isMedicalVehicle);
PREP(itemCheck); PREP(itemCheck);

View File

@ -2,7 +2,7 @@
class CfgPatches { class CfgPatches {
class ADDON { class ADDON {
units[] = {"ACE_medicalSupplyCrate", "ACE_fieldDressingItem", "ACE_packingBandageItem", "ACE_elasticBandageItem", "ACE_tourniquetItem", "ACE_morphineItem", "ACE_atropineItem", "ACE_epinephrineItem", "ACE_plasmaIVItem", "ACE_bloodIVItem", "ACE_salineIVItem", "ACE_quikclotItem", "ACE_personalAidKitItem", "ACE_surgicalKitItem", "ACE_bodyBagItem"}; units[] = {"ACE_medicalSupplyCrate", "ACE_fieldDressingItem", "ACE_packingBandageItem", "ACE_elasticBandageItem", "ACE_tourniquetItem", "ACE_morphineItem", "ACE_atropineItem", "ACE_epinephrineItem", "ACE_plasmaIVItem", "ACE_bloodIVItem", "ACE_salineIVItem", "ACE_quikclotItem", "ACE_personalAidKitItem", "ACE_surgicalKitItem", "ACE_bodyBagItem", "ACE_bodyBagObject"};
weapons[] = {"ACE_fieldDressing", "ACE_packingBandage", "ACE_elasticBandage", "ACE_tourniquet", "ACE_morphine", "ACE_atropine", "ACE_epinephrine", "ACE_plasmaIV", "ACE_plasmaIV_500", "ACE_plasmaIV_250", "ACE_bloodIV", "ACE_bloodIV_500", "ACE_bloodIV_250", "ACE_salineIV", "ACE_salineIV_500", "ACE_salineIV_250", "ACE_quikclot", "ACE_personalAidKit", "ACE_surgicalKit", "ACE_bodyBag"}; weapons[] = {"ACE_fieldDressing", "ACE_packingBandage", "ACE_elasticBandage", "ACE_tourniquet", "ACE_morphine", "ACE_atropine", "ACE_epinephrine", "ACE_plasmaIV", "ACE_plasmaIV_500", "ACE_plasmaIV_250", "ACE_bloodIV", "ACE_bloodIV_500", "ACE_bloodIV_250", "ACE_salineIV", "ACE_salineIV_500", "ACE_salineIV_250", "ACE_quikclot", "ACE_personalAidKit", "ACE_surgicalKit", "ACE_bodyBag"};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {ace_common, ace_interaction, ace_modules}; requiredAddons[] = {ace_common, ace_interaction, ace_modules};

Binary file not shown.

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