Merge branch 'master' into medical-rewrite

Conflicts:
	addons/medical/functions/fnc_determineIfFatal.sqf
	addons/medical/functions/fnc_displayPatientInformation.sqf
This commit is contained in:
PabstMirror 2017-06-03 12:37:28 -05:00
commit ddccfe563b
197 changed files with 2755 additions and 1619 deletions

View File

@ -1,4 +1,4 @@
# ACE3 CONTRIBUTOR LIST
# ACE3 CONTRIBUTOR LIST
# If you contributed, but are not listed here, contact me:
# koffeinflummi@gmail.com
#
@ -38,6 +38,7 @@ Aggr094 <bastards4glory@gmail.com>
alef <alefor@gmail.com>
Aleksey EpMAK Yermakov <epmak777@gmail.com>
Alganthe <alganthe@live.fr>
Andrea "AtixNeon" Verano <veranoandrea88@gmail.com>
Anthariel <Contact@storm-simulation.com>
Arkhir <wonsz666@gmail.com >
Asgar Serran <piechottaf@web.de>
@ -83,6 +84,7 @@ Harakhti <shadowdragonphd@gmail.com>
havena <silveredenis@gmail.com>
Hawkins
Head <brobergsebastian@gmail.com>
Hybrid V
Karneck <dschultz26@hotmail.com>
Kavinsky <nmunozfernandez@gmail.com>
Kllrt <kllrtik@gmail.com>

Binary file not shown.

Binary file not shown.

View File

@ -93,6 +93,7 @@ GVAR(ammoMagLookup) = call CBA_fnc_createNamespace;
// Set last thrown time on Vanilla Throwing and Advanced Throwing
["ace_firedPlayer", {
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon"];
if (_weapon == "Throw") then {
_unit setVariable [QGVAR(lastThrownTime), CBA_missionTime];
};

View File

@ -36,6 +36,11 @@ if (_throwable isEqualTo [] && {!_primed}) exitWith {
private _throwableMag = _throwable param [0, "#none"];
// If not primed, double check we actually have the magazine in inventory
if ((!_primed) && {!(_throwableMag in (magazines ACE_player))}) exitWith {
[ACE_player, "No valid throwable (glitched currentThrowable)"] call FUNC(exitThrowMode);
};
// Get correct throw power for primed grenade
if (_primed) then {
private _ammoType = typeOf _activeThrowable;

View File

@ -34,7 +34,8 @@ if !(_unit getVariable [QGVAR(primed), false]) then {
_activeThrowable setVelocity [0, 0, -0.1];
// Set thrower
[QEGVAR(common,setShotParents), [_activeThrowable, _unit, (getShotParents _activeThrowable) select 1]] call CBA_fnc_serverEvent;
private _instigator = (getShotParents _activeThrowable) param [1, _unit]; // getShotParents could be [] on replaced grenades (like IR chemlight)
[QEGVAR(common,setShotParents), [_activeThrowable, _unit, _instigator]] call CBA_fnc_serverEvent;
};
// Restore muzzle ammo (setAmmo 1 has no impact if no appliccable throwable in inventory)

View File

@ -39,29 +39,20 @@ class CfgAmmo {
// also adjust tracer, "muh lightshow"; also adjust splash damage radius
class Gatling_30mm_HE_Plane_CAS_01_F: BulletBase {
hit = 80;
indirectHit = 12;
indirectHitRange = 3; //2;
caliber = 1.4;
deflecting = 3;
fuseDistance = 3;
tracerStartTime = 0.02;
timeToLive = 40;
hit = 80; // default: 180
indirectHit = 12; // default: 4
indirectHitRange = 3; // default: 3
caliber = 1.4; // default: 5
deflecting = 3; // default: 5
fuseDistance = 3; // default: 10
tracerStartTime = 0.02; // default: 0.1
timeToLive = 40; // default: 6
};
// helper projectiles to simulate a rof > fps
class ACE_Gatling_30mm_HE_Plane_CAS_01_Deploy: Gatling_30mm_HE_Plane_CAS_01_F {
simulation = "shotSubmunitions";
triggerTime = 0;
submunitionAmmo = "ACE_Gatling_30mm_HE_Plane_CAS_01_Sub";
submunitionConeType[] = {"custom", {{0,0}, {0,0}, {0,0}} };
};
class ACE_Gatling_30mm_HE_Plane_CAS_01_Sub: Gatling_30mm_HE_Plane_CAS_01_F {};
// adjust damage and splash damage, closer to bluefor gatling with same caliber
class Cannon_30mm_HE_Plane_CAS_02_F: Gatling_30mm_HE_Plane_CAS_01_F {
hit = 70; //40;
indirectHit = 11; //14;
indirectHitRange = 3;
hit = 70; // default: 150
indirectHit = 11; // default: 4
indirectHitRange = 3; // default: 3
};
};

View File

@ -2,7 +2,6 @@ class CfgMagazines {
// shoot helper object to tripple rof
class VehicleMagazine;
class 1000Rnd_Gatling_30mm_Plane_CAS_01_F: VehicleMagazine {
ammo = "ACE_Gatling_30mm_HE_Plane_CAS_01_Deploy";
count = 1170;
};

View File

@ -33,12 +33,10 @@ class CfgVehicles {
class Turrets: Turrets {
class CopilotTurret;
};
//class UserActions;
};
class Heli_Light_01_base_F: Helicopter_Base_H {
lockDetectionSystem = 0;
incomingMissileDetectionSystem = 16;
incomingMissileDetectionSystem = 16; // Vanilla: 0
driverCanEject = 1;
class Turrets: Turrets {
@ -49,16 +47,8 @@ class CfgVehicles {
};
};
class Heli_Light_01_unarmed_base_F: Heli_Light_01_base_F {};
class B_Heli_Light_01_F: Heli_Light_01_unarmed_base_F {
/*class Turrets: Turrets {
class CopilotTurret: CopilotTurret {};
};*/
};
class Heli_Light_01_armed_base_F: Heli_Light_01_base_F {
lockDetectionSystem = 0;
incomingMissileDetectionSystem = 16;
incomingMissileDetectionSystem = 16; // Vanilla: 0
driverCanEject = 1;
class Turrets: Turrets {
@ -67,13 +57,10 @@ class CfgVehicles {
};
};
};
class B_Heli_Light_01_armed_F: Heli_Light_01_armed_base_F {};
class Heli_Light_02_base_F: Helicopter_Base_H {
driverCanEject = 1;
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
magazines[] = {"2000Rnd_762x51_Belt_T_Green", "12Rnd_PG_missiles", "168Rnd_CMFlare_Chaff_Magazine"};
incomingMissileDetectionSystem = 16; // Vanilla: 24
magazines[] = {"2000Rnd_762x51_Belt_T_Green", "12Rnd_PG_missiles", "168Rnd_CMFlare_Chaff_Magazine"}; // Switch gun magazine to 7.62mm from 6.5mm
class Turrets: Turrets {
class CopilotTurret: CopilotTurret {
@ -91,10 +78,8 @@ class CfgVehicles {
#include "Heli_Attack_01_base_F.hpp"
class B_Heli_Attack_01_F: Heli_Attack_01_base_F {};
class Heli_Attack_02_base_F: Helicopter_Base_F {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
incomingMissileDetectionSystem = 16; // Vanilla: 24
driverCanEject = 1;
class Turrets: Turrets {
@ -105,8 +90,7 @@ class CfgVehicles {
};
class Heli_Transport_01_base_F: Helicopter_Base_H {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
incomingMissileDetectionSystem = 16; // Vanilla: 24
driverCanEject = 1;
class Turrets: Turrets {
@ -116,35 +100,19 @@ class CfgVehicles {
};
class MainTurret: MainTurret {
magazines[] = {"2000Rnd_762x51_Belt_T_Red"};
magazines[] = {"2000Rnd_762x51_Belt_T_Red"}; // Switch gun magazine to 7.62mm from 6.5mm
canEject = 1;
};
class RightDoorGun: MainTurret {
magazines[] = {"2000Rnd_762x51_Belt_T_Red"};
magazines[] = {"2000Rnd_762x51_Belt_T_Red"}; // Switch gun magazine to 7.62mm from 6.5mm
canEject = 1;
};
};
/*class UserActions {
class DoorL1_Open {
available = 1;
condition = "((this doorPhase 'door_L') == 0) AND Alive(this) AND driver this != player AND gunner this != player";
};
class DoorR1_Open: DoorL1_Open {
condition = "((this doorPhase 'door_R') == 0) AND Alive(this) AND driver this != player AND gunner this != player";
};
class DoorL1_Close: DoorL1_Open {
condition = "((this doorPhase 'door_L') > 0) AND Alive(this) AND driver this != player AND gunner this != player";
};
class DoorR1_Close: DoorL1_Close {
condition = "((this doorPhase 'door_R') > 0) AND Alive(this) AND driver this != player AND gunner this != player";
};
};*/
};
class Heli_Transport_02_base_F: Helicopter_Base_H {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
incomingMissileDetectionSystem = 16; // Vanilla: 24
driverCanEject = 1;
class Turrets: Turrets {
@ -153,112 +121,51 @@ class CfgVehicles {
showHMD = 1;
};
};
/*class UserActions: UserActions {
class DoorL1_Open {
available = 1;
condition = "this animationPhase ""door_back_L"" < 0.5 AND Alive(this)";
};
class DoorR1_Open: DoorL1_Open {
condition = "this animationPhase ""door_back_R"" < 0.5 AND Alive(this)";
};
class DoorL1_Close: DoorL1_Open {
condition = "this animationPhase ""door_back_L"" > 0.5 AND Alive(this)";
};
class DoorR1_Close: DoorL1_Close {
condition = "this animationPhase ""door_back_R"" > 0.5 AND Alive(this)";
};
class CargoRamp_Open: DoorL1_Open {
userActionID = 52;
displayName = CSTRING(OpenCargoRamp);
textToolTip = CSTRING(OpenCargoRamp);
position = "action_cargoramp";
radius = 3.0;
condition = "this animationPhase ""cargoramp_open"" < 0.5 AND Alive(this)";
statement = "this animateDoor ['cargoramp_open', 1]";
};
class CargoRamp_Close: DoorL1_Close {
userActionID = 55;
displayName = CSTRING(CloseCargoRamp);
textToolTip = CSTRING(CloseCargoRamp);
position = "action_cargoramp";
radius = 3.0;
condition = "this animationPhase ""cargoramp_open"" > 0.5 AND Alive(this)";
statement = "this animateDoor ['cargoramp_open', 0]";
};
};*/
};
class Heli_light_03_base_F: Helicopter_Base_F {
lockDetectionSystem = 0; // Vanilla: 12
incomingMissileDetectionSystem = 16; // Vanilla: 24
driverCanEject = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
canEject = 1;
};
};
};
class I_Heli_light_03_F: Heli_light_03_base_F {
lockDetectionSystem = 0;
incomingMissileDetectionSystem = 16;
weapons[] = {"M134_minigun", "missiles_DAR", "CMFlareLauncher", "ACE_AIR_SAFETY" };
magazines[] = {"5000Rnd_762x51_Yellow_Belt", "24Rnd_missiles", "168Rnd_CMFlare_Chaff_Magazine"};
class Turrets: Turrets {
class MainTurret: MainTurret {
showHMD = 1;
gunBeg = "commanderview";
gunEnd = "laserstart";
memoryPointGun = "laserstart";
stabilizedInAxes = 3;
weapons[] = {"Laserdesignator_mounted"};
soundServo[] = {"", 0.01, 1, 30};
weapons[] = {"Laserdesignator_mounted"}; // Add Laser Designator
magazines[] = {"Laserbatteries"};
inGunnerMayFire = 1;
};
};
};
class Heli_light_03_unarmed_base_F: Heli_light_03_base_F {};
class I_Heli_light_03_unarmed_F: Heli_light_03_unarmed_base_F {};
class Plane_CAS_01_base_F: Plane_Base_F {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
lockDetectionSystem = 12; // Vanilla: 8
incomingMissileDetectionSystem = 16; // Vanilla: 24
};
class Plane_CAS_02_base_F: Plane_Base_F {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
lockDetectionSystem = 12; // Vanilla: 8
incomingMissileDetectionSystem = 16; // Vanilla: 24
};
class Plane_Fighter_03_base_F: Plane_Base_F {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
};
class UAV_01_base_F: Helicopter_Base_F {
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/
lockDetectionSystem = 12; // Vanilla: 8
incomingMissileDetectionSystem = 16; // Vanilla: 24
};
class UAV_02_base_F: UAV {
weapons[] = {};
weapons[] = {}; // Remove flare launcher
magazines[] = {};
class Turrets {
class MainTurret;
};
};
class UAV_02_CAS_base_F: UAV_02_base_F {
weapons[] = {};
weapons[] = {}; // Remove flare launcher
magazines[] = {};
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/
};
class Heli_Transport_03_base_F: Helicopter_Base_H {
incomingMissileDetectionSystem = 16; // Vanilla: 24
driverCanEject = 1;
class Turrets: Turrets {
@ -267,14 +174,8 @@ class CfgVehicles {
};
};
};
class B_Heli_Transport_03_F: Heli_Transport_03_base_F {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
};
class Heli_Transport_04_base_F: Helicopter_Base_H {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
incomingMissileDetectionSystem = 16; // Vanilla: 24
driverCanEject = 1;
class Turrets: Turrets {
@ -287,28 +188,4 @@ class CfgVehicles {
};
};
};
class O_Heli_Transport_04_bench_F: Heli_Transport_04_base_F {
class Turrets: Turrets {
class CopilotTurret: CopilotTurret {
canEject = 1;
};
class LoadmasterTurret: LoadmasterTurret {
canEject = 1;
};
};
};
class O_Heli_Transport_04_covered_F: Heli_Transport_04_base_F {
class Turrets: Turrets {
class CopilotTurret: CopilotTurret {
canEject = 1;
};
class LoadmasterTurret: LoadmasterTurret {
canEject = 1;
};
};
};
};

View File

@ -111,22 +111,4 @@ class CfgWeapons {
class medium: LowROF {};
class far: medium {};
};
class Gatling_30mm_Plane_CAS_01_F: CannonCore {
autoFire = 1;
burst = 1;
class LowROF: Mode_FullAuto {
autoFire = 0;
burst = 22; //65;
reloadTime = 0.0462; //0.0154; //0.034;
multiplier = 3;
};
class close: LowROF {};
class near: close {};
class short: close {};
class medium: close {};
class far: close {};
};
};

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
ace_aircraft
============
Changes to air weaponry, flight models and HUDs.
Changes to air weaponry, ejection and HUDs.
- Contributions by Kimi (geraldbolso1899) for HUD updates

37
addons/cargo/CfgEden.hpp Normal file
View File

@ -0,0 +1,37 @@
class Cfg3DEN {
class Object {
class AttributeCategories {
class ace_attributes {
class Attributes {
class GVAR(space) {
displayName = CSTRING(space_edenName);
tooltip = CSTRING(space_edenDesc);
property = QGVAR(space);
control = "Edit";
expression = QUOTE([ARR_2(_this,_value)] call DFUNC(setSpace););
defaultValue = QUOTE(GET_NUMBER(configFile >> 'CfgVehicles' >> typeOf _this >> QQGVAR(space),0));
validate = "number";
condition = "objectHasInventoryCargo";
typeName = "NUMBER";
};
class GVAR(size) {
displayName = CSTRING(size_edenName);
tooltip = CSTRING(size_edenDesc);
property = QGVAR(size);
control = "Edit";
// Expression only runs on the server, must handle actions for all machines and future JIPs (Why BI?!)
expression = QUOTE([ARR_2(_this,_value)] call DFUNC(setSize););
defaultValue = QUOTE(GET_NUMBER(configFile >> 'CfgVehicles' >> typeOf _this >> QQGVAR(size),-1));
validate = "number";
condition = "1-objectBrain";
typeName = "NUMBER";
};
};
};
};
};
};

View File

@ -24,52 +24,3 @@ class Extended_Killed_EventHandlers {
};
};
};
//Need initPost or we have problems with setVariable with 'ACE_Cargo'
class Extended_InitPost_EventHandlers {
class ThingX {
class ADDON {
init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle));
};
};
class Land_PaperBox_closed_F {
class ADDON {
init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle));
};
};
class PlasticCase_01_base_F {
class ADDON {
init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle));
};
};
class LandVehicle {
class ADDON {
init = QUOTE(_this call DFUNC(initVehicle));
};
};
class Air {
class ADDON {
init = QUOTE(_this call DFUNC(initVehicle));
};
};
class Ship_F {
class ADDON {
init = QUOTE(_this call DFUNC(initVehicle));
};
};
class ACE_ConcertinaWireCoil {
class ADDON {
init = QUOTE(_this call DFUNC(initObject));
};
};
class Land_PortableLight_single_F {
class ADDON {
init = QUOTE(_this call DFUNC(initObject));
};
};
class StaticWeapon {
class ADDON {
init = QUOTE(_this call DFUNC(initObject));
};
};
};

View File

@ -285,7 +285,7 @@ class CfgVehicles {
GVAR(space) = 4;
GVAR(hasCargo) = 1;
};
// autonomus
class UAV_01_base_F: Helicopter_Base_F {
GVAR(space) = 0;
@ -346,7 +346,7 @@ class CfgVehicles {
GVAR(space) = 8;
GVAR(hasCargo) = 1;
};
class StaticMortar;
class Mortar_01_base_F: StaticMortar {
GVAR(size) = 2; // 1 = small, 2 = large

View File

@ -1,9 +1,8 @@
PREP(addCargoItem);
PREP(canLoad);
PREP(addCargoVehiclesActions);
PREP(canLoadItemIn);
PREP(canUnloadItem);
PREP(findNearestVehicle);
PREP(getCargoSpaceLeft);
PREP(getSizeItem);
PREP(handleDestroyed);
@ -15,6 +14,8 @@ PREP(moduleMakeLoadable);
PREP(moduleSettings);
PREP(onMenuOpen);
PREP(paradropItem);
PREP(setSize);
PREP(setSpace);
PREP(startLoadIn);
PREP(startUnload);
PREP(unloadItem);

View File

@ -51,3 +51,28 @@
_item hideObjectGlobal false;
_item setPosASL (AGLtoASL _emptyPosAGL);
}] call CBA_fnc_addEventHandler;
// Private events to handle adding actions globally via public functions
[QGVAR(initObject), DFUNC(initObject)] call CBA_fnc_addEventHandler;
[QGVAR(initVehicle), DFUNC(initVehicle)] call CBA_fnc_addEventHandler;
// Add all the vehicle init EHs (require initPost for set/get variables)
["LandVehicle", "initPost", DFUNC(initVehicle), nil, nil, true] call CBA_fnc_addClassEventHandler;
["Air", "initPost", DFUNC(initVehicle), nil, nil, true] call CBA_fnc_addClassEventHandler;
["Ship_F", "initPost", DFUNC(initVehicle), nil, nil, true] call CBA_fnc_addClassEventHandler;
// Add all the object init EHs
["StaticWeapon", "initPost", DFUNC(initObject), nil, nil, true] call CBA_fnc_addClassEventHandler;
["Land_PortableLight_single_F", "initPost", DFUNC(initObject), nil, nil, true] call CBA_fnc_addClassEventHandler;
["ACE_ConcertinaWireCoil", "initPost", DFUNC(initObject), nil, nil, true] call CBA_fnc_addClassEventHandler;
// Add all the vehicle/object init EHs
["ThingX", "initPost", {
_this call DFUNC(initObject); _this call DFUNC(initVehicle);
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
["Land_PaperBox_closed_F", "initPost", {
_this call DFUNC(initObject); _this call DFUNC(initVehicle);
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
["PlasticCase_01_base_F", "initPost", {
_this call DFUNC(initObject); _this call DFUNC(initVehicle);
}, nil, nil, true] call CBA_fnc_addClassEventHandler;

View File

@ -15,6 +15,7 @@ class CfgPatches {
};
#include "ACE_Settings.hpp"
#include "CfgEden.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
#include "menu.hpp"

View File

@ -0,0 +1,45 @@
/*
* Author: Dystopian
* Create actions for nearest vehicles with cargo.
*
* Arguments:
* 0: Target <OBJECT>
* 1: Player <OBJECT>
*
* Return Value:
* Children actions <ARRAY>
*
* Example:
* [target, player] call ace_cargo_fnc_addCargoVehiclesActions
*
* Public: No
*/
#include "script_component.hpp"
params ["_target", "_player"];
private _statement = {
params ["_target", "_player", "_params"];
_params params ["_vehicle"];
[_player, _target, _vehicle] call FUNC(startLoadIn);
};
private _actions = [];
{
private _config = configFile >> "CfgVehicles" >> typeOf _x;
private _hasCargoPublic = _x getVariable [QGVAR(hasCargo), false];
private _hasCargoConfig = getNumber (_config >> QGVAR(hasCargo)) == 1;
if ((_hasCargoPublic || _hasCargoConfig) && {_x != _target}) then {
private _name = getText (_config >> "displayName");
private _ownerName = [_x, true] call EFUNC(common,getName);
if ("" != _ownerName) then {
_name = format ["%1 (%2)", _name, _ownerName];
};
private _icon = (getText (_config >> "icon")) call BIS_fnc_textureVehicleIcon;
private _action = [format ["%1", _x], _name, _icon, _statement, {true}, {}, [_x]] call EFUNC(interact_menu,createAction);
_actions pushBack [_action, [], _target];
};
} forEach (nearestObjects [_player, CARGO_VEHICLE_CLASSES, MAX_LOAD_DISTANCE]);
_actions

View File

@ -1,36 +0,0 @@
/*
* Author: Glowbal
* Check if player can load an item into the nearest vehicle.
*
* Arguments:
* 0: Player <OBJECT>
* 1: Object to load <OBJECT>
*
* Return Value:
* Can load <BOOL>
*
* Example:
* [player, object] call ace_cargo_fnc_canLoad
*
* Public: No
*/
#include "script_component.hpp"
params ["_player", "_object"];
TRACE_2("params",_player,_object);
if (!([_player, _object, []] call EFUNC(common,canInteractWith))) exitWith {false};
private _nearestVehicle = [_player, _object] call FUNC(findNearestVehicle);
if (_nearestVehicle isKindOf "Cargo_Base_F" || isNull _nearestVehicle) then {
{
if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_nearestVehicle = _x};
} forEach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]);
};
if (isNull _nearestVehicle) exitWith {false};
if ((locked _nearestVehicle) >= 2) exitWith {false};
[_object, _nearestVehicle] call FUNC(canLoadItemIn)

View File

@ -1,41 +0,0 @@
/*
* Author: Glowbal
* Get nearest vehicle from unit that is not excluded, priority: Car-Air-Tank-Ship.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Object to exclude <OBJECT>
*
* Return Value:
* Vehicle in Distance <OBJECT>
*
* Example:
* [unit, object] call ace_cargo_fnc_findNearestVehicle
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit","_object"];
private _loadCar = nearestObjects [_unit, ["car"], MAX_LOAD_DISTANCE];
_loadCar deleteAt (_loadCar find _object);
if !(_loadCar isEqualTo []) exitWith {_loadCar select 0};
private _loadHelicopter = nearestObjects [_unit, ["air"], MAX_LOAD_DISTANCE];
_loadHelicopter deleteAt (_loadHelicopter find _object);
if !(_loadHelicopter isEqualTo []) exitWith {_loadHelicopter select 0};
private _loadTank = nearestObjects [_unit, ["tank"], MAX_LOAD_DISTANCE];
_loadTank deleteAt (_loadTank find _object);
if !(_loadTank isEqualTo []) exitWith {_loadTank select 0};
private _loadShip = nearestObjects [_unit, ["ship"], MAX_LOAD_DISTANCE];
_loadShip deleteAt (_loadShip find _object);;
if !(_loadShip isEqualTo []) exitWith {_loadShip select 0};
private _loadContainer = nearestObjects [_unit, ["Cargo_base_F"], MAX_LOAD_DISTANCE];
_loadContainer deleteAt (_loadContainer find _object);
if !(_loadContainer isEqualTo []) exitWith {_loadContainer select 0};
objNull

View File

@ -18,4 +18,4 @@
params ["_object"];
// TRACE_1("params",_object);
_object getVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(space))]
(_object getVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(space))]) max 0

View File

@ -1,5 +1,5 @@
/*
* Author: Glowbal
* Author: Glowbal, SilentSpike
* Get the cargo size of an object.
*
* Arguments:
@ -17,23 +17,13 @@
params ["_item"];
scopeName "return";
private _isVirtual = (_item isEqualType "");
private _itemClass = if (_isVirtual) then {_item} else {typeOf _item};
private _config = (configFile >> "CfgVehicles" >> _itemClass >> QGVAR(size));
if (_isVirtual) then {
if (isNumber _config) then {
(getNumber _config) breakOut "return";
};
// Virtual items are much easier to deal with
if (_item isEqualType "") then {
CARGO_SIZE(_item)
} else {
if (!isNil {_item getVariable QGVAR(size)}) then {
(_item getVariable QGVAR(size)) breakOut "return";
};
if (isNumber _config) then {
(getNumber _config) breakOut "return";
if (isNil {_item getVariable QGVAR(size)}) then {
CARGO_SIZE(typeOf _item)
} else {
_item getVariable QGVAR(size)
};
};
-1

View File

@ -1,5 +1,5 @@
/*
* Author: Glowbal
* Author: Glowbal, SilentSpike
* Initializes variables for loadable objects. Called from init EH.
*
* Arguments:
@ -19,20 +19,44 @@ params ["_object"];
private _type = typeOf _object;
TRACE_2("params",_object,_type);
if ((_object getVariable [QGVAR(canLoad), getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(canLoad))]) != 1) exitWith {};
// If object had size given to it via eden/public then override config canLoad setting
private _canLoadPublic = _object getVariable [QGVAR(canLoad), false];
private _canLoadConfig = getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(canLoad)) == 1;
// do nothing if the class is already initialized
// Nothing to do here if object can't be loaded
if !(_canLoadConfig || _canLoadPublic) exitWith {};
// Servers and HCs do not require action menus (beyond this point)
if !(hasInterface) exitWith {};
// Unnecessary to add actions to an object class that's already got them
if (_type in GVAR(initializedItemClasses)) exitWith {};
GVAR(initializedItemClasses) pushBack _type;
if (_object getVariable [QGVAR(initObject),false]) exitWith {};
TRACE_1("Adding load cargo action to class", _type);
// Objects given size via eden have their actions added to the object
// So this function may run for multiple of the same class in that case
if (_canLoadConfig) then {
GVAR(initializedItemClasses) pushBack _type;
TRACE_1("Adding load cargo action to class", _type);
} else {
_object setVariable [QGVAR(initObject),true];
TRACE_1("Adding load cargo action to object", _object);
};
// Vehicles with passengers inside are prevented from being loaded in `fnc_canLoadItemIn`
private _condition = {
//IGNORE_PRIVATE_WARNING ["_target", "_player"];
GVAR(enable) &&
{(_target getVariable [QGVAR(canLoad), getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(canLoad))]) == 1} &&
{(_target getVariable [QGVAR(canLoad), getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(canLoad)) == 1])} &&
{locked _target < 2} &&
{alive _target} &&
{[_player, _target, []] call EFUNC(common,canInteractWith)}
{[_player, _target, []] call EFUNC(common,canInteractWith)} &&
{0 < {
private _type = typeOf _x;
private _hasCargoPublic = _x getVariable [QGVAR(hasCargo), false];
private _hasCargoConfig = getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) == 1;
(_hasCargoPublic || _hasCargoConfig) && {_x != _target}
} count (nearestObjects [_player, CARGO_VEHICLE_CLASSES, MAX_LOAD_DISTANCE])}
};
private _statement = {
params ["_target", "_player"];
@ -41,6 +65,10 @@ private _statement = {
private _text = localize LSTRING(loadObject);
private _icon = QPATHTOF(UI\Icon_load.paa);
private _action = [QGVAR(load), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction);
[_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass);
private _action = [QGVAR(load), _text, _icon, _statement, _condition, {call FUNC(addCargoVehiclesActions)}] call EFUNC(interact_menu,createAction);
if (_canLoadConfig) then {
[_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass);
} else {
[_object, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToObject);
};

View File

@ -20,8 +20,14 @@ TRACE_1("params", _vehicle);
private _type = typeOf _vehicle;
if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) exitWith {};
// If vehicle had space given to it via eden/public then override config hasCargo setting
private _hasCargoPublic = _vehicle getVariable [QGVAR(hasCargo), false];
private _hasCargoConfig = getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) == 1;
// Nothing to do here if vehicle has no cargo space
if !(_hasCargoConfig || _hasCargoPublic) exitWith {};
// Vehicle can have default ace cargo in its config
if (isServer) then {
{
if (isClass _x) then {
@ -33,19 +39,33 @@ if (isServer) then {
} count ("true" configClasses (configFile >> "CfgVehicles" >> _type >> "ACE_Cargo" >> "Cargo"));
};
// do nothing if the class is already initialized
// Servers and HCs do not require action menus (beyond this point)
if !(hasInterface) exitWith {};
// Unnecessary to add actions to a vehicle class that's already got them
if (_type in GVAR(initializedVehicleClasses)) exitWith {};
// set class as initialized
GVAR(initializedVehicleClasses) pushBack _type;
if (_vehicle getVariable [QGVAR(initVehicle),false]) exitWith {};
if (!hasInterface) exitWith {};
TRACE_1("Adding unload cargo action to class", _type);
// Vehicles given cargo via eden have their actions added to the object
// So this function may run for multiple of the same class in that case
if (_hasCargoConfig) then {
GVAR(initializedVehicleClasses) pushBack _type;
TRACE_1("Adding unload cargo action to class", _type);
} else {
_vehicle setVariable [QGVAR(initVehicle),true];
TRACE_1("Adding unload cargo action to object", _vehicle);
};
private _condition = {
GVAR(enable) && {locked _target < 2} && {alive _target} && {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)}
//IGNORE_PRIVATE_WARNING ["_target", "_player"];
GVAR(enable) &&
{(_target getVariable [QGVAR(hasCargo), getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(hasCargo)) == 1])} &&
{locked _target < 2} &&
{alive _target} &&
{[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)}
};
private _statement = {
//IGNORE_PRIVATE_WARNING ["_target", "_player"];
GVAR(interactionVehicle) = _target;
GVAR(interactionParadrop) = false;
createDialog QGVAR(menu);
@ -54,11 +74,16 @@ private _text = localize LSTRING(openMenu);
private _icon = "";
private _action = [QGVAR(openMenu), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction);
[_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass);
if (_hasCargoConfig) then {
[_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass);
} else {
[_vehicle, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToObject);
};
// Add the paradrop self interaction for planes and helicopters
if (_vehicle isKindOf "Air") then {
private _condition = {
//IGNORE_PRIVATE_WARNING ["_target", "_player"];
GVAR(enable) && {[_player, _target, []] call EFUNC(common,canInteractWith)} && {
private _turretPath = _player call CBA_fnc_turretPath;
(_player == (driver _target)) || // pilot
@ -66,6 +91,7 @@ if (_vehicle isKindOf "Air") then {
{_turretPath in (getArray (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(loadmasterTurrets)))}} // loadMaster turret from config
};
private _statement = {
//IGNORE_PRIVATE_WARNING ["_target", "_player"];
GVAR(interactionVehicle) = _target;
GVAR(interactionParadrop) = true;
createDialog QGVAR(menu);
@ -74,5 +100,9 @@ if (_vehicle isKindOf "Air") then {
private _icon = "";
private _action = [QGVAR(openMenu), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction);
[_type, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToClass); // self action on the vehicle
if (_hasCargoConfig) then {
[_type, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToClass); // self action on the vehicle
} else {
[_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject);
};
};

View File

@ -17,6 +17,13 @@
*/
#include "script_component.hpp"
// Only run this after the settings are initialized
if !(EGVAR(common,settingsInitFinished)) exitWith {
EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(makeLoadable), _this];
};
ACE_DEPRECATED(QFUNC(makeLoadable),"3.12.0",QFUNC(setSize));
params [["_object", objNull, [objNull]], ["_canLoad", true, [false, 0]], ["_setSize", 1, [0]]];
TRACE_3("params",_object,_canLoad,_setSize);
@ -25,7 +32,7 @@ private _type = typeOf _object;
private _cfgCanLoad = getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(canLoad));
private _curSize = [_object] call FUNC(getSizeItem);
_canLoad = [0, 1] select _canLoad; //convert true/false to scalar
_canLoad = [0, 1] select _canLoad; // Convert true/false to scalar
if ((_canLoad == 1) && {_setSize <= 0}) exitWith {
ERROR("ace_cargo_fnc_makeLoadable (size <= 0) when making loadable");
@ -33,7 +40,7 @@ if ((_canLoad == 1) && {_setSize <= 0}) exitWith {
TRACE_2("setVar if different from config",_canLoad,_cfgCanLoad);
if (_canLoad != _cfgCanLoad) then {
_object setVariable [QGVAR(canLoad), _canLoad];
_object setVariable [QGVAR(canLoad), _canLoad == 1];
};
TRACE_2("setVar if different from config",_setSize,_curSize);

View File

@ -20,6 +20,8 @@
params ["_logic", "_objects", "_activated"];
TRACE_3("params",_logic,_objects,_activated);
ACE_DEPRECATED(QFUNC(moduleMakeLoadable),"3.12.0","Eden editor object attributes");
if ((isNull _logic) || {!_activated}) exitWith {};
if (_objects isEqualTo []) exitWith {
WARNING_1("ace_cargo_fnc_moduleMakeLoadable has no synced objects [%1]", _logic);

View File

@ -32,9 +32,9 @@ private _itemSize = [_item] call FUNC(getSizeItem);
_vehicle setVariable [QGVAR(space), (_cargoSpace + _itemSize), true];
(boundingBoxReal _vehicle) params ["_bb1", "_bb2"];
private _distBehind = ((_bb1 select 1) min (_bb2 select 1)) - 3; // 3 meters behind max bounding box
private _distBehind = ((_bb1 select 1) min (_bb2 select 1)) - 4; // 4 meters behind max bounding box
TRACE_1("",_distBehind);
private _posBehindVehicleAGL = _vehicle modelToWorld [0, _distBehind, -1];
private _posBehindVehicleAGL = _vehicle modelToWorld [0, _distBehind, -2];
private _itemObject = if (_item isEqualType objNull) then {
@ -49,7 +49,7 @@ private _itemObject = if (_item isEqualType objNull) then {
_newItem
};
_itemObject setVelocity ((velocity _vehicle) vectorAdd ((vectorNormalized (vectorDir _vehicle)) vectorMultiply 10));
_itemObject setVelocity ((velocity _vehicle) vectorAdd ((vectorNormalized (vectorDir _vehicle)) vectorMultiply -5));
// open parachute and ir light effect
[{

View File

@ -0,0 +1,56 @@
/*
* Author: SilentSpike
* Set the cargo size of any object. Has global effect.
* Adds the load action menu if necessary.
* Negative size makes unloadable.
*
* Arguments:
* 0: Object <OBJECT>
* 1: Cargo size <NUMBER>
*
* Return Value:
* None
*
* Example:
* [cursorTarget, 3] call ace_cargo_fnc_setSize
*
* Public: Yes
*/
#include "script_component.hpp"
// Only run this after the settings are initialized
if !(EGVAR(common,settingsInitFinished)) exitWith {
EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setSize), _this];
};
params [
["_object",objNull,[objNull]],
["_size",nil,[0]] // Default can't be a number since all are valid
];
TRACE_2("setSize",_object,_size);
// Nothing to do here
if (
(isNil "_size") ||
{isNull _object} ||
{_size == _object getVariable [QGVAR(size), CARGO_SIZE(typeOf _object)]}
) exitWith {};
// Apply new size globally
// Necessary to update value, even if unloadable, as API could be used again
_object setVariable [QGVAR(canLoad), _size >= 0, true];
_object setVariable [QGVAR(size), _size, true];
// If no size no need for load action
if (_size < 0) exitWith {};
// If an existing ID is present, load action has already been added globally
private _jipID = _object getVariable QGVAR(setSize_jipID);
// Actions should be added to all future JIP players too
if (isNil "_jipID") then {
_jipID = [QGVAR(initObject), [_object]] call CBA_fnc_globalEventJIP;
// Store the ID for any future calls to this function
_object setVariable [QGVAR(setSize_jipID), _jipID, true];
};

View File

@ -0,0 +1,55 @@
/*
* Author: SilentSpike
* Set the cargo space of any object. Has global effect.
* Adds the cargo action menu if necessary.
*
* Arguments:
* 0: Object <OBJECT>
* 1: Cargo space <NUMBER>
*
* Return Value:
* None
*
* Example:
* [vehicle player, 20] call ace_cargo_fnc_setSpace
*
* Public: Yes
*/
#include "script_component.hpp"
// Only run this after the settings are initialized
if !(EGVAR(common,settingsInitFinished)) exitWith {
EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setSpace), _this];
};
params [
["_vehicle",objNull,[objNull]],
["_space",nil,[0]] // Default can't be a number since all are valid
];
TRACE_2("setSpace",_vehicle,_size);
// Nothing to do here
if (
(isNil "_space") ||
{isNull _vehicle} ||
{_space == _vehicle getVariable [QGVAR(space), CARGO_SPACE(typeOf _vehicle)]}
) exitWith {};
// Apply new space globally
// Necessary to update value, even if no space, as API could be used again
_vehicle setVariable [QGVAR(hasCargo), _space > 0, true];
_vehicle setVariable [QGVAR(space), _space, true];
// If no cargo space no need for cargo menu
if (_space <= 0) exitWith {};
// If an existing ID is present, cargo menu has already been added globally
private _jipID = _vehicle getVariable QGVAR(setSpace_jipID);
// Cargo menu should be added to all future JIP players too
if (isNil "_jipID") then {
_jipID = [QGVAR(initVehicle), [_vehicle]] call CBA_fnc_globalEventJIP;
// Store the ID for any future calls to this function
_vehicle setVariable [QGVAR(setSpace_jipID), _jipID, true];
};

View File

@ -5,6 +5,7 @@
* Arguments:
* 0: Player <OBJECT>
* 1: Object <OBJECT>
* 2: Vehicle <OBJECT> (Optional)
*
* Return Value:
* Load ProgressBar Started <BOOL>
@ -16,15 +17,14 @@
*/
#include "script_component.hpp"
params ["_player", "_object"];
TRACE_2("params",_player,_object);
params ["_player", "_object", ["_cargoVehicle", objNull]];
TRACE_3("params",_player,_object,_cargoVehicle);
private _vehicle = [_player, _object] call FUNC(findNearestVehicle);
if ((isNull _vehicle) || {_vehicle isKindOf "Cargo_Base_F"}) then {
private _vehicle = _cargoVehicle;
if (isNull _vehicle) then {
{
if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_vehicle = _x};
} forEach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]);
} forEach (nearestObjects [_player, CARGO_VEHICLE_CLASSES, MAX_LOAD_DISTANCE]);
};
if (isNull _vehicle) exitWith {

View File

@ -17,3 +17,11 @@
#include "\z\ace\addons\main\script_macros.hpp"
#define MAX_LOAD_DISTANCE 10
#define CARGO_VEHICLE_CLASSES ["Car", "Air", "Tank", "Ship", "Cargo_base_F", "Land_PaperBox_closed_F"]
#define GET_NUMBER(config,default) (if (isNumber (config)) then {getNumber (config)} else {default})
// Default cargo size is -1 as 0 is a valid size
#define CARGO_SIZE(classname) GET_NUMBER(configFile >> "CfgVehicles" >> (classname) >> QGVAR(size),-1)
#define CARGO_SPACE(classname) GET_NUMBER(configFile >> "CfgVehicles" >> (classname) >> QGVAR(space),0)

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="Cargo">
<Key ID="STR_ACE_Cargo_loadObject">
@ -237,6 +237,18 @@
<Japanese>オブジェクトの大きさ</Japanese>
<Korean>물체 크기</Korean>
</Key>
<Key ID="STR_ACE_Cargo_space_edenName">
<English>Cargo Space</English>
</Key>
<Key ID="STR_ACE_Cargo_space_edenDesc">
<English>The cargo space available in this vehicle/container</English>
</Key>
<Key ID="STR_ACE_Cargo_size_edenName">
<English>Cargo Size</English>
</Key>
<Key ID="STR_ACE_Cargo_size_edenDesc">
<English>The cargo space required to hold this object (-1 for unloadable)</English>
</Key>
<Key ID="STR_ACE_Cargo_paradropButton">
<English>Airdrop</English>
<German>Türlast</German>
@ -259,11 +271,13 @@
<English>Paradrop Time Coffecient</English>
<Japanese>空中投下までの時間係数</Japanese>
<Italian>Coefficente Tempo Lancio Paracadute</Italian>
<French>Coefficient Temps de largage de cargaison</French>
</Key>
<Key ID="STR_ACE_Cargo_paradropTimeCoefficent_description">
<English>Modifier for how long it takes to paradrop a cargo item.</English>
<Japanese>カーゴ アイテムを空中投下するまでの時間を変更します。</Japanese>
<Italian>Modificato per quanto tempo ci impiega a paracadutare un oggetto cargo.</Italian>
<French>Modifier le temps qu'il faut pour larguer la cargaison.</French>
</Key>
</Package>
</Project>

View File

@ -37,6 +37,7 @@ PREP(displayTextPicture);
PREP(displayTextStructured);
PREP(doAnimation);
PREP(doGesture);
PREP(dummy);
PREP(dropBackpack);
PREP(endRadioTransmission);
PREP(eraseCache);

View File

@ -15,6 +15,7 @@
params ["_client"];
[GVAR(syncedEvents), {
//IGNORE_PRIVATE_WARNING ["_key", "_value"];
_value params ["", "_eventLog"];
["ACEs", [_key, _eventLog], _client] call CBA_fnc_targetEvent;

View File

@ -33,11 +33,12 @@ if ((_namespace getVariable [_uid, [-99999]]) select 0 < diag_tickTime) then {
missionNamespace setVariable [_varName, _cacheList];
[_event, {
// _eventName is defined on the function that calls the event
#ifdef DEBUG_MODE_FULL
INFO_1("Clear cached variables on event: %1",_eventName);
#endif
// Get the list of caches to clear
//IGNORE_PRIVATE_WARNING ["_eventName"];
// _eventName is defined on the function that calls the event
private _varName = format [QGVAR(clearCache_%1), _eventName];
private _cacheList = missionNamespace getVariable [_varName, []];
// Erase all the cached results

View File

@ -0,0 +1,12 @@
/*
* Author: SilentSpike
* A dummy function which does nothing. Can be useful.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Public: No
*/

View File

@ -21,11 +21,14 @@ if (_unit isKindOf "CAManBase") then {
_return = {_x == _magazine} count magazines _unit;
} else {
{
_return = _return + {_x == _magazine} count magazines _x;
_return = _return + ({_x == _magazine} count magazines _x);
false
} count crew _unit;
_return = _return + ({_x == _magazine} count getMagazineCargo _unit);
(getMagazineCargo _unit) params [["_magNames", []], ["_magCount", []]];
{
if (_magazine == _x) exitWith {_return = _return + (_magCount select _forEachIndex)};
} forEach _magNames;
};
_return

View File

@ -15,7 +15,7 @@
*/
#include "script_component.hpp"
params [["_unit", objNull], ["_switch", false], ["_id", ""], ["_side", side _unit]];
params [["_unit", objNull], ["_switch", false], ["_id", ""], ["_side", sideUnknown]];
private _previousGroupsList = _unit getVariable [QGVAR(previousGroupSwitchTo), []];

View File

@ -14,7 +14,7 @@
*/
#include "script_component.hpp"
PARAMS_2(_wirecoil,_unit);
params ["_wirecoil", "_unit"];
private _wireNoGeo = "ACE_ConcertinaWireNoGeo" createVehicle [0,0,0];
{

View File

@ -13,7 +13,7 @@
*/
#include "script_component.hpp"
PARAMS_1(_wire);
params ["_wire"];
{
_wire animate [_x, 1];

View File

@ -2,8 +2,12 @@
class CfgSFX {
class GVAR(CookOff) {
name = QGVAR(cookoff);
sounds[] = {QGVAR(cookoff)};
GVAR(cookoff)[] = {PATHTOF(sounds\cookoff.wss),6,1.8,400,1,0,0,0};
// Index 4 is percentage chance to play, in theory high pressure is way more likely
variant0[] = {PATHTOF(sounds\cookoff_low_pressure.ogg),6,1,400,0.1,0,0,0};
variant1[] = {PATHTOF(sounds\cookoff_mid_pressure.ogg),6,1,400,0.25,0,0,0};
variant2[] = {PATHTOF(sounds\cookoff_high_pressure.ogg),6,1,400,0.65,0,0,0};
sounds[] = {"variant0","variant1","variant2"};
titles[] = {};
empty[] = {"",0,0,0,0,0,0,0};
};
};

View File

@ -91,6 +91,7 @@ if (local _vehicle) then {
} forEach _positions;
if (isServer) then {
// TODO - Players in the vehicle hear no sound (even after exiting the vehicle)
private _sound = createSoundSource [QGVAR(Sound), position _vehicle, [], 0];
_effects pushBack _sound;
@ -107,11 +108,12 @@ if (local _vehicle) then {
DEC(_counter);
if (_counter > 0) then {
[_fnc_FlameEffect, [_vehicle, _fnc_FlameEffect, _counter], 0.4] call CBA_fnc_waitAndExecute
[_fnc_FlameEffect, [_vehicle, _fnc_FlameEffect, _counter], FLAME_EFFECT_DELAY] call CBA_fnc_waitAndExecute
};
};
[_vehicle, _fnc_FlameEffect, 12] call _fnc_FlameEffect; // recursive function
// Recursive function, occurs for duration of cookoff
[_vehicle, _fnc_FlameEffect, ceil(COOKOFF_TIME/FLAME_EFFECT_DELAY)] call _fnc_FlameEffect;
private _randomPosition = _vehicle getPos [100, random 360];
@ -132,6 +134,6 @@ if (local _vehicle) then {
if (local _vehicle) then {
_vehicle setDamage 1;
};
}, [_vehicle, _effects], 14] call CBA_fnc_waitAndExecute;
}, [_vehicle, _effects, _positions], 10.5] call CBA_fnc_waitAndExecute;
}, _vehicle, 3] call CBA_fnc_waitAndExecute;
}, [_vehicle, _effects], COOKOFF_TIME] call CBA_fnc_waitAndExecute; // TODO: Randomise cook off time with locality in mind
}, [_vehicle, _effects, _positions], SMOKE_TIME] call CBA_fnc_waitAndExecute;
}, _vehicle, IGNITE_TIME] call CBA_fnc_waitAndExecute;

View File

@ -71,6 +71,6 @@ if (local _box) then {
if (local _box) then {
_box setDamage 1;
};
}, [_box, _effects], 82.5] call CBA_fnc_waitAndExecute; // Give signifcant time for ammo cookoff to occur (perhaps keep the box alive until all cooked off?)
}, [_box, _effects], 10.5] call CBA_fnc_waitAndExecute;
}, _box, 3] call CBA_fnc_waitAndExecute;
}, [_box, _effects], COOKOFF_TIME_BOX] call CBA_fnc_waitAndExecute; // TODO: Change so that box is alive until no ammo left, with locality in mind
}, [_box, _effects], SMOKE_TIME] call CBA_fnc_waitAndExecute;
}, _box, IGNITE_TIME] call CBA_fnc_waitAndExecute;

View File

@ -17,3 +17,13 @@
#include "\z\ace\addons\main\script_macros.hpp"
#define IS_EXPLOSIVE_AMMO(ammo) (getNumber (ammo call CBA_fnc_getObjectConfig >> "explosive") > 0.5)
// Stages of cookoff in order (in seconds)
// Should be no un-synced randomness in these as the effects must be ran on each client
#define IGNITE_TIME 3
#define SMOKE_TIME 10.5
#define COOKOFF_TIME 14 // Cook off time should be 20s at most due to length of sound files
#define COOKOFF_TIME_BOX 82.5 // Cook off time for boxes should be significant to allow time for ammo to burn
// Delay between flame effect for players in a cooking off vehicle
#define FLAME_EFFECT_DELAY 0.4

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -5,6 +5,7 @@ class CfgWeapons {
magazines[] = {"ACE_PreloadedMissileDummy"}; // The dummy magazine
};
class ACE_launch_NLAW_Used_F: launch_NLAW_F { // the used tube should be a sub class of the disposable launcher
EGVAR(nlaw,enabled) = 0; // disable guidance for the disposabled tube
scope = 1;
ACE_isUsedLauncher = 1;
author = ECSTRING(common,ACETeam);

View File

@ -16,6 +16,8 @@
*/
#include "script_component.hpp"
//IGNORE_PRIVATE_WARNING ["_thisArgs", "_thisID"]; // From CBA_fnc_addBISEventHandler;
params ["_unit", "_anim"];
_thisArgs params ["_realUnit"];
TRACE_4("params",_unit,_anim,_realUnit,_thisID);

View File

@ -18,7 +18,7 @@
*/
#include "script_component.hpp"
//IGNORE_PRIVATE_WARNING("_player", "_target");
//IGNORE_PRIVATE_WARNING ["_player", "_target"];
params ["_object", "_enableDrag", "_position", "_direction"];
if (isNil "_position") then {

View File

@ -24,6 +24,7 @@ if ((ACE_player != vehicle ACE_player) && {!((vehicle ACE_player) isKindOf "Stat
private _iconSize = BASE_SIZE * 0.10713 * (call EFUNC(common,getZoom));
[+GVAR(fingersHash), {
//IGNORE_PRIVATE_WARNING ["_key", "_value"];
_value params ["_lastTime", "_pos", "_name"];
private _timeLeftToShow = _lastTime + FP_TIMEOUT - diag_tickTime;
if (_timeLeftToShow <= 0) then {

View File

@ -0,0 +1 @@
z\ace\addons\hellfire

View File

@ -0,0 +1,17 @@
class EGVAR(missileguidance,AttackProfiles) {
class hellfire {
// LOBL and LOAL-DIR behaive the same
name = "LOAL-DIR";
nameLocked = "LOBL";
functionName = QFUNC(attackProfile);
GVAR(launchHeightClear) = 0;
};
class hellfire_hi: hellfire {
name = "LOAL-HI";
GVAR(launchHeightClear) = 304.8; // clear 1000 ft by 1500m
};
class hellfire_lo: hellfire_hi {
name = "LOAL-LO";
GVAR(launchHeightClear) = 91.5; // clear 300 ft by 600m
};
};

View File

@ -0,0 +1,57 @@
class CfgAmmo {
class M_PG_AT;
class ACE_Hellfire_AGM114K: M_PG_AT {
displayName = "AGM-114K";
displayNameShort = "AGM-114K";
description = "AGM-114K";
descriptionShort = "AGM-114K";
model = "\A3\Weapons_F\Ammo\Missile_AT_03_fly_F";
proxyShape = "\A3\Weapons_F\Ammo\Missile_AT_03_F";
hit = 1400;
indirectHit = 71;
indirectHitRange = 4.5;
effectsMissile = "missile2";
irLock = 0;
laserLock = 0;
manualControl = 0;
maxSpeed = 450;
thrustTime = 2.5; // motor burn 2-3 sec
thrust = 250;
timeToLive = 40;
EGVAR(rearm,caliber) = 178;
class ace_missileguidance {
enabled = 1;
minDeflection = 0.0005; // Minium flap deflection for guidance
maxDeflection = 0.01; // Maximum flap deflection for guidance
incDeflection = 0.0005; // The incrmeent in which deflection adjusts.
canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode
// Guidance type for munitions
defaultSeekerType = "SALH";
seekerTypes[] = { "SALH", "LIDAR", "SARH", "Optic", "Thermal", "GPS", "SACLOS", "MCLOS" };
defaultSeekerLockMode = "LOAL";
seekerLockModes[] = { "LOAL", "LOBL" };
seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos]
seekerAngle = 70; // Angle in front of the missile which can be searched
seekerAccuracy = 1; // seeker accuracy multiplier
seekerMinRange = 1;
seekerMaxRange = 5000; // Range from the missile which the seeker can visually search
// Attack profile type selection
defaultAttackProfile = "hellfire";
attackProfiles[] = {"hellfire", "hellfire_hi", "hellfire_lo"};
};
};
};

View File

@ -0,0 +1,15 @@
class Extended_PreStart_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preStart));
};
};
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};

View File

@ -0,0 +1,47 @@
class CfgMagazines {
class 12Rnd_PG_missiles;
class 6Rnd_ACE_Hellfire_AGM114K: 12Rnd_PG_missiles { // Old style vehicle magazine
count = 6;
ammo = "ACE_Hellfire_AGM114K";
displayName = "AGM-114K [ACE]";
displayNameShort = "AGM-114K";
descriptionShort = "AGM-114K";
};
// 1.70 pylon magazines:
class PylonMissile_1Rnd_ACE_Hellfire_AGM114K: 6Rnd_ACE_Hellfire_AGM114K { // Bare missle
displayName = "1x AGM-114K [ACE]";
count = 1;
mass = 70;
pylonWeapon = QGVAR(launcher);
hardpoints[] = {"SCALPEL_1RND"};
model = "\A3\Weapons_F\DynamicLoadout\PylonMissile_1x_Bomb_04_F.p3d";
};
class PylonRack_1Rnd_ACE_Hellfire_AGM114K: 6Rnd_ACE_Hellfire_AGM114K { // 1x Launcher Support Rack
displayName = "1x AGM-114K [ACE]";
count = 1;
mass = 85;
pylonWeapon = QGVAR(launcher);
hardpoints[] = {"B_MISSILE_PYLON", "SCALPEL_1RND_EJECTOR", "B_ASRRAM_EJECTOR", "UNI_SCALPEL"};
model = "\A3\Weapons_F\DynamicLoadout\PylonPod_1x_Missile_AA_04_F.p3d";
};
class PylonRack_3Rnd_ACE_Hellfire_AGM114K: 6Rnd_ACE_Hellfire_AGM114K { // 3x Launcher Support Rack
displayName = "3x AGM-114K [ACE]";
count = 3;
mass = 250;
pylonWeapon = QGVAR(launcher);
hardpoints[] = {"B_MISSILE_PYLON", "UNI_SCALPEL"};
model = "\A3\Weapons_F\DynamicLoadout\PylonPod_3x_Missile_LG_scalpel_F.p3d";
mirrorMissilesIndexes[] = {2, 1, 3};
};
class PylonRack_4Rnd_ACE_Hellfire_AGM114K: 6Rnd_ACE_Hellfire_AGM114K { // 4x Launcher Support Rack
displayName = "4x AGM-114K [ACE]";
count = 4;
mass = 340;
pylonWeapon = QGVAR(launcher);
hardpoints[] = {"UNI_SCALPEL"};
model = "\A3\Weapons_F\DynamicLoadout\PylonPod_4x_Missile_LG_scalpel_F.p3d";
mirrorMissilesIndexes[] = {2, 1, 4, 3};
};
};

View File

@ -0,0 +1,6 @@
class CfgVehicles {
class Heli_Attack_01_base_F;
class Heli_Attack_01_dynamicLoadout_base_F: Heli_Attack_01_base_F {
GVAR(addLaserDesignator) = 1;
};
};

View File

@ -0,0 +1,13 @@
class CfgWeapons {
class missiles_SCALPEL;
class GVAR(launcher): missiles_SCALPEL {
displayName = CSTRING(Hellfire);
GVAR(enabled) = 1; // show attack profile / lock on hud
EGVAR(laser,canSelect) = 1; // can ace_laser lock (allows switching laser code)
canLock = 0;
weaponLockSystem = 0;
magazines[] = {"6Rnd_ACE_Hellfire_AGM114K", "PylonMissile_1Rnd_ACE_Hellfire_AGM114K", "PylonRack_1Rnd_ACE_Hellfire_AGM114K", "PylonRack_3Rnd_ACE_Hellfire_AGM114K", "PylonRack_4Rnd_ACE_Hellfire_AGM114K"};
lockingTargetSound[] = {"",0,1};
lockedTargetSound[] = {"",0,1};
};
};

10
addons/hellfire/README.md Normal file
View File

@ -0,0 +1,10 @@
ace_hellfire
==========
Adds AGM-114K Hellfire missiles.
## Maintainers
The people responsible for merging changes to this component or answering potential questions.
- [PabstMirror](https://github.com/PabstMirror)

View File

@ -0,0 +1,57 @@
class RscControlsGroupNoScrollbars;
class RscPictureKeepAspect;
class RscText;
class RscTitles {
class GVAR(modeDisplay) {
idd = -1;
onLoad = QUOTE(with uiNameSpace do { GVAR(display) = _this select 0 };);
movingEnable = 0;
duration = 60;
fadeIn = "false";
fadeOut = "false";
class controls {
class ModeControlGroup: RscControlsGroupNoScrollbars {
idc = IDC_MODECONTROLGROUP;
x = "3.8 * (((safezoneW / safezoneH) min 1.2) / 40) + (profilenamespace getvariable ['IGUI_GRID_WEAPON_X',((safezoneX + safezoneW) - (10 * (((safezoneW / safezoneH) min 1.2) / 40)) - 4.3 * (((safezoneW / safezoneH) min 1.2) / 40))])";
y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (profilenamespace getVariable ['IGUI_GRID_WEAPON_Y', (safezoneY + 0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])";
w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
class controls {
class AttackMode: RscText {
idc = IDC_ATTACKMODE;
colorText[] = {1, 1, 1, 1};
colorBackground[] = {0, 0, 0, 0};
x = "0";
y = "0";
w = "(2.6) * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class LaserCode: RscText {
idc = IDC_LASERCODE;
colorText[] = {1, 1, 1, 1};
colorBackground[] = {0, 0, 0, 0};
x = "(3.6) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
y = "0";
w = "(2.5) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
h = "(1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class LaserIcon: RscPictureKeepAspect {
idc = IDC_LASERICON;
colorText[] = {1, 0, 0, 1};
colorBackground[] = {0, 0, 0, 0};
text = "\a3\Ui_F_Curator\Data\CfgCurator\laser_ca.paa";
x = "(6.1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
y = "0";
w = "(1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
h = "(1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
};
};
};
};
};

View File

@ -0,0 +1,5 @@
LOG("prep");
PREP(attackProfile);
PREP(getAttackProfileSettings);
PREP(setupVehicle);
PREP(showHud);

View File

@ -0,0 +1,10 @@
#include "script_component.hpp"
if (!hasInterface) exitWith {};
GVAR(pfID) = -1;
["ace_settingsInitialized", {
["turret", LINKFUNC(showHud), false] call CBA_fnc_addPlayerEventHandler;
["vehicle", LINKFUNC(showHud), true] call CBA_fnc_addPlayerEventHandler; // only one of these needs the retro flag
}] call CBA_fnc_addEventHandler;

View File

@ -0,0 +1,9 @@
#include "script_component.hpp"
ADDON = false;
PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
ADDON = true;

View File

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

View File

@ -0,0 +1,23 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_interaction", "ace_missileguidance"};
author = ECSTRING(common,ACETeam);
authors[] = {"PabstMirror"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};
#include "ACE_GuidanceConfig.hpp"
#include "CfgAmmo.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgMagazines.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "RscTitles.hpp"

View File

@ -0,0 +1,85 @@
/*
* Author: PabstMirror
* Hellfire attack profile. Handles all 4 modes LOBL, LOAL-DIR, LOAL-HI, LOAL-LO
*
* Arguments:
* 0: Seeker Target PosASL <ARRAY>
* 1: Guidance Arg Array <ARRAY>
* 2: Attack Profile State <ARRAY>
*
* Return Value:
* Missile Aim PosASL <ARRAY>
*
* Example:
* [[1,2,3], [], []] call ace_hellfire_fnc_attackProfile
*
* Public: No
*/
// #define DEBUG_MODE_FULL
#include "script_component.hpp"
params ["_seekerTargetPos", "_args", "_attackProfileStateParams"];
_args params ["_firedEH", "_launchParams"];
_launchParams params ["","_targetLaunchParams"];
_targetLaunchParams params ["", "", "_launchPos"];
_firedEH params ["","","","","","","_projectile"];
// Get state params:
if (_attackProfileStateParams isEqualTo []) then {
_this call FUNC(getAttackProfileSettings);
};
_attackProfileStateParams params ["_attackStage", "_configLaunchHeightClear"];
private _projectilePos = getPosASL _projectile;
private _distanceFromLaunch2d = _launchPos distance2d _projectilePos;
private _heightAboveLaunch = (_projectilePos select 2) - (_launchPos select 2);
// Add height depending on distance for compensate
private _returnTargetPos = nil;
switch (_attackStage) do {
case STAGE_LAUNCH: { // Gain height quickly to pass terrain mask
_returnTargetPos = _projectilePos getPos [100, getDir _projectile];
_returnTargetPos set [2, (_projectilePos select 2) + 36.4]; // 100 and 36.4 gives a 20 deg angle
if (_heightAboveLaunch > _configLaunchHeightClear) then {
_attackProfileStateParams set [0, STAGE_SEEK_CRUISE];
TRACE_2("New Stage: STAGE_SEEK_CRUISE",_distanceFromLaunch2d,_heightAboveLaunch);
};
};
case STAGE_SEEK_CRUISE: { // Slowly gain altitude while searching for target
// Before 4000 cruise at 5.7 degrees up, then level out
private _cruiseHeight = linearConversion [3000, 5000, _distanceFromLaunch2d, 10, 0, true];
_returnTargetPos = _projectilePos getPos [100, getDir _projectile];
_returnTargetPos set [2, (_projectilePos select 2) + _cruiseHeight];
if (!(_seekerTargetPos isEqualTo [0,0,0])) then {
_attackProfileStateParams set [0, STAGE_ATTACK_CRUISE];
TRACE_1("New Stage: STAGE_ATTACK_CRUISE",_distanceFromLaunch2d);
};
};
case STAGE_ATTACK_CRUISE: {
private _currentHeightOverTarget = (_projectilePos select 2) - (_seekerTargetPos select 2);
private _distanceToTarget2d = _seekerTargetPos distance2d _projectilePos;
private _distToGoRatio = _distanceToTarget2d / (_launchPos distance2d _seekerTargetPos);
// arcing up at 7 degrees to start until 50% left, then smooth curve to a downward attack
private _gainSlope = linearConversion [0.5, 0.1, _distToGoRatio, 7, -7, true];
_returnTargetPos = +_seekerTargetPos;
_returnTargetPos set [2, ((_projectilePos select 2) + (_distanceToTarget2d * sin _gainSlope)) max (_seekerTargetPos select 2)];
if ((_distanceToTarget2d < 500) || {(_currentHeightOverTarget atan2 _distanceToTarget2d) > 15}) then { // Wait until we can come down at a sharp angle
_attackProfileStateParams set [0, STAGE_ATTACK_TERMINAL];
TRACE_2("New Stage: STAGE_ATTACK_TERMINAL",_distanceToTarget2d,_currentHeightOverTarget);
};
};
case STAGE_ATTACK_TERMINAL: {
private _distanceToTarget2d = _seekerTargetPos distance2d _projectilePos;
_returnTargetPos = _seekerTargetPos vectorAdd [0, 0, _distanceToTarget2d * 0.02];
};
};
// TRACE_1("Adjusted target position", _returnTargetPos);
_returnTargetPos;

View File

@ -0,0 +1,46 @@
/*
* Author: PabstMirror
* Gets attack profile parameters for first run of hellfire attack profile function
*
* Arguments:
* 0: Seeker Target PosASL <ARRAY>
* 1: Guidance Arg Array <ARRAY>
* 2: Attack Profile State <ARRAY>
*
* Return Value:
* Nothing
*
* Example:
* [[], [], []] call ace_hellfire_fnc_getAttackProfileSettings;
*
* Public: No
*/
// #define DEBUG_MODE_FULL
#include "script_component.hpp"
params ["_seekerTargetPos", "_args", "_attackProfileStateParams"];
_args params ["_firedEH", "_launchParams"];
_launchParams params ["", "", "", "_attackProfile"];
_firedEH params ["","","","","","","_projectile"];
private _attackConfig = configFile >> QEGVAR(missileguidance,AttackProfiles) >> _attackProfile;
// Launch (clearing terrain mask for LO/HI):
private _configLaunchHeightClear = getNumber (_attackConfig >> QGVAR(launchHeightClear));
// Get starting stage
private _startingStage = if (_configLaunchHeightClear > 0) then {
STAGE_LAUNCH; // LOAL-HI / LO
} else {
if (_seekerTargetPos isEqualTo [0,0,0]) then {
STAGE_SEEK_CRUISE; // LOAL-DIR
} else {
STAGE_ATTACK_CRUISE // LOBL
};
};
// Set data in param array
_attackProfileStateParams set [0, _startingStage];
_attackProfileStateParams set [1, _configLaunchHeightClear];
TRACE_1("new shot settings",_attackProfileStateParams);

View File

@ -0,0 +1,76 @@
/*
* Author: PabstMirror
* Adds interaction menu actions to switch the firemode to a vehicle.
* Also adds a Laser Designator if vehicle is configured for one.
*
* Arguments:
* 0: Vehicle <OBJECT>
* 1: Player's Turret Path <ARRAY>
*
* Return Value:
* Nothing
*
* Example:
* [(vehicle player), [0]] call ace_hellfire_fnc_setupVehicle
*
* Public: No
*/
// #define DEBUG_MODE_FULL
#include "script_component.hpp"
params ["_vehicle", "_turretPath"];
TRACE_2("setupVehicle",_vehicle,_turretPath);
// Add laser if vehicle is configured for one:
if ((getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> QGVAR(addLaserDesignator))) == 1) then {
[{
params ["_vehicle", "_turretPath"];
TRACE_3("checking for laser",_vehicle,_turretPath,_vehicle turretLocal _turretPath);
if (!alive _vehicle) exitWith {};
if (!(_vehicle turretLocal _turretPath)) then {WARNING("Turret not local");};
private _hasLaser = false;
{
// Most addons just use "Laserdesignator_mounted", but this should cover custom ones
if ((getNumber (configFile >> "CfgWeapons" >> _x >> "Laser")) == 1) exitWith {
_hasLaser = true;
};
} forEach (_vehicle weaponsTurret _turretPath);
if (!_hasLaser) then {
TRACE_1("Adding Laser Designator",typeOf _vehicle);
_vehicle addWeaponTurret ["Laserdesignator_mounted", _turretPath];
_vehicle addMagazineTurret ["Laserbatteries", _turretPath];
};
}, _this, 1] call CBA_fnc_waitAndExecute; // Need to delay slightly for turret to become local (probably only needs a single frame)
};
// Add interaction menu actions:
if (_vehicle getVariable [QGVAR(actionsAdded), false]) exitWith {};
_vehicle setVariable [QGVAR(actionsAdded), true];
private _action = [QUOTE(ADDON), localize LSTRING(hellfireModeAction), "", {}, {true}] call EFUNC(interact_menu,createAction);
private _basePath = [_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject);
private _fnc_statement = {
params ["_target", "", "_attackProfile"];
TRACE_2("statement",_target,_attackProfile);
_target setVariable [QEGVAR(missileguidance,attackProfile), _attackProfile];
};
private _fnc_condition = {
params ["_target", "_player", "_attackProfile"];
private _turretPath = if (ACE_player == (driver _target)) then {[-1]} else {ACE_player call CBA_fnc_turretPath};
private _hasWeapon = ({QGVAR(launcher) == _x} count (_target weaponsTurret _turretPath)) > 0;
(_hasWeapon) &&
{(_target getVariable [QEGVAR(missileguidance,attackProfile), "hellfire"]) != _attackProfile};
};
{
private _displayName = getText (configFile >> QEGVAR(missileguidance,AttackProfiles) >> _x >> "name");
private _action = [format [QGVAR(%1),_x], _displayName, "", _fnc_statement, _fnc_condition, {}, _x] call EFUNC(interact_menu,createAction);
[_vehicle, 1, _basePath, _action] call EFUNC(interact_menu,addActionToObject);
} forEach ["hellfire", "hellfire_hi", "hellfire_lo"];
TRACE_2("interactions added",_vehicle,typeOf _vehicle);

View File

@ -0,0 +1,124 @@
/*
* Author: PabstMirror
* Shows the hellfire hud when vehicle is equiped with the weapon.
* Shows laser code, fire mode and seeker status.
*
* Arguments:
* 0: Player <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [player] call ace_hellfire_fnc_showHud
*
* Public: No
*/
#include "script_component.hpp"
params ["_player"];
TRACE_1("showHud",_player);
private _enabled = false;
private _vehicle = vehicle _player;
private _turretPath = [-1];
if ((alive _player) && {_player != _vehicle}) then {
if (_player != (driver _vehicle)) then {
_turretPath = _player call CBA_fnc_turretPath
};
{
if ((getNumber (configFile >> "CfgWeapons" >> _x >> QGVAR(enabled))) == 1) then {
TRACE_1("enabled",_x);
_enabled = true;
};
} forEach (_vehicle weaponsTurret _turretPath);
};
if ((!_enabled) && (GVAR(pfID) < 0)) exitWith {TRACE_2("Disabled - No Change",_enabled,GVAR(pfID));};
TRACE_2("Cleaning up old pfeh and display",_enabled,GVAR(pfID));
[GVAR(pfID)] call CBA_fnc_removePerFrameHandler;
if (!isNull (uiNamespace getVariable [QGVAR(display), displayNull])) then {
([QGVAR(modeDisplay)] call BIS_fnc_rscLayer) cutText ["", "PLAIN"];
};
GVAR(pfID) = -1;
if (!_enabled) exitWith {TRACE_2("Disabled - Now Off",_enabled,GVAR(pfID));};
TRACE_2("Enabled - Adding actions and PFEH",_enabled,GVAR(pfID));
[_vehicle, _turretPath] call FUNC(setupVehicle);
private _adjustDown = false; // Flares display will block ours, if present just move ours down a bit
{
if ((getText (configFile >> "CfgWeapons" >> _x >> "simulation")) == "cmlauncher") exitWith {_adjustDown = true};
} forEach (_vehicle weaponsTurret _turretPath);
private _turretConfig = [_vehicle, _turretPath] call CBA_fnc_getTurret;
private _seekerSource = getText (_turretConfig >> "memoryPointGunnerOptics");
TRACE_3("",_adjustDown,_seekerSource,_vehicle selectionPosition _seekerSource);
GVAR(pfID) = [{
params ["_args", "_pfID"];
_args params ["_vehicle", "_turretPath", "_seekerSource", "_adjustDown"];
// Restart display if null (not just at start, this will happen periodicly)
if (isNull (uiNamespace getVariable [QGVAR(display), displayNull])) then {
TRACE_1("creating display",_this);
([QGVAR(modeDisplay)] call BIS_fnc_rscLayer) cutRsc [QGVAR(modeDisplay), "PLAIN", 1, false];
if (_adjustDown) then {
private _ctrl = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_MODECONTROLGROUP;
private _pos = ctrlPosition _ctrl;
_pos set [1, (_pos select 1) + ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)];
_ctrl ctrlSetPosition _pos;
_ctrl ctrlCommit 0;
};
};
private _currentWeapon = _vehicle currentWeaponTurret _turretPath;
private _showLockMode = (getNumber (configFile >> "CfgWeapons" >> _currentWeapon >> QGVAR(enabled))) == 1;
private _ctrlGroup = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl 1000;
if (!_showLockMode) exitWith {
_ctrlGroup ctrlShow false;
};
_ctrlGroup ctrlShow true;
private _ctrlText = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_ATTACKMODE;
private _ctrlCode = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_LASERCODE;
private _ctrlIcon = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_LASERICON;
// Do Laser Scan:
private _laserSource = AGLtoASL (_vehicle modelToWorld (_vehicle selectionPosition _seekerSource));
private _laserCode = _vehicle getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE];
private _laserResult = [_laserSource, vectorDir _vehicle, 70, 5000, [ACE_DEFAULT_LASER_WAVELENGTH,ACE_DEFAULT_LASER_WAVELENGTH], _laserCode, _vehicle] call EFUNC(laser,seekerFindLaserSpot);
private _foundTargetPos = _laserResult select 0;
private _haveLock = !isNil "_foundTargetPos";
private _modeShort = "ERR";
private _vehicleLockMode = _vehicle getVariable [QEGVAR(missileguidance,attackProfile), ""];
switch (_vehicleLockMode) do { // note: missileguidance is case sensitive
case ("hellfire_hi"): {
_modeShort = getText (configFile >> QEGVAR(missileguidance,AttackProfiles) >> _vehicleLockMode >> "name");
};
case ("hellfire_lo"): {
_modeShort = getText (configFile >> QEGVAR(missileguidance,AttackProfiles) >> _vehicleLockMode >> "name");
};
default {
_vehicleLockMode = "hellfire";
_modeShort = if (_haveLock) then {
getText (configFile >> QEGVAR(missileguidance,AttackProfiles) >> _vehicleLockMode >> "nameLocked");
} else {
getText (configFile >> QEGVAR(missileguidance,AttackProfiles) >> _vehicleLockMode >> "name");
};
};
};
_ctrlIcon ctrlSetTextColor ([[0,0,0,0.25],[1,0,0,0.75]] select _haveLock);
_ctrlText ctrlSetText _modeShort;
_ctrlCode ctrlSetText format ["CODE: %1", _laserCode];
}, 0.1, [_vehicle, _turretPath, _seekerSource, _adjustDown]] call CBA_fnc_addPerFrameHandler;

View File

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

View File

@ -0,0 +1,27 @@
#define COMPONENT hellfire
#define COMPONENT_BEAUTIFIED Hellfire
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_HELLFIRE
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_HELLFIRE
#define DEBUG_SETTINGS DEBUG_SETTINGS_HELLFIRE
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#define STAGE_LAUNCH 1
#define STAGE_SEEK_CRUISE 2
#define STAGE_ATTACK_CRUISE 3
#define STAGE_ATTACK_TERMINAL 4
#define IDC_MODECONTROLGROUP 1000
#define IDC_ATTACKMODE 1001
#define IDC_LASERCODE 1002
#define IDC_LASERICON 1003

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="Hellfire">
<Key ID="STR_ACE_Hellfire_Hellfire">
<English>Hellfire</English>
<Spanish>Hellfire</Spanish>
<French>Hellfire</French>
<Polish>Hellfire</Polish>
<German>Hellfire</German>
<Czech>Hellfire</Czech>
<Italian>Hellfire</Italian>
<Portuguese>Hellfire</Portuguese>
<Hungarian>Hellfire</Hungarian>
<Russian>Hellfire</Russian>
<Japanese>Hellfire</Japanese>
</Key>
<Key ID="STR_ACE_Hellfire_hellfireModeAction">
<English>Set Hellfire mode</English>
</Key>
<Key ID="STR_ACE_Hellfire_HF_B_Heli_Attack_01">
<English>RAH-66 Comanche [Hellfire]</English>
<German>RAH-66 Comanche [Hellfire]</German>
<Spanish>RAH-66 Comanche [Hellfire]</Spanish>
<Polish>RAH-66 Comanche [Hellfire]</Polish>
<Czech>RAH-66 Comanche [Hellfire]</Czech>
<French>RAH-66 Commanche [Hellfire]</French>
<Russian>RAH-66 Команч [Hellfire]</Russian>
<Portuguese>RAH-66 Comanche [Hellfire]</Portuguese>
<Hungarian>RAH-66 Comanche [Hellfire]</Hungarian>
<Italian>RAH-66 Comanche [Hellfire]</Italian>
<Japanese>RAH-66 コマンチ [Hellfire]</Japanese>
</Key>
</Package>
</Project>

View File

@ -29,4 +29,10 @@ class Extended_DisplayLoad_EventHandlers {
class RscDiary {
ADDON = QUOTE(call COMPILE_FILE(XEH_displayLoad));
};
class RscDisplayInterrupt {
ADDON = QUOTE(_this call FUNC(handleEscapeMenu));
};
class RscDisplayMPInterrupt {
ADDON = QUOTE(_this call FUNC(handleEscapeMenu));
};
};

View File

@ -9,6 +9,7 @@ PREP(collectActiveActionTree);
PREP(createAction);
PREP(ctrlSetParsedTextCached);
PREP(findActionNode);
PREP(handleEscapeMenu);
PREP(isSubPath);
PREP(keyDown);
PREP(keyUp);

View File

@ -10,7 +10,7 @@
*
* Public: No
*/
#include "script_component.hpp";
#include "script_component.hpp"
params ["_target"];

View File

@ -10,7 +10,7 @@
*
* Public: No
*/
#include "script_component.hpp";
#include "script_component.hpp"
params ["_target"];

View File

@ -10,7 +10,7 @@
*
* Public: No
*/
#include "script_component.hpp";
#include "script_component.hpp"
// Exit if the action menu is already compiled for zeus
if !(isNil {missionNamespace getVariable [QGVAR(ZeusActions), nil]}) exitWith {};

View File

@ -0,0 +1,25 @@
/*
* Author: PabstMirror
* Handle the escape key being pressed.
*
* Arguments:
* 0: Escape menu display that should be closed <DISPLAY><OPTIONAL>
*
* Return Value:
* Nothing
*
* Public: No
*/
#include "script_component.hpp"
if (GVAR(openedMenuType) < 0) exitWith {};
params [["_display", displayNull, [displayNull]]];
TRACE_2("handleEscapeMenu",_display,isNull _display);
if (!isNull _display) then {
_display closeDisplay 0;
};
GVAR(actionSelected) = false;
[GVAR(openedMenuType), false] call FUNC(keyUp);

View File

@ -22,6 +22,7 @@ private _isSubPath = true;
if (count _shortPath > count _longPath) exitWith {false};
//IGNORE_PRIVATE_WARNING ["_i"];
for [{private _i = 0},{_i < count _shortPath},{_i = _i + 1}] do {
if !((_longPath select _i) isEqualTo (_shortPath select _i)) exitWith {
_isSubPath = false;

View File

@ -59,7 +59,13 @@ if (GVAR(useCursorMenu)) then {
createDialog QGVAR(cursorMenu);
};
(finddisplay 91919) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}];
(finddisplay 91919) displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}];
(finddisplay 91919) displayAddEventHandler ["KeyDown", {
// Handle the escape key being pressed with menu open:
if ((_this select [1,4]) isEqualTo [1,false,false,false]) exitWith { // escape key with no modifiers
[displayNull] call FUNC(handleEscapeMenu);
};
[_this,'keydown'] call CBA_events_fnc_keyHandler;
}];
// The dialog sets:
// uiNamespace getVariable QGVAR(dlgCursorMenu);
// uiNamespace getVariable QGVAR(cursorMenuOpened);
@ -73,6 +79,10 @@ if (GVAR(useCursorMenu)) then {
((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)];
((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)];
setMousePosition [0.5, 0.5];
} else {
if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then {
(findDisplay 91919) closeDisplay 2;
};
};
GVAR(selfMenuOffset) = (AGLtoASL (positionCameraToWorld [0, 0, 2])) vectorDiff (AGLtoASL (positionCameraToWorld [0, 0, 0]));

View File

@ -61,7 +61,7 @@ if ((_sPos select 0) < safeZoneXAbs || {(_sPos select 0) > safeZoneXAbs + safeZo
if ((_sPos select 1) < safeZoneY || {(_sPos select 1) > safeZoneY + safeZoneH}) exitWith {false};
BEGIN_COUNTER(fnc_collectActiveActionTree)
BEGIN_COUNTER(fnc_collectActiveActionTree);
// Collect active tree
private _uid = format [QGVAR(ATCache_%1), _actionName];
@ -71,7 +71,7 @@ private _activeActionTree = [
_object, _uid, 1.0, "ace_interactMenuClosed"
] call EFUNC(common,cachedCall);
END_COUNTER(fnc_collectActiveActionTree)
END_COUNTER(fnc_collectActiveActionTree);
#ifdef DEBUG_MODE_EXTRA
diag_log "Printing: _activeActionTree";
@ -79,9 +79,6 @@ diag_log "Printing: _activeActionTree";
params ["_level", "_node"];
_node params ["_actionData", "_children", "_object"];
diag_log text format ["Level %1 -> %2 on %3", _level, _actionData select 0, _object];
{
[_level + 1, _x] call _fnc_print;
} forEach _children;
};
#endif
@ -101,6 +98,6 @@ GVAR(collectedActionPoints) pushBack [_sPos select 2, _sPos, _activeActionTree];
END_COUNTER(fnc_renderMenus);
END_COUNTER(fnc_renderBaseMenu)
END_COUNTER(fnc_renderBaseMenu);
true

View File

@ -3,6 +3,7 @@ class ACE_ZeusActions {
class ZeusUnits {
displayName = "$STR_A3_RscDisplayCurator_ModeUnits_tooltip";
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeUnits_ca.paa";
condition = QUOTE((count (curatorSelected select 0)) > 0);
class stance {
displayName = "$STR_A3_RscAttributeUnitPos_Title";
@ -10,22 +11,22 @@ class ACE_ZeusActions {
class prone {
displayName = "$STR_Pos_Down";
icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_prone_ca.paa";
statement = "{_x setUnitPos 'DOWN';} forEach (curatorSelected select 0);";
statement = QUOTE([ARR_3(QQGVAR(zeusStance),[ARR_2('DOWN',curatorSelected select 0)],curatorSelected select 0)] call CBA_fnc_targetEvent;);
};
class crouch {
displayName = "$STR_Pos_Crouch";
icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_crouch_ca.paa";
statement = "{_x setUnitPos 'MIDDLE';} forEach (curatorSelected select 0);";
statement = QUOTE([ARR_3(QQGVAR(zeusStance),[ARR_2('MIDDLE',curatorSelected select 0)],curatorSelected select 0)] call CBA_fnc_targetEvent;);
};
class stand {
displayName = "$STR_Pos_Up";
icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_stand_ca.paa";
statement = "{_x setUnitPos 'UP';} forEach (curatorSelected select 0);";
statement = QUOTE([ARR_3(QQGVAR(zeusStance),[ARR_2('UP',curatorSelected select 0)],curatorSelected select 0)] call CBA_fnc_targetEvent;);
};
class auto {
displayName = "$STR_Pos_Automatic";
icon = "\A3\UI_F_Curator\Data\default_ca.paa";
statement = "{_x setUnitPos 'AUTO';} forEach (curatorSelected select 0);";
statement = QUOTE([ARR_3(QQGVAR(zeusStance),[ARR_2('AUTO',curatorSelected select 0)],curatorSelected select 0)] call CBA_fnc_targetEvent;);
};
};
@ -39,33 +40,34 @@ class ACE_ZeusActions {
class ZeusGroups {
displayName = "$STR_A3_RscDisplayCurator_ModeGroups_tooltip";
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa";
condition = QUOTE((count (curatorSelected select 1)) > 0);
class behaviour {
displayName = "$STR_Combat_Mode";
class careless {
displayName = "$STR_Combat_Careless";
statement = "{ _x setBehaviour 'CARELESS'; } forEach (curatorSelected select 1);";
statement = QUOTE([ARR_3(QQGVAR(zeusBehaviour),[ARR_2('CARELESS',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;);
};
class safe {
displayName = "$STR_Combat_Safe";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\safe_ca.paa";
statement = "{ _x setBehaviour 'SAFE'; } forEach (curatorSelected select 1);";
statement = QUOTE([ARR_3(QQGVAR(zeusBehaviour),[ARR_2('CARELESS',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;);
};
class aware {
displayName = "$STR_Combat_Aware";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\aware_ca.paa";
statement = "{ _x setBehaviour 'AWARE'; } forEach (curatorSelected select 1);";
statement = QUOTE([ARR_3(QQGVAR(zeusBehaviour),[ARR_2('AWARE',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;);
};
class combat {
displayName = "$STR_Combat_Combat";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\combat_ca.paa";
statement = "{ _x setBehaviour 'COMBAT'; } forEach (curatorSelected select 1);";
statement = QUOTE([ARR_3(QQGVAR(zeusBehaviour),[ARR_2('COMBAT',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;);
};
class stealth {
displayName = "$STR_Combat_Stealth";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\stealth_ca.paa";
statement = "{ _x setBehaviour 'STEALTH'; } forEach (curatorSelected select 1);";
statement = QUOTE([ARR_3(QQGVAR(zeusBehaviour),[ARR_2('STEALTH',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;);
};
};
@ -75,17 +77,17 @@ class ACE_ZeusActions {
class limited {
displayName = "$STR_Speed_Limited";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\limited_ca.paa";
statement = "{_x setSpeedMode 'LIMITED';} forEach (curatorSelected select 1);";
statement = QUOTE([ARR_3(QQGVAR(zeusSpeed),[ARR_2('LIMITED',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;);
};
class normal {
displayName = "$STR_Speed_Normal";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\normal_ca.paa";
statement = "{_x setSpeedMode 'NORMAL';} forEach (curatorSelected select 1);";
statement = QUOTE([ARR_3(QQGVAR(zeusSpeed),[ARR_2('NORMAL',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;);
};
class full {
displayName = "$STR_Speed_Full";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\full_ca.paa";
statement = "{_x setSpeedMode 'FULL';} forEach (curatorSelected select 1);";
statement = QUOTE([ARR_3(QQGVAR(zeusSpeed),[ARR_2('FULL',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;);
};
};
@ -95,47 +97,47 @@ class ACE_ZeusActions {
class wedge {
displayName = "$STR_Wedge";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\wedge_ca.paa";
statement = "{_x setFormation 'WEDGE';} forEach (curatorSelected select 1);";
statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('WEDGE',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;);
};
class vee {
displayName = "$STR_Vee";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\vee_ca.paa";
statement = "{_x setFormation 'VEE';} forEach (curatorSelected select 1);";
statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('VEE',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;);
};
class line {
displayName = "$STR_Line";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\line_ca.paa";
statement = "{_x setFormation 'LINE';} forEach (curatorSelected select 1);";
statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('LINE',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;);
};
class column {
displayName = "$STR_Column";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\column_ca.paa";
statement = "{_x setFormation 'COLUMN';} forEach (curatorSelected select 1);";
statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('COLUMN',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;);
};
class file {
displayName = "$STR_File";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\file_ca.paa";
statement = "{_x setFormation 'FILE';} forEach (curatorSelected select 1);";
statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('FILE',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;);
};
class stag_column {
displayName = "$STR_Staggered";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\stag_column_ca.paa";
statement = "{_x setFormation 'STAG COLUMN';} forEach (curatorSelected select 1);";
statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('STAG COLUMN',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;);
};
class ech_left {
displayName = "$STR_EchL";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_left_ca.paa";
statement = "{_x setFormation 'ECH LEFT';} forEach (curatorSelected select 1);";
statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('ECH LEFT',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;);
};
class ech_right {
displayName = "$STR_EchR";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_right_ca.paa";
statement = "{_x setFormation 'ECH RIGHT';} forEach (curatorSelected select 1);";
statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('ECH RIGHT',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;);
};
class diamond {
displayName = "$STR_Diamond";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\diamond_ca.paa";
statement = "{_x setFormation 'DIAMOND';} forEach (curatorSelected select 1);";
statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('DIAMOND',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;);
};
};
};
@ -143,33 +145,34 @@ class ACE_ZeusActions {
class ZeusWaypoints {
displayName = "Waypoints";
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeRecent_ca.paa";
condition = QUOTE((count (curatorSelected select 2)) > 0);
class behaviour {
displayName = "$STR_Combat_Mode";
class careless {
displayName = "$STR_Combat_Careless";
statement = "{ _x setWaypointBehaviour 'CARELESS'; } forEach (curatorSelected select 2);";
statement = QUOTE([ARR_2(QQGVAR(zeusBehaviour),[ARR_3('CARELESS',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;);
};
class safe {
displayName = "$STR_Combat_Safe";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\safe_ca.paa";
statement = "{ _x setWaypointBehaviour 'SAFE'; } forEach (curatorSelected select 2);";
statement = QUOTE([ARR_2(QQGVAR(zeusBehaviour),[ARR_3('SAFE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;);
};
class aware {
displayName = "$STR_Combat_Aware";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\aware_ca.paa";
statement = "{ _x setWaypointBehaviour 'AWARE'; } forEach (curatorSelected select 2);";
statement = QUOTE([ARR_2(QQGVAR(zeusBehaviour),[ARR_3('AWARE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;);
};
class combat {
displayName = "$STR_Combat_Combat";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\combat_ca.paa";
statement = "{ _x setWaypointBehaviour 'COMBAT'; } forEach (curatorSelected select 2);";
statement = QUOTE([ARR_2(QQGVAR(zeusBehaviour),[ARR_3('COMBAT',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;);
};
class stealth {
displayName = "$STR_Combat_Stealth";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\stealth_ca.paa";
statement = "{ _x setWaypointBehaviour 'STEALTH'; } forEach (curatorSelected select 2);";
statement = QUOTE([ARR_2(QQGVAR(zeusBehaviour),[ARR_3('STEALTH',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;);
};
};
@ -179,17 +182,17 @@ class ACE_ZeusActions {
class limited {
displayName = "$STR_Speed_Limited";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\limited_ca.paa";
statement = "{ _x setWaypointSpeed 'LIMITED'; } forEach (curatorSelected select 2);";
statement = QUOTE([ARR_2(QQGVAR(zeusSpeed),[ARR_3('LIMITED',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;);
};
class normal {
displayName = "$STR_Speed_Normal";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\normal_ca.paa";
statement = "{ _x setWaypointSpeed 'NORMAL'; } forEach (curatorSelected select 2);";
statement = QUOTE([ARR_2(QQGVAR(zeusSpeed),[ARR_3('NORMAL',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;);
};
class full {
displayName = "$STR_Speed_Full";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\full_ca.paa";
statement = "{ _x setWaypointSpeed 'FULL'; } forEach (curatorSelected select 2);";
statement = QUOTE([ARR_2(QQGVAR(zeusSpeed),[ARR_3('FULL',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;);
};
};
@ -199,47 +202,47 @@ class ACE_ZeusActions {
class wedge {
displayName = "$STR_Wedge";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\wedge_ca.paa";
statement = "{_x setWaypointFormation 'WEDGE';} forEach (curatorSelected select 2);";
statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('WEDGE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;);
};
class vee {
displayName = "$STR_Vee";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\vee_ca.paa";
statement = "{_x setWaypointFormation 'VEE';} forEach (curatorSelected select 2);";
statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('VEE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;);
};
class line {
displayName = "$STR_Line";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\line_ca.paa";
statement = "{_x setWaypointFormation 'LINE';} forEach (curatorSelected select 2);";
statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('LINE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;);
};
class column {
displayName = "$STR_Column";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\column_ca.paa";
statement = "{_x setWaypointFormation 'COLUMN';} forEach (curatorSelected select 2);";
statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('COLUMN',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;);
};
class file {
displayName = "$STR_File";
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\file_ca.paa";
statement = "{_x setWaypointFormation 'FILE';} forEach (curatorSelected select 2);";
statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('FILE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;);
};
class stag_column {
displayName = "$STR_Staggered";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\stag_column_ca.paa";
statement = "{_x setWaypointFormation 'STAG COLUMN';} forEach (curatorSelected select 2);";
statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('COLUMN',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;);
};
class ech_left {
displayName = "$STR_EchL";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_left_ca.paa";
statement = "{_x setWaypointFormation 'ECH LEFT';} forEach (curatorSelected select 2);";
statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('LEFT',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;);
};
class ech_right {
displayName = "$STR_EchR";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_right_ca.paa";
statement = "{_x setWaypointFormation 'ECH RIGHT';} forEach (curatorSelected select 2);";
statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('RIGHT',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;);
};
class diamond {
displayName = "$STR_Diamond";
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\diamond_ca.paa";
statement = "{_x setWaypointFormation 'DIAMOND';} forEach (curatorSelected select 2);";
statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('DIAMOND',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;);
};
};
};
@ -247,5 +250,6 @@ class ACE_ZeusActions {
class ZeusMarkers {
displayName = "$STR_A3_RscDisplayCurator_ModeMarkers_tooltip";
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeMarkers_ca.paa";
condition = QUOTE((count (curatorSelected select 3)) > 0);
};
};

View File

@ -30,6 +30,7 @@ PREP(pardon);
// interaction with doors
PREP(getDoor);
PREP(getGlassDoor);
PREP(getDoorAnimations);
PREP(handleScrollWheel);
PREP(openDoor);

View File

@ -28,6 +28,36 @@ ACE_Modifier = 0;
{_lamp setHit [_x select 0, (_x select 1) max _disabledLampDMG];nil} count _hitPointsDamage;
}] call CBA_fnc_addEventHandler;
// Zeus action events
[QGVAR(zeusStance),{
{ _x setUnitPos (_this select 0); } forEach (_this select 1);
}] call CBA_fnc_addEventHandler;
// The following 3 events handle both waypoints and groups
[QGVAR(zeusBehaviour),{
if (param [2,false]) then {
{ _x setWaypointBehaviour (_this select 0); } forEach (_this select 1);
} else {
{ _x setBehaviour (_this select 0); } forEach (_this select 1);
};
}] call CBA_fnc_addEventHandler;
[QGVAR(zeusSpeed),{
if (param [2,false]) then {
{ _x setWaypointSpeed (_this select 0); } forEach (_this select 1);
} else {
{ _x setSpeedMode (_this select 0); } forEach (_this select 1);
};
}] call CBA_fnc_addEventHandler;
[QGVAR(zeusFormation),{
if (param [2,false]) then {
{ _x setWaypointFormation (_this select 0); } forEach (_this select 1);
} else {
{ _x setFormation (_this select 0); } forEach (_this select 1);
};
}] call CBA_fnc_addEventHandler;
if (!hasInterface) exitWith {};
GVAR(isOpeningDoor) = false;
@ -60,7 +90,6 @@ GVAR(isOpeningDoor) = false;
},
[57, [false, true, false]], false] call CBA_fnc_addKeybind; //Key CTRL+Space
["ACE3 Common", QGVAR(tapShoulder), localize LSTRING(TapShoulder), {
// Conditions: canInteract
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};

View File

@ -16,7 +16,7 @@
*/
#include "script_component.hpp"
PARAMS_2(_unit,_target);
params ["_unit", "_target"];
alive _target
&& {!(_target getVariable ["ACE_isUnconscious", false])}

View File

@ -1,5 +1,5 @@
/*
* Author: commy2
* Author: commy2, Phyma
* Find door.
*
* Arguments:
@ -35,7 +35,14 @@ if (typeOf _house == "") exitWith {[objNull, ""]};
_intersections = [_house, "GEOM"] intersect [_position0, _position1];
_door = _intersections select 0 select 0;
_door = toLower (_intersections select 0 select 0);
if (isNil "_door") exitWith {[_house, ""]};
//Check if door is glass because then we need to find the proper location of the door so we can use it
if ((_door find "glass") != -1) then {
_door = [_distance, _house, _door] call FUNC(getGlassDoor);
};
if (isNil "_door") exitWith {[_house, ""]};

View File

@ -1,6 +1,6 @@
/*
* Author: commy2
* Get door animations. @todo rewrite for better custom building support
* Author: commy2, Phyma
* Get door animations.
*
* Arguments:
* 0: House <OBJECT>
@ -20,104 +20,19 @@
params ["_house", "_door"];
private ["_index", "_animations", "_lockedVariable"];
private _animate = animationNames _house;
private _animations = [];
private _lockedVariable = [];
_index = [
"door_1",
"door_2",
"door_3",
"door_4",
"door_5",
"door_6",
"door_7",
"door_8",
"door_9",
"door_10",
"door_11",
"door_12",
"door_13",
"door_14",
"door_15",
"door_16",
"door_17",
"door_18",
"door_19",
"door_20",
"door_21",
"door_22",
"hatch_1",
"hatch_2",
"hatch_3",
"hatch_4",
"hatch_5",
"hatch_6"
] find toLower _door;
if (_index == -1) exitWith {[[],""]};
_animations = [
["Door_1_rot", "Door_Handle_1_rot_1", "Door_Handle_1_rot_2"],
["Door_2_rot", "Door_Handle_2_rot_1", "Door_Handle_2_rot_2"],
["Door_3_rot", "Door_Handle_3_rot_1", "Door_Handle_3_rot_2"],
["Door_4_rot", "Door_Handle_4_rot_1", "Door_Handle_4_rot_2"],
["Door_5_rot", "Door_Handle_5_rot_1", "Door_Handle_5_rot_2"],
["Door_6_rot", "Door_Handle_6_rot_1", "Door_Handle_6_rot_2"],
["Door_7_rot", "Door_Handle_7_rot_1", "Door_Handle_7_rot_2"],
["Door_8_rot", "Door_Handle_8_rot_1", "Door_Handle_8_rot_2"],
["Door_9_rot", "Door_Handle_9_rot_1", "Door_Handle_9_rot_2"],
["Door_10_rot", "Door_Handle_10_rot_1", "Door_Handle_10_rot_2"],
["Door_11_rot", "Door_Handle_11_rot_1", "Door_Handle_11_rot_2"],
["Door_12_rot", "Door_Handle_12_rot_1", "Door_Handle_12_rot_2"],
["Door_13_rot", "Door_Handle_13_rot_1", "Door_Handle_13_rot_2"],
["Door_14_rot", "Door_Handle_14_rot_1", "Door_Handle_14_rot_2"],
["Door_15_rot", "Door_Handle_15_rot_1", "Door_Handle_15_rot_2"],
["Door_16_rot", "Door_Handle_16_rot_1", "Door_Handle_16_rot_2"],
["Door_17_rot", "Door_Handle_17_rot_1", "Door_Handle_17_rot_2"],
["Door_18_rot", "Door_Handle_18_rot_1", "Door_Handle_18_rot_2"],
["Door_19_rot", "Door_Handle_19_rot_1", "Door_Handle_19_rot_2"],
["Door_20_rot", "Door_Handle_20_rot_1", "Door_Handle_20_rot_2"],
["Door_21_rot", "Door_Handle_21_rot_1", "Door_Handle_21_rot_2"],
["Door_22_rot", "Door_Handle_22_rot_1", "Door_Handle_22_rot_2"],
["Hatch_1_rot"],
["Hatch_2_rot"],
["Hatch_3_rot"],
["Hatch_4_rot"],
["Hatch_5_rot"],
["Hatch_6_rot"]
] select _index;
_lockedVariable = [
["BIS_Disabled_Door_1", "Door_Handle_1_rot_1", "Door_Locked_1_rot"],
["BIS_Disabled_Door_2", "Door_Handle_2_rot_1", "Door_Locked_2_rot"],
["BIS_Disabled_Door_3", "Door_Handle_3_rot_1", "Door_Locked_3_rot"],
["BIS_Disabled_Door_4", "Door_Handle_4_rot_1", "Door_Locked_4_rot"],
["BIS_Disabled_Door_5", "Door_Handle_5_rot_1", "Door_Locked_5_rot"],
["BIS_Disabled_Door_6", "Door_Handle_6_rot_1", "Door_Locked_6_rot"],
["BIS_Disabled_Door_7", "Door_Handle_7_rot_1", "Door_Locked_7_rot"],
["BIS_Disabled_Door_8", "Door_Handle_8_rot_1", "Door_Locked_8_rot"],
["BIS_Disabled_Door_9", "Door_Handle_9_rot_1", "Door_Locked_9_rot"],
["BIS_Disabled_Door_10", "Door_Handle_10_rot_1", "Door_Locked_10_rot"],
["BIS_Disabled_Door_11", "Door_Handle_11_rot_1", "Door_Locked_11_rot"],
["BIS_Disabled_Door_12", "Door_Handle_12_rot_1", "Door_Locked_12_rot"],
["BIS_Disabled_Door_13", "Door_Handle_13_rot_1", "Door_Locked_13_rot"],
["BIS_Disabled_Door_14", "Door_Handle_14_rot_1", "Door_Locked_14_rot"],
["BIS_Disabled_Door_15", "Door_Handle_15_rot_1", "Door_Locked_15_rot"],
["BIS_Disabled_Door_16", "Door_Handle_16_rot_1", "Door_Locked_16_rot"],
["BIS_Disabled_Door_17", "Door_Handle_17_rot_1", "Door_Locked_17_rot"],
["BIS_Disabled_Door_18", "Door_Handle_18_rot_1", "Door_Locked_18_rot"],
["BIS_Disabled_Door_19", "Door_Handle_19_rot_1", "Door_Locked_19_rot"],
["BIS_Disabled_Door_20", "Door_Handle_20_rot_1", "Door_Locked_20_rot"],
["BIS_Disabled_Door_21", "Door_Handle_21_rot_1", "Door_Locked_21_rot"],
["BIS_Disabled_Door_22", "Door_Handle_22_rot_1", "Door_Locked_22_rot"],
["", ""],
["", ""],
["", ""],
["", ""],
["", ""],
["", ""]
] select _index;
{
private _animName = toLower _x;
if ((_animName find (toLower _door)) != -1) then {
if (((_animName find "disabled") != -1) || ((_animName find "locked") != -1)) then {
_lockedVariable pushBack _animName;
} else {
_animations pushBack _animName;
};
};
} forEach _animate;
[_animations, _lockedVariable]

View File

@ -0,0 +1,67 @@
/*
* Author: Phyma
* Find glass door.
*
* Arguments:
* 0: Distance <NUMBER>
* 1: House <OBJECT>
* 2: Door name <STRING>
*
* Return Value:
* 0: Door Name <STRING>
*
* Example:
* [player, target] call ace_interaction_fnc_getGlassDoor
*
* Public: No
*/
#include "script_component.hpp"
params ["_distance", "_house", "_door"];
private _doorParts = [];
private _doorPos = [];
private _animate = animationNames _house;
private _glassDoor = _door splitString "_";
private _glassPos = (_house selectionPosition [(_glassDoor select 0) + "_" + (_glassDoor select 1) + "_effects", "Memory"]);
// Calculate all animation names so we know what is there
{
private _animName = toLower _x;
if (((_animName find "door") != -1) && ((_animName find "locked") == -1) && ((_animName find "disabled") == -1) && ((_animName find "handle") == -1)) then {
private _splitStr = _animName splitString "_";
_doorParts pushBack ((_splitStr select 0) + "_" + (_splitStr select 1) + "_trigger");
};
} forEach _animate;
// Get the pos of all the door components and save the parts
{
_doorPos pushBack (_house selectionPosition [_x, "Memory"]);
} forEach _doorParts;
// Calculate what door that is closest to the glass door
private _lowestDistance = 0;
{
private _objDist = _glassPos distance _x;
//Make sure we dont take another door by mistake
if (_objDist <= _distance) then {
//Need to set the value in the beginning
if (_lowestDistance == 0) then {
_lowestDistance = _objDist;
private _splitStr = (_doorParts select _forEachIndex) splitString "_";
_door = (_splitStr select 0) + "_" + (_splitStr select 1);
} else {
if (_objDist < _lowestDistance) then {
_lowestDistance = _objDist;
private _splitStr = (_doorParts select _forEachIndex) splitString "_";
_door = (_splitStr select 0) + "_" + (_splitStr select 1);
};
};
};
} forEach _doorPos;
// Check if we have a door or if it is the glass part
if ((isNil "_door") || ((_door find "glass") != -1)) exitWith {};
_door

View File

@ -28,9 +28,12 @@ _getDoorAnimations params ["_animations", "_lockedVariable"];
if (_animations isEqualTo []) exitWith {};
if (_house animationPhase (_animations select 0) <= 0 && {_house getVariable [_lockedVariable select 0, 0] == 1}) exitWith {
_lockedVariable set [0, _house];
_lockedVariable call BIS_fnc_LockedDoorOpen;
//Check if the door can be locked aka have locked variable, otherwhise cant lock it
if (!(isNil (_lockedVariable select 0))) then {
if ((_house animationPhase (_animations select 0) <= 0) && {_house getVariable [_lockedVariable select 0, 0] == 1}) exitWith {
_lockedVariable set [0, _house];
_lockedVariable call BIS_fnc_LockedDoorOpen;
};
};
playSound "ACE_Sound_Click"; // @todo replace with smth. more fitting
@ -62,7 +65,6 @@ GVAR(usedScrollWheel) = false;
if (CBA_missionTime > _time && {diag_frameno > _frame}) then {
GVAR(usedScrollWheel) = true;
};
// do incremental door opening
{_house animate [_x, GVAR(doorTargetPhase)]; false} count _animations;
}, 0.1, [_house, _animations, getPosASL ACE_player, CBA_missionTime + 0.2, diag_frameno + 2]] call CBA_fnc_addPerFrameHandler;

View File

@ -143,7 +143,7 @@ if (GVAR(referenceHeadingMenu) == 0) then {
} else {
_textCenterLine1Left = "Max";
_textCenterLine2Left = "Avg";
switch (GVAR(MinAvgMax)Mode) do {
switch (GVAR(MinAvgMaxMode)) do {
case 0: {
_textCenterLine1Right = "--. -";
_textCenterLine2Right = "--. -";
@ -175,7 +175,7 @@ if (GVAR(referenceHeadingMenu) == 0) then {
} else {
_textCenterLine1Left = "Max";
_textCenterLine2Left = "Avg";
switch (GVAR(MinAvgMax)Mode) do {
switch (GVAR(MinAvgMaxMode)) do {
case 0: {
_textCenterLine1Right = "--. -";
_textCenterLine2Right = "--. -";

View File

@ -26,6 +26,7 @@ private _testSeekerDir = vectorDirVisual _seekerVehicle;
// Draw all lasers
[GVAR(laserEmitters), {
//IGNORE_PRIVATE_WARNING ["_key", "_value"];
// TRACE_2("",_key,_value);
_value params ["_obj", "_owner", "_laserMethod", "_waveLength", "_laserCode", "_beamSpread"];

View File

@ -29,12 +29,13 @@ if (ACE_player call CBA_fnc_canUseWeapon) then {
_currentWeapon = currentWeapon ACE_player;
} else {
_currentShooter = vehicle ACE_player;
private _turret = [ACE_player] call ace_common_fnc_getTurretIndex;
_currentWeapon = _currentShooter currentWeaponTurret _turret;
private _turretPath = if (ACE_player == (driver _currentShooter)) then {[-1]} else {ACE_player call CBA_fnc_turretPath};
_currentWeapon = _currentShooter currentWeaponTurret _turretPath;
};
TRACE_2("",_currentShooter,_currentWeapon);
if ((getNumber (configFile >> "CfgWeapons" >> _currentWeapon >> "laser")) == 0) exitWith {false};
if (((getNumber (configFile >> "CfgWeapons" >> _currentWeapon >> "laser")) == 0) &&
{(getNumber (configFile >> "CfgWeapons" >> _currentWeapon >> QGVAR(canSelect))) == 0}) exitWith {false};
private _oldLaserCode = _currentShooter getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE];
private _newLaserCode = _oldLaserCode;
@ -52,7 +53,7 @@ if (((_codeChange < 0) && {_oldLaserCode > ACE_DEFAULT_LASER_CODE}) || {(_codeCh
TRACE_2("",_oldLaserCode,_newLaserCode);
if (_oldLaserCode != _newLaserCode) then {
_currentShooter setVariable [QGVAR(code), _newLaserCode, false];
_currentShooter setVariable [QGVAR(code), _newLaserCode, true];
};
[format ["%1: %2", localize LSTRING(laserCode), _newLaserCode]] call EFUNC(common,displayTextStructured);

View File

@ -76,7 +76,7 @@ private _finalOwner = objNull;
// Shoot a cone with dispersion
([_laserPos, _laserDir, _divergence, GVAR(dispersionCount), _obj] call FUNC(shootCone)) params ["", "", "_resultPositions"];
{
_testPoint = _x select 0;
private _testPoint = _x select 0;
private _testPointVector = _posASL vectorFromTo _testPoint;
private _testDotProduct = _dir vectorDotProduct _testPointVector;
if ((_testDotProduct > _seekerCos) && {(_testPoint vectorDistanceSqr _posASL) < _seekerMaxDistSq}) then {
@ -90,7 +90,7 @@ private _finalOwner = objNull;
if (_distance > 0) then {
private _testPointVector = _posASL vectorFromTo _resultPos;
private _testDotProduct = _dir vectorDotProduct _testPointVector;
if ((_testDotProduct > _seekerCos) && {(_testPoint vectorDistanceSqr _posASL) < _seekerMaxDistSq}) then {
if ((_testDotProduct > _seekerCos) && {(_resultPos vectorDistanceSqr _posASL) < _seekerMaxDistSq}) then {
_spots pushBack [_resultPos, _owner];
};
};
@ -178,6 +178,7 @@ if ((count _spots) > 0) then {
private _maxOwnerCount = -1;
[_ownersHash, {
//IGNORE_PRIVATE_WARNING ["_key", "_value"];
if (_value > _maxOwnerCount) then {
_finalOwner = _key;
};
@ -189,9 +190,9 @@ END_COUNTER(seekerFindLaserSpot);
#ifdef DRAW_LASER_INFO
if (isNil "_finalPos") then {
drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconMan_ca.paa", [0.9,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _code], 0.5, 0.025, "TahomaB"];
drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconMan_ca.paa", [0.9,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _seekerCode], 0.5, 0.025, "TahomaB"];
} else {
drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconManAT_ca.paa", [0.5,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _code], 0.5, 0.025, "TahomaB"];
drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconManAT_ca.paa", [0.5,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _seekerCode], 0.5, 0.025, "TahomaB"];
drawLine3D [ASLtoAGL _posASL, ASLtoAGL _finalPos, [0.5,1,0,1]];
};
#endif

View File

@ -41,9 +41,16 @@ GVAR(greenLaserUnits) = [];
params ["_unit"];
private _weapon = currentWeapon _unit;
if (!(_unit isFlashlightOn _weapon)) exitWith {
GVAR(redLaserUnits) deleteAt (GVAR(redLaserUnits) find _unit);
GVAR(greenLaserUnits) deleteAt (GVAR(greenLaserUnits) find _unit);
};
private _laser = [(_unit weaponAccessories _weapon) select 1] param [0, ""];
if (_laser isEqualTo "") exitWith {};
if (_laser isEqualTo "") exitWith {
GVAR(redLaserUnits) deleteAt (GVAR(redLaserUnits) find _unit);
GVAR(greenLaserUnits) deleteAt (GVAR(greenLaserUnits) find _unit);
};
private _laserID = GVAR(laserClassesCache) getVariable _laser;
@ -51,21 +58,17 @@ GVAR(greenLaserUnits) = [];
_laserID = getNumber (configFile >> "CfgWeapons" >> _laser >> "ACE_laserpointer");
GVAR(laserClassesCache) setVariable [_laser, _laserID];
};
TRACE_3("",_weapon,_laser,_laserID);
if (_unit isFlashlightOn _weapon) then {
if (_laserID isEqualTo 1) exitWith {
GVAR(redLaserUnits) pushBackUnique _unit;
GVAR(greenLaserUnits) deleteAt (GVAR(greenLaserUnits) find _unit);
};
if (_laserID isEqualTo 2) exitWith {
GVAR(greenLaserUnits) pushBackUnique _unit;
GVAR(redLaserUnits) deleteAt (GVAR(redLaserUnits) find _unit);
};
} else {
GVAR(redLaserUnits) deleteAt (GVAR(redLaserUnits) find _unit);
if (_laserID isEqualTo 1) exitWith {
GVAR(redLaserUnits) pushBackUnique _unit;
GVAR(greenLaserUnits) deleteAt (GVAR(greenLaserUnits) find _unit);
};
if (_laserID isEqualTo 2) exitWith {
GVAR(greenLaserUnits) pushBackUnique _unit;
GVAR(redLaserUnits) deleteAt (GVAR(redLaserUnits) find _unit);
};
};
// custom scheduler

View File

@ -6,7 +6,7 @@
* None
*
* Return Value:
* None
* Near Units <ARRAY>
*
* Public: No
*/
@ -15,7 +15,7 @@
private _camPosAGL = positionCameraToWorld [0, 0, 0];
// handle RHS / bugged vehicle slots
if !((_camPosAGL select 0) isEqualType 0) exitWith {};
if !((_camPosAGL select 0) isEqualType 0) exitWith { [] };
private _nearUnits = [];

View File

@ -26,6 +26,7 @@ _arrayOfAmmoCounts = +_arrayOfAmmoCounts;
_arrayOfAmmoCounts sort true;
private _fnc_newMag = {
//IGNORE_PRIVATE_WARNING ["_time", "_events"];
_time = _time + GVAR(TimePerMagazine);
_events pushBack [_time, false, +_arrayOfAmmoCounts];
};

View File

@ -14,7 +14,7 @@ class CfgAmmo {
laserLock = 0;
manualControl = 0;
maxSpeed = 300;
EGVAR(rearm,caliber) = 70;
class ADDON {
@ -45,26 +45,6 @@ class CfgAmmo {
};
};
class ACE_Hellfire_AGM114K: ACE_Hydra70_DAGR {
displayName = CSTRING(Hellfire_AGM114K);
displayNameShort = CSTRING(Hellfire_AGM114K_Short);
description = CSTRING(Hellfire_AGM114K_desc);
descriptionShort = CSTRING(Hellfire_AGM114K_desc);
// @TODO: placeholder model to at least make it look different
model = "\A3\Weapons_F\Ammo\Missile_AT_03_fly_F";
proxyShape = "\A3\Weapons_F\Ammo\Missile_AT_03_F";
hit = 1400;
indirectHit = 71;
indirectHitRange = 4.5;
effectsMissile = "missile2";
//Explicity add guidance config
class ADDON: ADDON {};
};
// Titan
class M_Titan_AT: MissileBase {};
@ -109,7 +89,7 @@ class CfgAmmo {
seekerMaxRange = 2500; // Range from the missile which the seeker can visually search
seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos]
// Attack profile type selection
defaultAttackProfile = "JAV_TOP";
attackProfiles[] = { "JAV_TOP", "JAV_DIR" };

View File

@ -24,30 +24,4 @@ class CfgMagazines {
descriptionShort = "24 Round DAGR";
weight = 72;
};
// Hellfires
class 6Rnd_ACE_Hellfire_AGM114K : 12Rnd_PG_missiles {
count = 12;
ammo = "ACE_Hellfire_AGM114K";
displayName = "6Rnd_ACE_Hellfire_AGM114K";
displayNameShort = "6Rnd_ACE_Hellfire_AGM114K";
descriptionShort = "6Rnd_ACE_Hellfire_AGM114K";
weight = 36;
};
class 12Rnd_ACE_Hellfire_AGM114K : 6Rnd_ACE_Hydra70_DAGR {
count = 12;
displayName = "12Rnd_ACE_Hellfire_AGM114K";
displayNameShort = "12Rnd_ACE_Hellfire_AGM114K";
descriptionShort = "12Rnd_ACE_Hellfire_AGM114K";
weight = 72;
};
class 24Rnd_ACE_Hellfire_AGM114K : 6Rnd_ACE_Hydra70_DAGR {
count = 24;
displayName = "24Rnd_ACE_Hellfire_AGM114K";
displayNameShort = "24Rnd_ACE_Hellfire_AGM114K";
descriptionShort = "24Rnd_ACE_Hellfire_AGM114K";
weight = 72;
};
};

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