manual merge

This commit is contained in:
commy2 2015-04-08 22:01:41 +02:00
commit 3e3390750d
632 changed files with 19580 additions and 12849 deletions

View File

@ -6,12 +6,22 @@
# request, preferably including an email address.
# CORE TEAM
bux578 <github@jonathandavid.de>
commy2
esteldunedain <nicolas.d.badano@gmail.com>
Felix Wiegand <koffeinflummi@gmail.com>
Garth "L-H" de Wet <garthofhearts@gmail.com>
bux578 <github@jonathandavid.de>
Giallustio
Glowbal
Janus
Kieran
NouberNou
PabstMirror <pabstmirror@gmail.com>
Ruthberg
tpM
ViperMaul
VKing <kauestad@gmail.com>
Walter Pearce <jaynus@gmail.com>
# CONTRIBUTORS
11RDP-LoupVert <loupvert@11rdp.fr>

View File

@ -1,25 +0,0 @@
// TMR: Optics initialization and functions
// (C) 2013 Ryan Schultz. See LICENSE.
// Request a resource layer from the game engine.
AGM_Optics_scopeRSC = ["AGM_Optics_Scope"] call BIS_fnc_rscLayer;
// Set global variables
AGM_Optics_inScope = false; // Is the scope up?
AGM_Optics_currentOptic = ""; // What optic is attached right now?
0 = 0 spawn {
waituntil {!isNull (findDisplay 46)};
[] call AGM_Optics_fnc_initScope;
// PiP technique by BadBenson
AGM_Optics_Camera = "camera" camCreate (positioncameratoworld [0,0,0]);
AGM_Optics_Camera camSetFov 0.7;
AGM_Optics_Camera camSetTarget player;
AGM_Optics_Camera camCommit 1;
"agm_optics_rendertarget0" setPiPEffect [2, 1.0, 1.0, 1.0, 0.0, [0.0, 1.0, 0.0, 0.25], [1.0, 0.0, 1.0, 1.0], [0.199, 0.587, 0.114, 0.0]];
AGM_Optics_Camera cameraEffect ["INTERNAL", "BACK","agm_optics_rendertarget0"];
waitUntil {[] call AGM_Optics_fnc_mainLoop; False};
};

View File

@ -1,454 +0,0 @@
class CfgPatches {
class AGM_Optics {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core};
version = 0.1;
author[] = {"Taosenai"};
authorUrl = "http://www.ryanschultz.org/tmr/";
};
};
class CfgFunctions {
class AGM_Optics {
class AGM_Optics {
file = "AGM_Optics\functions";
class firedEH;
class hideScope;
class initScope;
class mainLoop;
};
};
};
class Extended_PostInit_EventHandlers {
class AGM_Optics {
clientInit = "call compile preProcessFileLineNumbers '\AGM_Optics\clientInit.sqf'";
};
};
class Extended_FiredBIS_EventHandlers {
class CAManBase {
class AGM_Optics {
clientFiredBIS = "_this call AGM_Optics_fnc_firedEH;";
};
};
};
class CfgOpticsEffect {
class AGM_OpticsRadBlur1 {
type = "radialblur";
params[] = {0.015, 0, 0.14, 0.2};
priority = 950;
};
};
class CfgWeapons {
class ItemCore;
class InventoryItem_Base_F;
class InventoryMuzzleItem_Base_F;
class InventoryOpticsItem_Base_F;
class optic_Hamr : ItemCore {
displayName = "HAMR 4x";
descriptionShort = "High Accuracy Multi-Range Optic<br />Magnification: 4x<br />Reticle: CM-RW 6.5mm";
scope = 2;
weaponInfoType = "AGM_RscWeapon";
AGM_Optics_enhanced = 1;
AGM_Optics_reticle = "\AGM_Optics\data\hamr\hamr-reticle65_ca.paa";
AGM_Optics_reticleIllum = "\AGM_Optics\data\hamr\hamr-reticle65Illum_ca.paa";
AGM_Optics_body = "\AGM_Optics\data\hamr\hamr-body_ca.paa";
AGM_Optics_bodyNight = "\AGM_Optics\data\hamr\hamr-bodyNight_ca.paa";
model = "\A3\weapons_f\acc\acco_hamr_F";
class ItemInfo : InventoryOpticsItem_Base_F {
mass = 4;
optics = 1;
optictype = 1;
rmbhint = "HAMR";
modeloptics = "\AGM_Optics\agm_optics_pip.p3d";
class OpticsModes {
class Hamr2Collimator {
AGM_Optics_enhanced = 0;
opticsID = 1;
useModelOptics = 0;
opticsppeffects[] = {};
opticsFlare = 0;
opticsDisablePeripherialVision = 0;
opticsZoomMin = 0.375;
opticsZoomMax = 1;
opticsZoomInit = 0.75;
memoryPointCamera = "eye";
visionMode[] = {};
distanceZoomMin = 300;
distanceZoomMax = 300;
};
class Hamr2Scope {
cameradir = "";
distanceZoomMin = 300;
distanceZoomMax = 300;
memorypointcamera = "opticView";
opticsdisableperipherialvision = 0;
opticsdisplayname = "IHAMR";
opticsflare = 1;
opticsid = 2;
opticsppeffects[] = {"OpticsCHAbera2", "OpticsBlur1", "AGM_OpticsRadBlur1"};
opticszoominit = 0.0872664626;
opticszoommax = 0.0872664626;
opticszoommin = 0.0872664626;
discretefov[] = {0.0872664626};
discreteinitindex = 0;
usemodeloptics = 1;
modeloptics = "\AGM_Optics\agm_optics_pip.p3d";
visionmode[] = {"Normal", "NVG"};
};
};
};
};
class optic_Arco : ItemCore {
descriptionshort = "Advanced Rifle Combat Optic<br />Magnification: 4x<br />Reticle: SpecterDR 6.5mm";
displayname = "ARCO 4x";
picture = "\A3\weapons_F\Data\UI\gear_acco_Arco_CA.paa";
scope = 2;
weaponInfoType = "AGM_RscWeapon";
model = "\A3\weapons_f\acc\acco_Arco_F";
AGM_Optics_enhanced = 1;
AGM_Optics_reticle = "\AGM_Optics\data\arco\arco-reticle65_ca.paa";
AGM_Optics_reticleIllum = "\AGM_Optics\data\arco\arco-reticle65Illum_ca.paa";
AGM_Optics_body = "\AGM_Optics\data\arco\arco-body_ca.paa";
AGM_Optics_bodyNight = "\AGM_Optics\data\arco\arco-bodyNight_ca.paa";
class ItemInfo: InventoryOpticsItem_Base_F {
mass = 4;
optics = 1;
optictype = 1;
rmbhint = "ARCO";
class OpticsModes {
class ARCO2collimator {
AGM_Optics_enhanced = 0;
cameradir = "";
distancezoommax = 300;
distancezoommin = 300;
memorypointcamera = "eye";
opticsdisableperipherialvision = 0;
opticsdisplayname = "CQB";
opticsflare = 0;
opticsid = 1;
opticsppeffects[] = {};
opticszoominit = 0.75;
opticszoommax = 1.1;
opticszoommin = 0.375;
usemodeloptics = 0;
visionmode[] = {};
};
class ARCO2scope: ARCO2collimator {
cameradir = "";
distanceZoomMin = 300;
distanceZoomMax = 300;
memorypointcamera = "opticView";
opticsdisableperipherialvision = 0;
opticsdisplayname = "ARCO";
opticsflare = 1;
opticsid = 2;
opticsppeffects[] = {"OpticsCHAbera2", "OpticsBlur1", "AGM_OpticsRadBlur1"};
opticszoominit = 0.0872664626; // 0.0872664626 rad = 5 degrees
opticszoommax = 0.0872664626; // SpecterDR 4x is 6 degrees
opticszoommin = 0.0872664626; // Scope graphic in game covers 1 degree
discretefov[] = {0.0872664626};
discreteinitindex = 0;
usemodeloptics = 1;
modeloptics = "\AGM_Optics\data\AGM_Optics_reticle90.p3d";
visionmode[] = {"Normal"};
};
};
};
};
class optic_MRCO : ItemCore {
displayName = "MRCO 1x/4x";
descriptionShort = "Medium Range Combat Optic<br />Magnification: 1x/4x<br />Reticle: Pitbull Gen II 5.56mm";
scope = 2;
weaponInfoType = "AGM_RscWeapon";
AGM_Optics_enhanced = 1;
AGM_Optics_reticle = "\AGM_Optics\data\mrco\mrco-reticle556_ca.paa";
AGM_Optics_reticleIllum = "\AGM_Optics\data\mrco\mrco-reticle556Illum_ca.paa";
AGM_Optics_body = "\AGM_Optics\data\mrco\mrco-body_ca.paa";
AGM_Optics_bodyNight = "\AGM_Optics\data\mrco\mrco-bodyNight_ca.paa";
class ItemInfo : InventoryOpticsItem_Base_F {
opticType = 1;
mass = 4;
optics = 1;
modelOptics = "\A3\Weapons_f_beta\acc\reticle_MRCO_F";
class OpticsModes {
class MRCOcq {
AGM_Optics_enhanced = 0;
opticsID = 1;
useModelOptics = 0;
opticsPPEffects[] = {};
opticsFlare = 0;
opticsDisablePeripherialVision = 0;
opticsZoomMin = 0.375;
opticsZoomMax = 1;
opticsZoomInit = 0.75;
memoryPointCamera = "eye";
visionMode[] = {};
distanceZoomMin = 100;
distanceZoomMax = 100;
};
class MRCOscope {
cameradir = "";
distanceZoomMin = 300;
distanceZoomMax = 300;
memorypointcamera = "eye";
opticsdisableperipherialvision = 0;
opticsdisplayname = "MRCO";
opticsflare = 1;
opticsid = 2;
opticsppeffects[] = {"OpticsCHAbera2", "OpticsBlur2", "AGM_OpticsRadBlur1"};
opticszoominit = 0.0872664626;
opticszoommax = 0.0872664626;
opticszoommin = 0.0872664626;
discretefov[] = {0.0872664626};
discreteinitindex = 0;
usemodeloptics = 1;
modeloptics = "\AGM_Optics\data\AGM_Optics_reticle90.p3d";
visionmode[] = {"Normal"};
};
};
};
};
class optic_Nightstalker : ItemCore {
class ItemInfo: InventoryOpticsItem_Base_F {
class OpticsModes {
class NCTALKEP {};
class Iron : NCTALKEP {
opticsppeffects[] = {}; // Fix Arma 3 bug
};
};
};
};
class optic_SOS: ItemCore {
class ItemInfo: InventoryOpticsItem_Base_F {
modelOptics = "\AGM_Optics\agm_optics_pip.p3d";
class OpticsModes {
class Snip {
visionMode[] = {"Normal","TI","NVG"};
thermalMode[] = {5,6};
opticsPPEffects[] = {"OpticsCHAbera1","radblur"};
modelOptics[] = {"\AGM_Optics\agm_optics_pip.p3d","\AGM_Optics\agm_optics_pip.p3d"};
};
};
};
};
class optic_DMS : ItemCore {
class ItemInfo: InventoryOpticsItem_Base_F {
class OpticsModes {
class Snip {};
class Iron : Snip {
opticsppeffects[] = {}; // Fix Arma 3 bug
};
};
};
};
class optic_LRPS : ItemCore {
descriptionshort = "Nightforce NXS Riflescope<br />Magnification: 5.5-22x";
displayname = "NXS 5.5-22x";
weaponinfotype = "AGM_RscWeapon";
AGM_Optics_enhanced = 1;
AGM_Optics_reticle = "\AGM_Optics\data\sos\sos-reticleMLR_ca.paa";
AGM_Optics_reticleIllum = "\AGM_Optics\data\sos\sos-reticleMLRIllum_ca.paa";
AGM_Optics_body = "\AGM_Optics\data\sos\sos-body_ca.paa";
AGM_Optics_bodyNight = "\AGM_Optics\data\sos\sos-bodyNight_ca.paa";
class ItemInfo: InventoryOpticsItem_Base_F {
modeloptics = "\AGM_Optics\data\AGM_Optics_reticle90.p3d";
weaponinfotype = "RscWeaponRangeZeroingFOV";
opticType = 2; // Sniper optics
class OpticsModes {
// Based on Nightforce NXS 5.5-22 scope
class Snip {
cameradir = "";
discretedistance[] = {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300};
discretedistanceinitindex = 0;
discreteinitindex = 0;
distancezoommax = 2300;
distancezoommin = 100;
memorypointcamera = "opticView";
modeloptics = "\AGM_Optics\data\AGM_Optics_reticle90.p3d";
opticsdisableperipherialvision = 1;
opticsdisplayname = "SOS";
opticsflare = 1;
opticsid = 1;
opticsppeffects[] = {"OpticsCHAbera1", "OpticsBlur1", "AGM_OpticsRadBlur1"};
// How to determine opticszoom
// First do the basic math based on the listed FOV of the scope to
// get a baseline FOV
// 0.1 meter at 100 meters = 1 mrad
//
// 5.5x FOV -- 5.3 m at 100 m = 53 mrad
// = 0.053 rad = 3.037 deg FOV
// 22x FOV -- 1.4 m at 100m = 14 mrad
// = 0.014 rad = 0.802 deg
// The FOV you give the engine is based on a rather larger scope outline, so we
// have to do this extra work ourselves.
// At 1680x1050
// The width of a TMR optic viewfield is 864px
// The engine viewport width (which is what the below FOV is based on) is 980
// (864/980) = (FOV to give engine / true FOV of optic)
// 864/980 * 0.053 = 0.04673
// 864/980 * 0.014 = 0.01234
// Measured experimentally, these values seem quite right.
// Certainly they're close enough after you account for pixel density, etc.
opticszoominit = 0.01234;
opticszoommax = 0.04673;
opticszoommin = 0.01234;
discretefov[] = {};
usemodeloptics = 1;
visionmode[] = {"Normal"};
};
};
};
};
class optic_Yorris : ItemCore {
descriptionshort = "Burris FastFire II Red Dot Sight<br />Magnification: 1x";
displayname = "FastFire II";
};
class optic_MRD : ItemCore {
descriptionshort = "Eotech MRDS Red Dot Sight<br />Magnification: 1x";
displayname = "MRDS";
};
class optic_Holosight : ItemCore {
descriptionshort = "Eotech XPS3 Holographic Sight<br />Magnification: 1x";
displayname = "XPS3 Holo";
};
};
class RscOpticsText;
class RscOpticsValue;
class RscInGameUI {
class RscUnitInfo;
class RscWeaponZeroing;
class AGM_RscWeapon : RscWeaponZeroing {
idd = -1;
controls[] = {"CA_Zeroing", "CA_FOVMode"};
onLoad ="with uiNameSpace do { AGM_OpticsIGUI = _this select 0 }";
class CA_FOVMode : RscOpticsValue {
idc = 154;
style = 2;
colorText[] = {0, 0, 0, 0};
x = 0;
y = 0;
w = 0;
h = 0;
};
};
};
class RscTitles {
class AGM_Optics_Scope {
idd = -1;
onLoad = "with uiNameSpace do { AGM_Optics_Scope = _this select 0 };";
onUnload = "";
movingEnable = 1;
duration = 10000;
controls[] = {"Reticle", "ReticleNight", "BodyNight", "Body"};
class Reticle {
colorBackground[] = {0,0,0, 0};
colorText[] = {1,1,1, 1};
fade = 0;
font = "PuristaMedium";
h = SafeZoneH;
idc = 1;
lineSpacing = 1.0;
movingEnable = 1;
size = 0;
sizeEx = 1;
style = 48;
text = "";
type = 0;
w = SafeZoneWAbs / ((getResolution select 0) / (getResolution select 1));
x = (SafeZoneXAbs + SafeZoneWAbs/2 - (SafeZoneWAbs / ((getResolution select 0) / (getResolution select 1)))/2);
y = SafeZoneY;
};
class ReticleNight : Reticle {
idc = 2;
text = "";
};
class Body : Reticle {
idc = 6;
text = "";
x = (SafeZoneXAbs + SafeZoneWAbs/2 - (SafeZoneWAbs / ((getResolution select 0) / (getResolution select 1))));
y = SafeZoneY - (SafeZoneH/2);
w = SafeZoneWAbs / ((getResolution select 0) / (getResolution select 1)) * 2;
h = SafeZoneH * 2;
};
class BodyNight : Body {
idc = 5;
text = "";
};
};
};
class PreloadTextures {
class CfgWeapons {
class optic_hamr {
AGM_Optics_body= "*";
AGM_Optics_bodyNight = "*";
AGM_Optics_reticle = "*";
AGM_Optics_reticleIllum = "*";
};
class optic_arco {
AGM_Optics_body= "*";
AGM_Optics_bodyNight = "*";
AGM_Optics_reticle = "*";
AGM_Optics_reticleIllum = "*";
};
class optic_mrco {
AGM_Optics_body= "*";
AGM_Optics_bodyNight = "*";
AGM_Optics_reticle = "*";
AGM_Optics_reticleIllum = "*";
};
class optic_LRPS {
AGM_Optics_body= "*";
AGM_Optics_bodyNight = "*";
AGM_Optics_reticle = "*";
AGM_Optics_reticleIllum = "*";
};
};
};

View File

@ -1,149 +0,0 @@
/*
* Original Author: Taosenai
* Adapted By: KoffeinFlummi
*
* Animates the scope when firing.
*
* Arguments:
* 0: Unit
* 1: Weapon
* 2: Muzzle
* 3: Mode
* 4: Ammo
* 5: Magazine
* 6: Projectile
*
* Return Value:
* None
*/
if (_this select 0 != AGM_player) exitwith {}; // Sanity check
0 = _this spawn {
disableSerialization;
_weaponType = _this select 1;
_config = configFile >> "CfgWeapons" >> _weaponType;
_scope = uiNameSpace getVariable "AGM_Optics_Scope";
// @todo
_recoilMulti = getNumber (_config >> "tmr_smallarms_recoil_shakeMultiplier"); // Will be 0 if undefined
if (_recoilMulti == 0) then {
_recoilMulti = 1;
};
if (_recoilMulti > 2.6) then {
_recoilMulti = 2.6; // Don't get too high
};
// Reduce the reticle movement as the player drops into lower, supported stances.
_detectStance = (player selectionPosition "Neck" select 2);
if (_detectStance < 1.3) then {
_recoilMulti = _recoilMulti - 0.10;
};
if (_detectStance < 0.7) then {
_recoilMulti = _recoilMulti - 0.20;
};
// Reduce reticle movement if the player is rested (tmr_autorest).
if (player getVariable ["tmr_autorest_rested", false]) then {
_recoilMulti = _recoilMulti - 0.20;
};
// Reduce reticle movement if the player is deployed (tmr_autorest).
if (player getVariable ["tmr_autorest_deployed", false]) then {
_recoilMulti = _recoilMulti - 0.30;
};
_recoilMulti = 1;
// @endtodo
// Constants which determine how the scope recoils
_recoilScope = 0.03 * _recoilMulti + random 0.0015;
_recoilRing = 0.03 * _recoilMulti + random 0.0015;
_randomScopeShiftX = 0.005 * _recoilMulti - random 0.011;
_randomReticleShiftX = 0.0036 * _recoilMulti + random 0.0045; // Always tend up and right;
_randomReticleShiftY = -0.0046 * _recoilMulti - random 0.0055;
/////////
// Center everything
// getResolution select 4 should return the aspect ratio, but it's totally wrong
// for triple head displays. We'll compute it manually.
_aspectRatio = (getResolution select 0) / (getResolution select 1);
_reticleX = (SafeZoneXAbs + SafeZoneWAbs/2 - (SafeZoneWAbs / _aspectRatio)/2);
_reticleY = SafeZoneY;
_reticleW = SafeZoneWAbs / _aspectRatio;
_reticleH = SafeZoneH;
// Reticle
(_scope displayCtrl 1) ctrlSetPosition [_reticleX, _reticleY, _reticleW, _reticleH];
// Reticle night (illum)
(_scope displayCtrl 2) ctrlSetPosition [_reticleX, _reticleY, _reticleW, _reticleH];
_bodyX = (SafeZoneXAbs + SafeZoneWAbs/2 - (SafeZoneWAbs / _aspectRatio));
_bodyY = SafeZoneY - (SafeZoneH/2);
_bodyW = SafeZoneWAbs / _aspectRatio * 2;
_bodyH = SafeZoneH * 2;
// Body night
(_scope displayCtrl 5) ctrlSetPosition [_bodyX, _bodyY, _bodyW, _bodyH];
// Body
(_scope displayCtrl 6) ctrlSetPosition [_bodyX, _bodyY, _bodyW, _bodyH];
_centerDelay = 0.01;
(_scope displayCtrl 1) ctrlCommit _centerDelay;
(_scope displayCtrl 2) ctrlCommit _centerDelay;
(_scope displayCtrl 5) ctrlCommit _centerDelay;
(_scope displayCtrl 6) ctrlCommit _centerDelay;
/////////
// Create and commit recoil effect
// Move reticle
(_scope displayCtrl 1) ctrlSetPosition [_reticleX - (_recoilScope/2) + _randomReticleShiftX, _reticleY - (_recoilScope/2) + _randomReticleShiftY, _reticleW + _recoilScope, _reticleH + _recoilScope];
(_scope displayCtrl 2) ctrlSetPosition [_reticleX - (_recoilScope/2) + _randomReticleShiftX, _reticleY - (_recoilScope/2) + _randomReticleShiftY, _reticleW + _recoilScope, _reticleH + _recoilScope];
// Move body
(_scope displayCtrl 5) ctrlSetPosition [_bodyX - (_recoilScope/2) + _randomScopeShiftX, _bodyY - (_recoilScope/2), _bodyW + _recoilScope, _bodyH + _recoilScope];
(_scope displayCtrl 6) ctrlSetPosition [_bodyX - (_recoilScope/2) + _randomScopeShiftX, _bodyY - (_recoilScope/2), _bodyW + _recoilScope, _bodyH + _recoilScope];
_recoilDelay = 0.036;
_fa = false;
_cwm = currentWeaponMode player;
if (_cwm == "FullAuto" || _cwm == "manual" || _cwm == "Burst") then {
_recoilDelay = getNumber (_config >> _cwm >> "reloadTime")/2.2;
_fa = true;
};
(_scope displayCtrl 1) ctrlCommit _recoilDelay;
(_scope displayCtrl 2) ctrlCommit _recoilDelay;
(_scope displayCtrl 5) ctrlCommit _recoilDelay;
(_scope displayCtrl 6) ctrlCommit _recoilDelay;
//////////////
waituntil {sleep 0.01; ctrlCommitted (_scope displayCtrl 6)};
//////////////
//////
// Bring them all back
(_scope displayCtrl 1) ctrlSetPosition [_reticleX, _reticleY, _reticleW, _reticleH];
(_scope displayCtrl 2) ctrlSetPosition [_reticleX, _reticleY, _reticleW, _reticleH];
(_scope displayCtrl 5) ctrlSetPosition [_bodyX, _bodyY, _bodyW, _bodyH];
(_scope displayCtrl 6) ctrlSetPosition [_bodyX, _bodyY, _bodyW, _bodyH];
_recenterDelay = 0.09;
if (_fa) then {
_recenterDelay = getNumber (_config >> _cwm >> "reloadTime")/2.2;
};
(_scope displayCtrl 1) ctrlCommit _recenterDelay;
(_scope displayCtrl 2) ctrlCommit _recenterDelay;
(_scope displayCtrl 5) ctrlCommit _recenterDelay;
(_scope displayCtrl 6) ctrlCommit _recenterDelay;
};

View File

@ -1,19 +0,0 @@
/*
* Original Author: Taosenai
* Adapted By: KoffeinFlummi
*
* Hides the scope.
*
*/
private ["_scope"];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 1) ctrlSetTextColor [1,1,1,0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 2) ctrlSetTextColor [1,1,1,0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 5) ctrlSetTextColor [1,1,1,0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 6) ctrlSetTextColor [1,1,1,0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 1) ctrlCommit 0;
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 2) ctrlCommit 0;
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 5) ctrlCommit 0;
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 6) ctrlCommit 0;

View File

@ -1,25 +0,0 @@
/*
* Original Author: Taosenai
* Adapted By: KoffeinFlummi
*
* Initializes the scope resources.
*
*/
private ["_display"];
// Make sure we only cutRsc when the resource isn't already available
if (isNil {uiNameSpace getVariable "AGM_Optics_Scope"} or {isNull (uiNameSpace getVariable "AGM_Optics_Scope")}) exitWith {
AGM_Optics_scopeRSC cutRsc ["AGM_Optics_Scope","PLAIN",0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 1) ctrlSetTextColor [1,1,1,0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 2) ctrlSetTextColor [1,1,1,0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 5) ctrlSetTextColor [1,1,1,0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 6) ctrlSetTextColor [1,1,1,0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 1) ctrlCommit 0;
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 2) ctrlCommit 0;
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 5) ctrlCommit 0;
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 6) ctrlCommit 0;
True
};
False

View File

@ -1,94 +0,0 @@
/*
* Original Author: Taosenai
* Adapted By: KoffeinFlummi
*
* Monitors the RscInGameUI and displays the overlays when needed.
*
* Arguments:
* None
*
* Return Value:
* None
*/
if !(cameraOn == AGM_player && {alive AGM_player} && {!visibleMap} && {ctrlShown ((uinamespace getVariable "AGM_OpticsIGUI") displayCtrl 154)}) exitWith {
// Failed the state check, hide the scope if it's up
if (AGM_Optics_inScope) then {
// Hide the scope
AGM_Optics_inScope = false;
AGM_Optics_inScope_FOV = ([] call cba_fnc_getFOV) select 0;
[] call AGM_Optics_fnc_hideScope;
};
};
AGM_Optics_Camera setposATL (positioncameratoworld [0,0,0.4]);
AGM_Optics_Camera camPrepareTarget (positioncameratoworld [0,0,50]);
AGM_Optics_Camera camCommitPrepared 0;
if (cameraView == "Gunner") then {
AGM_Optics_Camera camsetFOV 0.7;
AGM_Optics_Camera camcommit 0;
} else {
AGM_Optics_Camera camsetFOV 0.01;
AGM_Optics_Camera camcommit 0;
};
private ["_optic", "_scope"];
disableSerialization;
// Get the name of the attached optic
_optic = (primaryWeaponItems AGM_player) select 2;
_scope = uiNameSpace getVariable "AGM_Optics_Scope";
// Init the scope (if needed)
[] call AGM_Optics_fnc_initScope;
// Check if the optic has changed since we last drew it
_doUpdateAllLayers = false;
if (AGM_Optics_currentOptic != _optic) then {
AGM_Optics_currentOptic = _optic;
_doUpdateAllLayers = true;
};
// Check if Splendid Camera, unit switch, etc. has blanked out our displays for no good reason (grrr)
if (ctrlText (_scope displayCtrl 1) == "") then {
_doUpdateAllLayers = true;
};
// Draw the correct layers (don't show them)
if (_doUpdateAllLayers) then {
(_scope displayCtrl 1) ctrlSetText getText (configFile >> "CfgWeapons" >> _optic >> "AGM_Optics_reticle");
(_scope displayCtrl 2) ctrlSetText getText (configFile >> "CfgWeapons" >> _optic >> "AGM_Optics_reticleIllum");
(_scope displayCtrl 5) ctrlSetText getText (configFile >> "CfgWeapons" >> _optic >> "AGM_Optics_bodyNight");
(_scope displayCtrl 6) ctrlSetText getText (configFile >> "CfgWeapons" >> _optic >> "AGM_Optics_body");
};
// Stop processing if already in the scope view and FOV hasn't changed
if (AGM_Optics_inScope) exitwith {};
// Mark that we're in enhanced scope view
AGM_Optics_inScope = true;
// Calculate lighting
_lighting = sunOrMoon; // 1 is day, 0 is night
_nightOpacity = 1;
_dayOpacity = (0 max moonIntensity * (1 - (0 max overcast)))/5;
if (_lighting == 1) then {
_nightOpacity = 0;
_dayOpacity = 1;
};
// Apply lighting and make layers visible
(_scope displayCtrl 1) ctrlSetTextColor [1,1,1,1];
(_scope displayCtrl 2) ctrlSetTextColor [1,1,1,_nightOpacity];
(_scope displayCtrl 5) ctrlSetTextColor [1,1,1,_nightOpacity];
(_scope displayCtrl 6) ctrlSetTextColor [1,1,1,_dayOpacity];
(_scope displayCtrl 1) ctrlCommit 0;
(_scope displayCtrl 2) ctrlCommit 0;
(_scope displayCtrl 5) ctrlCommit 0;
(_scope displayCtrl 6) ctrlCommit 0;

Binary file not shown.

View File

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

View File

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

View File

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

View File

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

File diff suppressed because one or more lines are too long

View File

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

View File

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

View File

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

Binary file not shown.

View File

@ -1,6 +1,10 @@
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_clientInit) );
};
};

View File

@ -4,23 +4,23 @@
class ACE_MainActions { \
class GVAR(AttachVehicle) { \
displayName = "$STR_ACE_Attach_AttachDetach"; \
condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \
exceptions[] = {"isNotDragging"}; \
condition = QUOTE(_this call FUNC(canAttach)); \
insertChildren = QUOTE(_this call FUNC(getChildrenAttachActions)); \
exceptions[] = {}; \
showDisabled = 0; \
priority = 0; \
icon = PATHTOF(UI\attach_ca.paa); \
distance = 4; \
distance = 4.5; \
}; \
class GVAR(DetachVehicle) { \
displayName = "$STR_ACE_Attach_Detach"; \
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \
exceptions[] = {"isNotDragging"}; \
condition = QUOTE(_this call FUNC(canDetach)); \
statement = QUOTE(_this call FUNC(detach) ); \
exceptions[] = {}; \
showDisabled = 0; \
priority = 0; \
priority = 0.1; \
icon = PATHTOF(UI\detach_ca.paa); \
distance = 4; \
distance = 4.5; \
}; \
}; \
};
@ -55,18 +55,18 @@ class CfgVehicles {
class ACE_Equipment {
class GVAR(Attach) {
displayName = "$STR_ACE_Attach_AttachDetach";
condition = QUOTE(([ARR_3(_player, _player, '')] call FUNC(canAttach)));
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(openAttachUI); );
condition = QUOTE(_this call FUNC(canAttach));
insertChildren = QUOTE(_this call FUNC(getChildrenAttachActions));
exceptions[] = {"isNotDragging"};
showDisabled = 0;
priority = 5;
icon = PATHTOF(UI\attach_ca.paa);
hotkey = "T";
// hotkey = "T";
};
class GVAR(Detach) {
displayName = "$STR_ACE_Attach_Detach";
condition = QUOTE(([ARR_2(_player, _player)] call FUNC(canDetach)));
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(detach) );
condition = QUOTE(_this call FUNC(canDetach));
statement = QUOTE(_this call FUNC(detach));
exceptions[] = {"isNotDragging"};
showDisabled = 0;
priority = 5;

View File

@ -0,0 +1,6 @@
#include "script_component.hpp"
if (!hasInterface) exitWith {};
//If attach placing, stop when opening menu:
["interactMenuOpened", {GVAR(placeAction) = 0;}] call EFUNC(common,addEventHandler);

View File

@ -6,8 +6,7 @@ PREP(attach);
PREP(canAttach);
PREP(canDetach);
PREP(detach);
PREP(openAttachUI);
PREP(getChildrenAttachActions);
PREP(placeApprove);
PREP(placeCancel);
ADDON = true;

View File

@ -1,53 +1,54 @@
/*
* Author: eRazeri and esteldunedain
* Author: eRazeri, esteldunedain, PabstMirror
* Attach an item to the unit
*
* Arguments:
* 0: unit doing the attach (player) <OBJECT>
* 1: vehicle that it will be attached to (player or vehicle) <OBJECT>
* 2: Name of the attachable item <STRING>
* 0: vehicle that it will be attached to (player or vehicle) <OBJECT>
* 1: unit doing the attach (player) <OBJECT>
* 2: Array containing a string of the attachable item <ARRAY>
*
* Return Value:
* Nothing
*
* Example:
* Nothing
* [bob, bob, ["light"]] call ace_attach_fnc_attach;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_3(_unit,_attachToVehicle,_itemName);
private ["_itemClassname", "_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID"];
PARAMS_3(_attachToVehicle,_unit,_args);
_itemClassname = [_args, 0, ""] call CBA_fnc_defaultParam;
//Sanity Check (_unit has item in inventory, not over attach limit)
if !([_unit, _attachToVehicle, _itemName] call FUNC(canAttach)) exitWith {ERROR("Tried to attach, but check failed");};
private ["_itemVehClass", "_onAtachText", "_selfAttachPosition"];
if ((_itemClassname == "") || {!(_this call FUNC(canAttach))}) exitWith {ERROR("Tried to attach, but check failed");};
_itemVehClass = "";
_onAtachText = "";
_selfAttachPosition = [_unit, [-0.05, 0, 0.12], "rightshoulder"];
switch (true) do {
case (_itemName == "ACE_IR_Strobe_Item"): {
case (_itemClassname == "ACE_IR_Strobe_Item"): {
_itemVehClass = "ACE_IR_Strobe_Effect";
_onAtachText = localize "STR_ACE_Attach_IrStrobe_Attached";
//_selfAttachPosition = [_unit, [0, -0.11, 0.16], "pilot"]; //makes it attach to the head a bit better, shoulder is not good for visibility - eRazeri
};
case (_itemName == "B_IR_Grenade"): {
case (_itemClassname == "B_IR_Grenade"): {
_itemVehClass = "B_IRStrobe";
_onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached";
};
case (_itemName == "O_IR_Grenade"): {
case (_itemClassname == "O_IR_Grenade"): {
_itemVehClass = "O_IRStrobe";
_onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached";
};
case (_itemName == "I_IR_Grenade"): {
case (_itemClassname == "I_IR_Grenade"): {
_itemVehClass = "I_IRStrobe";
_onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached";
};
case (toLower _itemName in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]): {
_itemVehClass = _itemName;
case (toLower _itemClassname in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]): {
_itemVehClass = _itemClassname;
_onAtachText = localize "STR_ACE_Attach_Chemlight_Attached";
};
};
@ -55,36 +56,50 @@ switch (true) do {
if (_itemVehClass == "") exitWith {ERROR("no _itemVehClass for Item");};
if (_unit == _attachToVehicle) then { //Self Attachment
_unit removeItem _itemName; // Remove item
_unit removeItem _itemClassname; // Remove item
_attachedItem = _itemVehClass createVehicle [0,0,0];
_attachedItem attachTo _selfAttachPosition;
[_onAtachText] call EFUNC(common,displayTextStructured);
_attachToVehicle setVariable [QGVAR(Objects), [_attachedItem], true];
_attachToVehicle setVariable [QGVAR(ItemNames), [_itemName], true];
_attachToVehicle setVariable [QGVAR(ItemNames), [_itemClassname], true];
} else {
GVAR(setupObject) = _itemVehClass createVehicleLocal [0,0,-10000];
GVAR(setupObject) enableSimulationGlobal false;
GVAR(SetupPlacmentText) = _onAtachText;
GVAR(SetupPlacmentItem) = _itemName;
GVAR(SetupAttachVehicle) = _attachToVehicle;
GVAR(placer) = _unit;
GVAR(placeAction) = -1;
_tempObject = _itemVehClass createVehicleLocal [0,0,-10000];
_tempObject enableSimulationGlobal false;
[_unit, QGVAR(vehAttach), true] call EFUNC(common,setForceWalkStatus);
[QGVAR(PlacementEachFrame),"OnEachFrame", {
private "_player";
_player = ACE_player;
//Stop if player switch or player gets to far from vehicle
if (GVAR(placer) != _player || {_player distance GVAR(SetupAttachVehicle) > 7}) exitWith {
call FUNC(placeCancel);
//MenuBack isn't working for now (localize "STR_ACE_Attach_CancelAction")
[{[localize "STR_ACE_Attach_PlaceAction", ""] call EFUNC(interaction,showMouseHint)}, [], 0, 0] call EFUNC(common,waitAndExecute);
_unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = 1;}] call EFUNC(common,AddActionEventHandler)];
// _unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {true}, {GVAR(placeAction) = 0;}] call EFUNC(common,AddActionEventHandler)];
_actionID = _unit addAction [format ["<t color='#FF0000'>%1</t>", localize "STR_ACE_Attach_CancelAction"], {GVAR(placeAction) = 0}];
[{
PARAMS_2(_args,_pfID);
EXPLODE_7_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_tempObject,_onAtachText,_actionID);
if ((GVAR(placeAction) != -1) ||
{_unit != ACE_player} ||
{!([_unit, _attachToVehicle, []] call EFUNC(common,canInteractWith))} ||
{!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) then {
[_pfID] call CBA_fnc_removePerFrameHandler;
[_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus);
[] call EFUNC(interaction,hideMouseHint);
[_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler);
//[_unit, "MenuBack", (_unit getVariable [QGVAR(cancelActionEH), -1])] call EFUNC(common,removeActionEventHandler);
_unit removeAction _actionID;
if (GVAR(placeAction) == 1) then {
_startingPosition = _tempObject modelToWorldVisual [0,0,0];
[_unit, _attachToVehicle, _itemClassname, _itemVehClass, _onAtachText, _startingPosition] call FUNC(placeApprove);
};
deleteVehicle _tempObject;
} else {
_tempObject setPosATL ((ASLtoATL eyePos _unit) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]));;
};
GVAR(pfeh_running) = true;
_pos = (ASLtoATL eyePos _player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]);
GVAR(setupObject) setPosATL _pos;
}] call BIS_fnc_addStackedEventHandler; // @todo replace with CBA PFH
//had to delay the mouseHint, not sure why
[{[localize "STR_ACE_Attach_PlaceAction", localize "STR_ACE_Attach_CancelAction"] call EFUNC(interaction,showMouseHint)}, [], 0, 0] call EFUNC(common,waitAndExecute);
_unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {GVAR(pfeh_running) && {!isNull (GVAR(setupObject))}}, {call FUNC(placeApprove);}] call EFUNC(common,AddActionEventHandler)];
_unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {GVAR(pfeh_running) && {!isNull (GVAR(setupObject))}}, {call FUNC(placeCancel);}] call EFUNC(common,AddActionEventHandler)];
}, 0, [_unit, _attachToVehicle, _itemClassname, _itemVehClass, _tempObject, _onAtachText, _actionID]] call CBA_fnc_addPerFrameHandler;
};

View File

@ -3,25 +3,28 @@
* Check if a unit can attach a specific item.
*
* Arguments:
* 0: unit doing the attach (player) <OBJECT>
* 1: vehicle that it will be attached to (player or vehicle) <OBJECT>
* 2: Name of the attachable item <STRING>
* 0: vehicle that it will be attached to (player or vehicle) <OBJECT>
* 1: unit doing the attach (player) <OBJECT>
* 2: Array empty or containing a string of the attachable item <ARRAY>
*
* Return Value:
* Boolean <BOOL>
* Can Attach <BOOL>
*
* Example:
* Nothing
* [bob, bob, ["light"]] call ace_attach_fnc_canAttach;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_3(_unit,_attachToVehicle,_item);
PARAMS_3(_attachToVehicle,_player,_args);
private ["_attachLimit", "_attachedObjects"];
private ["_itemName", "_attachLimit", "_attachedObjects"];
_attachLimit = [10, 1] select (_unit == _attachToVehicle);
_itemName = [_args, 0, ""] call CBA_fnc_defaultParam;
_attachLimit = [6, 1] select (_player == _attachToVehicle);
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
canStand _unit && {alive _attachToVehicle} && {count _attachedObjects < _attachLimit} && {_item in (itemsWithMagazines _unit + [""])}
_playerPos = (ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot"));
(canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemName in ((itemsWithMagazines _player) + [""])};

View File

@ -3,20 +3,20 @@
* Check if a unit has an item attached and if it can remove that item.
*
* Arguments:
* 0: unit doing the detaching (player) <STRING>
* 1: vehicle that it will be detached from (player or vehicle) <OBJECT>
* 0: vehicle that it will be detached from (player or vehicle) <OBJECT>
* 1: unit doing the detaching (player) <OBJECT>
*
* Return Value:
* Boolean <BOOL>
* Can Detach <BOOL>
*
* Example:
* Nothing
* [bob, bob] call ace_attach_fnc_canDetach;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_attachToVehicle);
PARAMS_2(_attachToVehicle,_unit);
private ["_attachedObjects", "_inRange"];

View File

@ -3,20 +3,20 @@
* Detach an item from a unit
*
* Arguments:
* 0: unit doing the attaching (player) <STRING>
* 1: vehicle that it will be detached from (player or vehicle) <OBJECT>
* 0: vehicle that it will be detached from (player or vehicle) <OBJECT>
* 1: unit doing the detaching (player) <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* Nothing
* [car, bob] call ace_attach_fnc_detach
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_attachToVehicle);
PARAMS_2(_attachToVehicle,_unit);
private ["_attachedObjects", "_attachedItems"];
@ -74,13 +74,13 @@ _attachToVehicle setVariable [QGVAR(ItemNames), _attachedItems, true];
// Display message
switch (true) do {
case (_itemName == "ACE_IR_Strobe_Item") : {
case (_itemName == "ACE_IR_Strobe_Item") : {
[localize "STR_ACE_Attach_IrStrobe_Detached"] call EFUNC(common,displayTextStructured);
};
case (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) : {
case (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) : {
[localize "STR_ACE_Attach_IrGrenade_Detached"] call EFUNC(common,displayTextStructured);
};
case (toLower _itemName in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]) : {
case (toLower _itemName in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]) : {
[localize "STR_ACE_Attach_Chemlight_Detached"] call EFUNC(common,displayTextStructured);
};
};

View File

@ -0,0 +1,51 @@
/*
* Author: Garth de Wet (LH), PabstMirror
* Show the ammo counts for a static weapon.
* Called from "insertChildren" on interact_menu
*
* Argument:
* 0: Target <OBJECT>
* 1: Player <OBJECT>
*
* Return value:
* ChildActiosn<ARRAY>
*
* Example:
* [player, player] call ace_attach_fnc_getChildrenAttachActions
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_target,_player);
_listed = [];
_actions = [];
{
if !(_x in _listed) then {
_listed pushBack _x;
_item = ConfigFile >> "CfgMagazines" >> _x;
if (getNumber (_item >> "ACE_Attachable") == 1) then {
_displayName = getText(_item >> "displayName");
_picture = getText(_item >> "picture");
_action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction);
_actions pushBack [_action, [], _target];
};
};
} forEach (magazines _player);
{
if !(_x in _listed) then {
_listed pushBack _x;
_item = ConfigFile >> "CfgWeapons" >> _x;
if (getNumber (_item >> "ACE_Attachable") == 1) then {
_displayName = getText(_item >> "displayName");
_picture = getText(_item >> "picture");
_action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction);
_actions pushBack [_action, [], _target];
};
};
} forEach (items _player);
_actions

View File

@ -1,66 +0,0 @@
/*
* Author: Garth de Wet (LH)
* Opens the UI for attaching objects.
*
* Arguments:
* 0: unit <STRING>
* 1: target <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* Nothing
*
* Public: No
*/
#include "script_component.hpp"
private ["_actions", "_attachables", "_item"];
PARAMS_2(_unit,_target);
GVAR(attachTarget) = _target;
_listed = [];
_attachables = magazines _unit;
_actions = [localize "STR_ACE_Attach_AttachDetach", localize "STR_ACE_Attach_Attach"] call EFUNC(interaction,prepareSelectMenu);
{
if !(_x in _listed) then {
_item = ConfigFile >> "CfgMagazines" >> _x;
if (getNumber (_item >> "ACE_Attachable") == 1) then {
_actions = [
_actions,
getText(_item >> "displayName"),
getText(_item >> "picture"),
_x
] call EFUNC(interaction,addSelectableItem);
};
_listed pushBack _x;
};
} forEach _attachables;
_attachables = items _unit;
{
if !(_x in _listed) then {
_item = ConfigFile >> "CfgWeapons" >> _x;
if (getNumber (_item >> "ACE_Attachable") == 1) then {
_actions = [
_actions,
getText(_item >> "displayName"),
getText(_item >> "picture"),
_x
] call EFUNC(interaction,addSelectableItem);
};
_listed pushBack _x;
};
} forEach _attachables;
[
_actions,
{
[ACE_player, GVAR(attachTarget), _this] call FUNC(attach);
call EFUNC(interaction,hideMenu);
},
{
call EFUNC(interaction,hideMenu);
}
] call EFUNC(interaction,openSelectMenu);

View File

@ -1,69 +1,55 @@
/*
* Author: Pabst Mirror (based on Explosive attach by Garth de Wet (LH))
* Approves placement of the lightObject, scans for an appropriate location and attaches
* A player can release the attachObject with it floating in mid-air.
* This will use lineIntersectsWith to scan towards the center of the vehicle to find a collision
* ArmA's collision detection is of couse terrible and often misses collisions (difference between what we see and collision LOD)
* So it does multiple scans at slighly different angles
* This is VERY computationaly intensive, but doesn't happen that often.
*
* Arguments:
* Nothing
* 0: Unit (player) <OBJECT>
* 1: attachToVehicle <OBJECT>
* 2: Item Classname (cfgWeapon/cfgMagazine) <STRING>
* 3: Light Vehicle Classname <STRING>
* 4: On Attach Text <STRING>
* 5: Starting Pos of dummy item <ARRAY>
*
* Return Value:
* Nothing
*
* Example:
* Nothing
* No
*
* Public: No
*/
#include "script_component.hpp"
private ["_setupObject", "_setupClassname", "_itemClassname", "_placementText", "_attachToVehicle", "_placer", "_startingPosition", "_startingOffset", "_distanceFromCenter", "_closeInUnitVector", "_keepGoingCloser", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"];
private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_setupObject", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"];
PARAMS_6(_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_startingPosition);
if (GVAR(pfeh_running)) then {
[QGVAR(PlacementEachFrame),"OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
GVAR(pfeh_running) = false;
};
_setupObject = GVAR(setupObject);
_setupClassname = typeOf _setupObject;
_itemClassname = GVAR(SetupPlacmentItem);
_placementText = GVAR(SetupPlacmentText);
_attachToVehicle = GVAR(SetupAttachVehicle);
_placer = GVAR(placer);
GVAR(SetupPlacmentItem) = "";
GVAR(SetupPlacmentText) = "";
GVAR(setupObject) = objNull;
GVAR(SetupAttachVehicle) = objNull;
GVAR(placer) = objNull;
[_placer, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus);
[_placer, "DefaultAction", _placer getVariable [QGVAR(placeActionEH), -1]] call EFUNC(common,removeActionEventHandler);
[_placer, "MenuBack", _placer getVariable [QGVAR(cancelActionEH), -1]] call EFUNC(common,removeActionEventHandler);
call EFUNC(interaction,hideMouseHint);
//A player can release the attachObject with it floating in mid-air.
//This will use lineIntersectsWith to scan towards the center of the vehicle to find a collision
//ArmA's collision detection is of couse terrible and often misses collisions (difference between what we see and collision LOD)
//So it does multiple scans at slighly different angles
//This is VERY computationaly intensive, but doesn't happen that often.
_startingPosition = _setupObject modelToWorld [0,0,0];
_startingOffset = _attachToVehicle worldToModel _startingPosition;
_distanceFromCenter = vectorMagnitude _startingOffset;
_startDistanceFromCenter = vectorMagnitude _startingOffset;
_closeInUnitVector = vectorNormalized (_startingOffset vectorFromTo [0,0,0]);
_keepGoingCloser = true;
_closeInDistance = 0;
while {_keepGoingCloser} do {
if (_closeInDistance >= _distanceFromCenter) exitWith {};
_closeInMax = _startDistanceFromCenter;
_closeInMin = 0;
_closeInDistance = _closeInDistance + 0.01; //10mm each step
//Delete Local Placement Object
deleteVehicle _setupObject;
while {(_closeInMax - _closeInMin) > 0.01} do {
_closeInDistance = (_closeInMax + _closeInMin) / 2;
// systemChat format ["Trying %1 from %2 start %3", _closeInDistance, [_closeInMax, _closeInMin], _startDistanceFromCenter];
_endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance);
_endPosTestOffset set [2, (_startingOffset select 2)];
_endPosTest = _attachToVehicle modelToWorld _endPosTestOffset;
_endPosTest = _attachToVehicle modelToWorldVisual _endPosTestOffset;
_doesIntersect = false;
{
if (_doesIntersect) exitWith {};
_startingPosShifted = _startingPosition vectorAdd _x;
_startASL = if (surfaceIsWater _startingPosShifted) then {_startingPosShifted} else {ATLtoASL _startingPosShifted};
{
@ -71,33 +57,37 @@ while {_keepGoingCloser} do {
_endASL = if (surfaceIsWater _startingPosShifted) then {_endPosShifted} else {ATLtoASL _endPosShifted};
//Uncomment to see the lazor show, and see how the scanning works:
drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]];
if (_attachToVehicle in lineIntersectsWith [_startASL, _endASL, _placer, _setupObject]) exitWith {_keepGoingCloser = false};
// drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]];
if (_attachToVehicle in lineIntersectsWith [_startASL, _endASL, _unit]) exitWith {_doesIntersect = true};
} forEach [[0,0,0.045], [0,0,-0.045], [0,0.045,0], [0,-0.045,0], [0.045,0,0], [-0.045,0,0]];
} forEach [[0,0,0], [0,0,0.05], [0,0,-0.05]];
if (_doesIntersect) then {
_closeInMax = _closeInDistance;
} else {
_closeInMin = _closeInDistance;
};
};
//Delete Local Placement Object
deleteVehicle _setupObject;
_closeInDistance = (_closeInMax + _closeInMin) / 2;
//Checks
if ((_closeInDistance >= _distanceFromCenter) || (!([_placer,_attachToVehicle,_itemClassname] call FUNC(canAttach)))) exitWith {
TRACE_2("no valid spot found",_closeInDistance,_distanceFromCenter);
//Checks (too close to center or can't attach)
if (((_startDistanceFromCenter - _closeInDistance) < 0.1) || {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) exitWith {
TRACE_2("no valid spot found",_closeInDistance,_startDistanceFromCenter);
[localize "STR_ACE_Attach_Failed"] call EFUNC(common,displayTextStructured);
};
//Move it out slightly, for visability sake (better to look a little funny than be embedded//sunk in the hull)
//Move it out slightly, for visability sake (better to look a little funny than be embedded//sunk in the hull and be useless)
_closeInDistance = (_closeInDistance - 0.0085);
//Create New 'real' Object
_endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance);
_endPosTestOffset set [2, (_startingOffset select 2)];
_attachedObject = _setupClassname createVehicle (getPos _placer);
_attachedObject = _itemVehClass createVehicle (getPos _unit);
_attachedObject attachTo [_attachToVehicle, _endPosTestOffset];
//Remove Item from inventory
_placer removeItem _itemClassname;
_unit removeItem _itemClassname;
//Add Object to ACE_AttachedObjects and ACE_AttachedItemNames
_currentObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
@ -107,4 +97,4 @@ _currentItemNames = _attachToVehicle getVariable [QGVAR(ItemNames), []];
_currentItemNames pushBack _itemClassname;
_attachToVehicle setVariable [QGVAR(ItemNames), _currentItemNames, true];
[_placementText] call EFUNC(common,displayTextStructured);
[_onAtachText] call EFUNC(common,displayTextStructured);

View File

@ -1,35 +0,0 @@
/*
* Author: Pabst Mirror (based on Explosive attach by Garth de Wet (LH))
* Cancels placement of the lightObject
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* Nothing
*
* Public: No
*/
#include "script_component.hpp"
if (GVAR(pfeh_running)) then {
[QGVAR(PlacementEachFrame),"OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
GVAR(pfeh_running) = false;
};
if (!isNull (GVAR(setupObject))) then {
deleteVehicle GVAR(setupObject);
};
[GVAR(placer), QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus);
call EFUNC(interaction,hideMouseHint);
[GVAR(placer), "DefaultAction", GVAR(placer) getVariable [QGVAR(placeActionEH), -1]] call EFUNC(common,removeActionEventHandler);
[GVAR(placer), "MenuBack", GVAR(placer) getVariable [QGVAR(cancelActionEH), -1]] call EFUNC(common,removeActionEventHandler);
GVAR(placer) = objNull;
GVAR(SetupPlacmentItem) = "";
GVAR(SetupPlacmentText) = "";
GVAR(setupObject) = objNull;
GVAR(SetupAttachVehicle) = objNull;

View File

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

View File

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

View File

@ -1,41 +1,20 @@
class CfgAmmo {
/* 6.5x39mm Grendel */
class BulletBase;
class B_65x39_Caseless: BulletBase {
typicalSpeed = 724;
airFriction = -0.000915;
};
/* 5.56x45mm NATO */
class B_556x45_Ball: BulletBase {
typicalSpeed = 911;
airFriction = -0.001335;
};
/* 7.62x51mm NATO */
class B_762x51_Ball: BulletBase {
typicalSpeed = 853;
//airfriction =
};
/* Other */
class B_9x21_Ball;
class B_9x19_Ball: B_9x21_Ball {
typicalSpeed = 381;
airfriction = -0.00213;
};
class B_45ACP_Ball: BulletBase {
typicalSpeed = 250;
airfriction = -0.0009;
};
};
class CfgAmmo {
class BulletCore;
class BulletBase: BulletCore {
timeToLive = 15; // Default: 6, doubleplusgood all munition range.
};
class B_20mm : BulletBase {
timeToLive = 30;
};
class B_25mm : BulletBase {
timeToLive = 30;
};
class B_35mm_AA : BulletBase {
timeToLive = 30;
};
class B_30mm_AP : BulletBase {
timeToLive = 30;
};
};

View File

@ -1,65 +0,0 @@
class CfgMagazines {
/* 6.5x39mm Grendel - MX */
class CA_Magazine;
class 30Rnd_65x39_caseless_mag: CA_Magazine {
initSpeed = 724;
};
class 100Rnd_65x39_caseless_mag: CA_Magazine {
initSpeed = 724;
};
/* 6.5x39mm Grendel - Katiba */
class 30Rnd_65x39_caseless_green: 30Rnd_65x39_caseless_mag {
initSpeed = 724;
};
class 200Rnd_65x39_cased_Box: 100Rnd_65x39_caseless_mag {
initSpeed = 691;
};
/* 5.56x45mm NATO */
class 30Rnd_556x45_Stanag: CA_Magazine {
initSpeed = 911;
};
/* 7.62x51mm NATO */
class 20Rnd_762x51_Mag: CA_Magazine {
initSpeed = 792; // 18" M14 EBR barrel
};
class 150Rnd_762x51_Box: CA_Magazine {
ammo = "B_762x51_Ball";
initSpeed = 853; // Typical MV for M240
};
/* Other */
class 30Rnd_9x21_Mag: CA_Magazine {
ammo = "B_9x19_Ball";
initSpeed = 370;
};
class 16Rnd_9x21_Mag: 30Rnd_9x21_Mag {
ammo = "B_9x19_Ball";
initSpeed = 381;
};
class 30Rnd_45ACP_Mag_SMG_01: 30Rnd_9x21_Mag {
initSpeed = 259;
};
class 9Rnd_45ACP_Mag: 30Rnd_45ACP_Mag_SMG_01 {
initSpeed = 250;
};
};

View File

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

View File

@ -4,10 +4,10 @@
_wall = _this select 0;
if (local _wall) then {
_paper = "UserTexture_1x2_F" createVehicle position _wall;
_paper = "UserTexture_1x2_F" createVehicle position _wall;
_paper attachTo [_wall, [0,-0.02,0.6]];
_paper setDir getDir _wall;
_paper attachTo [_wall, [0,-0.02,0.6]];
_paper setDir getDir _wall;
_paper setObjectTextureGlobal [0, QUOTE(PATHTOF(textures\target_ca.paa))];
_paper setObjectTextureGlobal [0, QUOTE(PATHTOF(textures\target_ca.paa))];
};

View File

@ -41,3 +41,11 @@ class Extended_InitPost_EventHandlers {
};
};
};
//make sure captiveNum is reset on respawn
class Extended_Respawn_EventHandlers {
class CAManBase {
class ADDON {
respawn = QUOTE(_this call FUNC(handleRespawn));
};
};
};

View File

@ -39,6 +39,7 @@ class CfgMovesMaleSdr: CfgMovesBasic {
interpolationRestart = 2;
ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
canReload = 0;
};
class ACE_AmovPercMstpScapWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon {
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_Ease";
@ -63,6 +64,7 @@ class CfgMovesMaleSdr: CfgMovesBasic {
interpolationRestart = 2;
ConnectTo[] = {"ACE_AmovPercMstpSsurWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
canReload = 0;
};
class ACE_AmovPercMstpSsurWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon {
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon";
@ -80,4 +82,3 @@ class CfgMovesMaleSdr: CfgMovesBasic {
};
};
};

View File

@ -149,11 +149,6 @@ class CfgVehicles {
MACRO_LOADUNLOADCAPTIVE
};
class StaticMortar;
class Mortar_01_base_F: StaticMortar {
MACRO_LOADUNLOADCAPTIVE
};
class Box_NATO_Support_F;
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {

View File

@ -21,6 +21,7 @@ PREP(handleGetOut);
PREP(handleKilled);
PREP(handleOnUnconscious);
PREP(handlePlayerChanged);
PREP(handleRespawn);
PREP(handleUnitInitPost);
PREP(handleZeusDisplayChanged);
PREP(moduleSurrender);

View File

@ -27,7 +27,7 @@ if (_weapon == primaryWeapon _player && {_weapon != ""}) then {
_listedItemClasses = [];
_actions = [localize "STR_ACE_Captives_FriskMenuHeader", localize "STR_ACE_Captives_CancelSelection"] call ACE_Interaction_fnc_prepareSelectMenu;
_actions = [localize "STR_ACE_Captives_FriskMenuHeader", ""] call ACE_Interaction_fnc_prepareSelectMenu;
_allGear = [];

View File

@ -18,7 +18,7 @@
PARAMS_1(_oldUnit);
if (_oldUnit getVariable [QGVAR(isHandcuffed), false]) then {
_oldUnit setVariable [QGVAR(isHandcuffed), false, true];
[_oldUnit, false] call FUNC(setSurrendered);
};
if (_oldUnit getVariable [QGVAR(isEscorting), false]) then {
@ -26,5 +26,5 @@ if (_oldUnit getVariable [QGVAR(isEscorting), false]) then {
};
if (_oldUnit getVariable [QGVAR(isSurrendering), false]) then {
_oldUnit setVariable [QGVAR(isSurrendering), false, true];
[_oldUnit, false] call FUNC(setSurrendered);
};

View File

@ -16,15 +16,13 @@
*/
#include "script_component.hpp"
PARAMS_2(_unit,_isUnconc);
EXPLODE_2_PVT(_this,_unit,_isUnconc);
if (!local _unit) exitWith {};
systemChat format ["med: %1", _this];
if (_isUnconc) then {
//Knocked out: If surrendering, stop
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
[_unit, false] call FUNC(setSurrendered);
};
} else {

View File

@ -0,0 +1,39 @@
/*
* Author: commy2 PabstMirror
* Fix, because captiveNum doesn't reset properly on respawn
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Corpse <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [alive, body] call ACE_captives_fnc_handleRespawn;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_dead);
if (!local _unit) exitWith {};
//With respawn="group", we could be respawning into a unit that is handcuffed/captive
//If they are, reset and rerun the SET function
//if not, make sure to explicity disable the setCaptivityStatus, because captiveNum does not work correctly on respawn
if (_unit getVariable [QGVAR(isHandcuffed), false]) then {
_unit setVariable [QGVAR(isHandcuffed), false];
[_unit, true] call FUNC(setHandcuffed);
} else {
[_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus);
};
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
_unit setVariable [QGVAR(isSurrendering), false];
[_unit, true] call FUNC(setSurrendered);
} else {
[_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus);
};

View File

@ -75,6 +75,7 @@ if (_state) then {
};
};
if (!alive _unit) exitWith {};
if (_unit getVariable ["ACE_isUnconscious", false]) exitWith {}; //don't touch animations if unconscious
//if we are in "hands up" animationState, crack it now

View File

@ -100,11 +100,28 @@ class CfgVehicles {
transportMaxWeapons = 9001;
transportMaxMagazines = 9001;
transportMaxItems = 9001;
maximumload = 2000;
maximumload = 9001;
class TransportWeapons {};
class TransportMagazines {};
class TransportItems {};
class TransportBackpacks {};
};
class Item_Base_F;
class ACE_bananaItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = "$STR_ACE_Common_bananaDisplayName";
author = "$STR_ACE_Common_ACETeam";
vehicleClass = "Items";
class TransportItems
{
class ACE_banana
{
name = "ACE_banana";
count = 1;
};
};
};
};

View File

@ -1,23 +1,107 @@
class RscInGameUI {
class RscUnitInfo;
class RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscUnitInfoNoHUD {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscUnitInfoSoldier: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgSoldier', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Soldier')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgSoldier', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Soldier')])] call FUNC(localEvent););
};
class RscUnitInfoTank: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgVehicle', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Vehicle')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgVehicle', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Vehicle')])] call FUNC(localEvent););
};
class RscUnitInfoAir: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent););
};
class RscUnitInfo_AH64D_gunner {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent););
};
class RscUnitInfoUAV {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgUAV', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'UAV')])] call FUNC(localEvent););
};
class RscUnitInfoSubmarine: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgSubmarine', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Submarine')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgSubmarine', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Submarine')])] call FUNC(localEvent););
};
class RscUnitInfoShip: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgShip', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Ship')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgShip', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Ship')])] call FUNC(localEvent););
};
class RscWeaponEmpty {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscWeaponRangeFinder {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscWeaponRangeArtillery {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgArtillery', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Artillery')])] call FUNC(localEvent););
};
class RscWeaponRangeArtilleryAuto {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgArtillery', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Artillery')])] call FUNC(localEvent););
};
class RscWeaponRangeFinderPAS13 {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscOptics_LaserDesignator {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscWeaponRangeFinderMAAWS {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscWeaponRangeFinderAbramsCom {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscWeaponRangeFinderAbramsGun {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscWeaponRangeFinderStrykerMGSGun {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscOptics_strider_commander {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscOptics_titan {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscOptics_punisher {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscOptics_SDV_periscope {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscUnitInfoParachute: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgParachute', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Parachute')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgParachute', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Parachute')])] call FUNC(localEvent););
};
class RscUnitVehicle {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscOptics_LaserDesignator_02 {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
};
@ -25,6 +109,20 @@ class RscDisplayInventory {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDisplayInventory"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; [ARR_2('inventoryDisplayLoaded', _this)] call FUNC(localEvent););
};
class RscDisplayChannel {
onLoad = QUOTE(_this call FUNC(onLoadRscDisplayChannel));
// map
class RscDisplayMainMap {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Ingame')])] call FUNC(localEvent););
};
class RscDisplayGetReady: RscDisplayMainMap {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Briefing')])] call FUNC(localEvent););
};
class RscDisplayServerGetReady: RscDisplayGetReady {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ServerBriefing')])] call FUNC(localEvent););
};
class RscDisplayClientGetReady: RscDisplayGetReady {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ClientBriefing')])] call FUNC(localEvent););
};

View File

@ -156,7 +156,7 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
};
// "playerTurretChanged" event
[ACE_player] call FUNC(getTurretIndex);
_newPlayerTurret = [ACE_player] call FUNC(getTurretIndex);
if !(_newPlayerTurret isEqualTo GVAR(OldPlayerTurret)) then {
// Raise ACE event locally
GVAR(OldPlayerTurret) = _newPlayerTurret;
@ -179,4 +179,11 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler);
["notOnMap", {!visibleMap}] call FUNC(addCanInteractWithCondition);
["isNotInside", {_this select 0 == _this select 1 || {vehicle (_this select 0) == _this select 0}}] call FUNC(addCanInteractWithCondition);
["isNotInside", {
// Players can always interact with himself if not boarded
vehicle (_this select 0) == (_this select 0) ||
// Players can always interact with his vehicle
{vehicle (_this select 0) == (_this select 1)} ||
// Players can always interact with passengers of the same vehicle
{!((_this select 0) isEqualTo (_this select 1)) && {vehicle (_this select 0) == vehicle (_this select 1)}}
}] call FUNC(addCanInteractWithCondition);

View File

@ -4,13 +4,11 @@
ADDON = false;
// ACE Common Function
PREP(addActionEventHandler);
PREP(addActionMenuEventHandler);
PREP(addCanInteractWithCondition);
PREP(addLineToDebugDraw);
PREP(addMapMarkerCreatedEventHandler);
PREP(addScrollWheelEventHandler);
PREP(addSetting);
PREP(addToInventory);
PREP(adminKick);
PREP(ambientBrightness);
PREP(applyForceWalkStatus);
@ -55,20 +53,15 @@ PREP(fixPosition);
PREP(getAllDefinedSetVariables);
PREP(getAllGear);
PREP(getCaptivityStatus);
PREP(getConfigCommander);
PREP(getConfigGunner);
PREP(getDeathAnim);
PREP(getDefaultAnim);
PREP(getDefinedVariable);
PREP(getDefinedVariableDefault);
PREP(getDefinedVariableInfo);
PREP(getDoorTurrets);
PREP(getFirstObjectIntersection);
PREP(getFirstTerrainIntersection);
PREP(getForceWalkStatus);
PREP(getGunner);
PREP(getHitPoints);
PREP(getHitPointsWithSelections);
PREP(getInPosition);
PREP(getMarkerType);
PREP(getName);
@ -80,6 +73,7 @@ PREP(getStringFromMissionSQM);
PREP(getTargetAzimuthAndInclination);
PREP(getTargetDistance);
PREP(getTargetObject);
PREP(getTurnedOnLights);
PREP(getTurretCommander);
PREP(getTurretConfigPath);
PREP(getTurretCopilot);
@ -88,18 +82,16 @@ PREP(getTurretIndex);
PREP(getTurrets);
PREP(getTurretsFFV);
PREP(getTurretsOther);
PREP(getTurretDirection);
PREP(getUavControlPosition);
PREP(getVehicleCargo);
PREP(getVehicleCodriver);
PREP(getVehicleCrew);
PREP(getVersion);
PREP(getWeaponAzimuthAndInclination);
PREP(getWeaponIndex);
PREP(getWeaponModes);
PREP(getWeaponMuzzles);
PREP(getWeaponState);
PREP(getWeaponType);
PREP(getWindDirection);
PREP(getZoom);
PREP(goKneeling);
PREP(hadamardProduct);
PREP(hasItem);
@ -120,6 +112,7 @@ PREP(isModLoaded);
PREP(isPlayer);
PREP(isTurnedOut);
PREP(letterToCode);
PREP(lightIntensityFromObject);
PREP(loadPerson);
PREP(loadPersonLocal);
PREP(loadSettingsFromProfile);
@ -131,8 +124,8 @@ PREP(moveToTempGroup);
PREP(muteUnit);
PREP(numberToDigits);
PREP(numberToDigitsString);
PREP(numberToString);
PREP(onAnswerRequest);
PREP(onLoadRscDisplayChannel);
PREP(owned);
PREP(player);
PREP(playerSide);
@ -141,11 +134,7 @@ PREP(progressBar);
PREP(queueAnimation);
PREP(readSettingFromModule);
PREP(receiveRequest);
PREP(removeActionEventHandler);
PREP(removeActionMenuEventHandler);
PREP(removeCanInteractWithCondition);
PREP(removeMapMarkerCreatedEventHandler);
PREP(removeScrollWheelEventHandler);
PREP(removeSpecificMagazine);
PREP(requestCallback);
PREP(resetAllDefaults);
@ -188,6 +177,35 @@ PREP(useItem);
PREP(useMagazine);
PREP(waitAndExecute);
// config items
PREP(getConfigType);
PREP(getItemType);
PREP(getWeaponType);
PREP(getWeaponModes);
PREP(getWeaponMuzzles);
// config objects
PREP(getConfigTypeObject);
PREP(getConfigGunner);
PREP(getConfigCommander);
PREP(getHitPoints);
PREP(getHitPointsWithSelections);
PREP(getReflectorsWithSelections);
PREP(getLightProperties);
PREP(getLightPropertiesWeapon);
PREP(getVehicleCrew);
// turrets
PREP(getTurrets);
PREP(getTurretIndex);
PREP(getTurretConfigPath);
PREP(getTurretGunner);
PREP(getTurretCommander);
PREP(getTurretCopilot);
PREP(getDoorTurrets);
PREP(getTurretsFFV);
PREP(getTurretsOther);
// ACE_Debug
PREP(exportConfig);
PREP(getChildren);
@ -195,6 +213,7 @@ PREP(getDisplayConfigName);
PREP(log);
PREP(logControls);
PREP(logDisplays);
PREP(logModEntries);
PREP(monitor);
PREP(showUser);
@ -217,6 +236,17 @@ PREP(localEvent);
PREP(removeEventHandler);
PREP(removeAlLEventHandlers);
// other eventhandlers
PREP(addActionEventHandler);
PREP(addActionMenuEventHandler);
PREP(addScrollWheelEventHandler);
PREP(addMapMarkerCreatedEventHandler);
PREP(removeActionEventHandler);
PREP(removeActionMenuEventHandler);
PREP(removeScrollWheelEventHandler);
PREP(removeMapMarkerCreatedEventHandler);
// hashes
PREP(hashCreate);
PREP(hashSet);
@ -242,10 +272,10 @@ ACE_player = player;
if (hasInterface) then {
// PFH to update the ACE_player variable
[{
if !(ACE_player isEqualTo (missionNamespace getVariable ["BIS_fnc_moduleRemoteControl_unit", player])) then {
if !(ACE_player isEqualTo (call FUNC(player))) then {
_oldPlayer = ACE_player;
ACE_player = missionNamespace getVariable ["BIS_fnc_moduleRemoteControl_unit", player];
ACE_player = call FUNC(player);
uiNamespace setVariable ["ACE_player", ACE_player];
// Raise ACE event

View File

@ -2,7 +2,7 @@
class CfgPatches {
class ADDON {
units[] = {"ACE_Box_Misc"};
units[] = {"ACE_Box_Misc", "ACE_bananaItem"};
weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon", "ACE_Banana"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_main"};

View File

@ -7,7 +7,6 @@ private ["_eventType", "_event", "_eventName", "_eventArgs", "_eventNames", "_ev
_eventType = _this select 0;
_event = _this select 1;
if(_eventType == "ACEg") then {
_eventName = _event select 0;
_eventArgs = _event select 1;
@ -16,9 +15,18 @@ if(_eventType == "ACEg") then {
_eventIndex = _eventNames find _eventName;
if(_eventIndex != -1) then {
_events = (GVAR(events) select 1) select _eventIndex;
#ifdef DEBUG_EVENTS
diag_log text format[ARR_2("* Net Event %1",_eventName)];
diag_log text format[ARR_2(" args=%1",_eventArgs)];
#endif
{
if(!isNil "_x") then {
_eventArgs call CALLSTACK_NAMED(_x, format[ARR_3("Net Event %1 ID: %2",_eventName,_forEachIndex)]);
#ifdef DEBUG_EVENTS_CALLSTACK
diag_log text format[ARR_2(" ID: %1",_forEachIndex)];
#endif
};
} forEach _events;
};

View File

@ -29,7 +29,7 @@ private "_index";
_index = _conditionNames find _conditionName;
if (_index == -1) then {
_index = count _conditionNames;
_index = count _conditionNames;
};
_conditionNames set [_index, _conditionName];

View File

@ -0,0 +1,101 @@
/*
* Author: Garth 'L-H' de Wet
* Adds an item,weapon,magazine to the unit's inventory
* or places it in a weaponHolder if no space.
*
* Arguments:
* 0: Unit (OBJECT)
* 1: Classname (String)
* 2: Container (String, Optional) uniform, vest, backpack
*
* Return Value:
* Array:
* 0: Added to player (Bool)
* 1: weaponholder (OBJECT)
*
* Public: Yes
*/
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
EXPLODE_2_PVT(_this,_unit,_classname);
private "_addedToPlayer";
private "_container";
private "_canAdd";
private "_type";
_canAdd = false;
_addedToPlayer = true;
if((count _this) > 2) then {
_container = _this select 2;
} else {
_container = nil;
};
_type = [_classname] call EFUNC(common,getItemType);
if(!isNil "_container") then {
switch (_container) do {
case "vest": { _canAdd = _unit canAddItemToVest _classname; };
case "backpack": { _canAdd = _unit canAddItemToBackpack _classname; };
case "uniform": { _canAdd = _unit canAddItemToUniform _classname; };
};
} else {
_container = "";
_canAdd = _unit canAdd _classname;
};
switch ((_type select 0)) do {
case "weapon": {
if (_canAdd) then {
switch (_container) do {
case "vest": { (vestContainer _unit) addWeaponCargoGlobal [_classname, 1]; };
case "backpack": { (backpackContainer _unit) addWeaponCargoGlobal [_classname, 1]; };
case "uniform": { (uniformContainer _unit) addWeaponCargoGlobal [_classname, 1]; };
default { _unit addWeaponGlobal _classname; };
};
} else {
_addedToPlayer = false;
_pos = _unit modelToWorldVisual [0,1,0.05];
_unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit addWeaponCargoGlobal [_classname,1];
_unit setPosATL _pos;
};
};
case "magazine": {
if (_canAdd) then {
switch (_container) do {
case "vest": { (vestContainer _unit) addMagazineCargoGlobal [_classname, 1]; };
case "backpack": { (backpackContainer _unit) addMagazineCargoGlobal [_classname, 1]; };
case "uniform": { (uniformContainer _unit) addMagazineCargoGlobal [_classname, 1]; };
default { _unit addMagazineGlobal _classname; };
};
} else {
_addedToPlayer = false;
_pos = _unit modelToWorldVisual [0,1,0.05];
_unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit addMagazineCargoGlobal [_classname, 1];
_unit setPosATL _pos;
};
};
case "item": {
if (_canAdd) then {
switch (_container) do {
case "vest": { _unit addItemToVest _classname; };
case "backpack": { _unit addItemToBackpack _classname; };
case "uniform": { _unit addItemToUniform _classname; };
default { _unit addItem _classname; };
};
} else {
_addedToPlayer = false;
_pos = _unit modelToWorldVisual [0,1,0.05];
_unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit addItemCargoGlobal [_classname,1];
_unit setPosATL _pos;
};
};
default {diag_log format ["ACE: Incorrect item type passed to %1, passed: %2",QFUNC(AddToInventory),_type];};
};
[_addedToPlayer,_unit]

View File

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

View File

@ -15,28 +15,28 @@ _id = _this select 0;
_show = if (count _this > 1) then {_this select 1} else {false};
if (isnil QGVAR(SHOW_BLUR_SCREEN_COLLECTION)) then {
GVAR(SHOW_BLUR_SCREEN_COLLECTION) = [];
GVAR(SHOW_BLUR_SCREEN_COLLECTION) = [];
};
if (typeName _show == typeName 0) then {
_show = (_show == 1);
_show = (_show == 1);
};
if (_show) then {
GVAR(SHOW_BLUR_SCREEN_COLLECTION) pushback _id;
// show blur
if (isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then {
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = ppEffectCreate ["DynamicBlur", 102];
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectAdjust [0.9];
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectEnable true;
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectCommit 0;
};
GVAR(SHOW_BLUR_SCREEN_COLLECTION) pushback _id;
// show blur
if (isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then {
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = ppEffectCreate ["DynamicBlur", 102];
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectAdjust [0.9];
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectEnable true;
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectCommit 0;
};
} else {
GVAR(SHOW_BLUR_SCREEN_COLLECTION) = GVAR(SHOW_BLUR_SCREEN_COLLECTION) - [_id];
if (GVAR(SHOW_BLUR_SCREEN_COLLECTION) isEqualTo []) then {
// hide blur
if (!isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then {
ppEffectDestroy GVAR(MENU_ppHandle_GUI_BLUR_SCREEN);
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = nil;
};
};
GVAR(SHOW_BLUR_SCREEN_COLLECTION) = GVAR(SHOW_BLUR_SCREEN_COLLECTION) - [_id];
if (GVAR(SHOW_BLUR_SCREEN_COLLECTION) isEqualTo []) then {
// hide blur
if (!isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then {
ppEffectDestroy GVAR(MENU_ppHandle_GUI_BLUR_SCREEN);
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = nil;
};
};
};

View File

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

View File

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

View File

@ -7,11 +7,20 @@
* NONE.
*
* Return value:
* The current channel. Can be "group", "side", "global", "command", "vehicle" or "direct" (String)
* The current channel. Can be "group", "side", "global", "command", "vehicle", "direct" or "custom_X" (String)
*/
#include "script_component.hpp"
#define CHANNELS ["group", "side", "global", "command", "vehicle", "direct"]
#define CHANNELS_LOCALIZED [localize "str_channel_group", localize "str_channel_side", localize "str_channel_global", localize "str_channel_command", localize "str_channel_vehicle", localize "str_channel_direct"]
#define CHANNELS ["global", "side", "command", "group", "vehicle", "direct"]
#define CHANNELS_LOCALIZED [localize "str_channel_global", localize "str_channel_side", localize "str_channel_command", localize "str_channel_group", localize "str_channel_vehicle", localize "str_channel_direct"]
CHANNELS select (CHANNELS_LOCALIZED find (uiNamespace getVariable [QGVAR(currentChannel), ""])) max 0
private "_currentChannel";
_currentChannel = currentChannel;
if (_currentChannel < count CHANNELS) then {
_currentChannel = CHANNELS select _currentChannel;
} else {
_currentChannel = format ["custom_%1", _currentChannel - count CHANNELS - 1];
};
_currentChannel

View File

@ -34,13 +34,13 @@
#define Y_POS_ICONS_SECOND (TOP_SIDE + (1.1 * ICON_WIDTH))
// setting values
#define TOP_RIGHT_DOWN 1
#define TOP_RIGHT_LEFT 2
#define TOP_LEFT_DOWN 3
#define TOP_LEFT_RIGHT 4
#define TOP_RIGHT_DOWN 1
#define TOP_RIGHT_LEFT 2
#define TOP_LEFT_DOWN 3
#define TOP_LEFT_RIGHT 4
// other constants
#define DEFAULT_TIME 6
#define DEFAULT_TIME 6
private ["_iconId", "_show", "_icon", "_allControls", "_refresh", "_timeAlive", "_list", "_color"];
_iconId = _this select 0;
@ -53,68 +53,68 @@ disableSerialization;
_list = missionNamespace getvariable [QGVAR(displayIconList),[]];
_refresh = {
private ["_allControls"];
// Refreshing of all icons..
_allControls = missionNamespace getvariable [QGVAR(displayIconListControls), []];
{
ctrlDelete _x;
}foreach _allControls;
private ["_allControls"];
// Refreshing of all icons..
_allControls = missionNamespace getvariable [QGVAR(displayIconListControls), []];
{
ctrlDelete _x;
}foreach _allControls;
_allControls = [];
_allControls = [];
private ["_ctrl", "_setting"];
_setting = missionNamespace getvariable[QGVAR(settingFeedbackIcons), 0];
if (_setting > 0) then {
{
// +19000 because we want to make certain we are using free IDCs..
_ctrl = ((findDisplay 46) ctrlCreate ["RscPicture", _foreachIndex + 19000]);
_position = switch (_setting) do {
case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]};
case TOP_LEFT_DOWN: {[LEFT_SIDE + (0.5 * ICON_WIDTH), Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]};
default {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
};
_ctrl ctrlSetPosition _position;
_ctrl ctrlsetText (_x select 1);
_ctrl ctrlSetTextColor (_x select 2);
_ctrl ctrlCommit 0;
_allControls pushback _ctrl;
}foreach (missionNamespace getvariable [QGVAR(displayIconList),[]]);
};
missionNamespace setvariable [QGVAR(displayIconListControls), _allControls];
private ["_ctrl", "_setting"];
_setting = missionNamespace getvariable[QGVAR(settingFeedbackIcons), 0];
if (_setting > 0) then {
{
// +19000 because we want to make certain we are using free IDCs..
_ctrl = ((findDisplay 46) ctrlCreate ["RscPicture", _foreachIndex + 19000]);
_position = switch (_setting) do {
case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]};
case TOP_LEFT_DOWN: {[LEFT_SIDE + (0.5 * ICON_WIDTH), Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]};
default {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
};
_ctrl ctrlSetPosition _position;
_ctrl ctrlsetText (_x select 1);
_ctrl ctrlSetTextColor (_x select 2);
_ctrl ctrlCommit 0;
_allControls pushback _ctrl;
}foreach (missionNamespace getvariable [QGVAR(displayIconList),[]]);
};
missionNamespace setvariable [QGVAR(displayIconListControls), _allControls];
};
if (_show) then {
if ({(_x select 0 == _iconId)} count _list == 0) then {
_list pushback [_iconId, _icon, _color, time];
} else {
{
if (_x select 0 == _iconId) exitwith {
_list set [_foreachIndex, [_iconId, _icon, _color, time]];
};
}foreach _list;
};
missionNamespace setvariable [QGVAR(displayIconList), _list];
call _refresh;
if ({(_x select 0 == _iconId)} count _list == 0) then {
_list pushback [_iconId, _icon, _color, time];
} else {
{
if (_x select 0 == _iconId) exitwith {
_list set [_foreachIndex, [_iconId, _icon, _color, time]];
};
}foreach _list;
};
missionNamespace setvariable [QGVAR(displayIconList), _list];
call _refresh;
if (_timeAlive >= 0) then {
[{
if (_timeAlive >= 0) then {
[{
[_this select 0, false, "", [0,0,0], 0] call FUNC(displayIcon);
}, [_iconId], _timeAlive, _timeAlive] call EFUNC(common,waitAndExecute);
};
};
} else {
if ({(_x select 0 == _iconId)} count _list == 1) then {
private "_newList";
_newList = [];
{
if (_x select 0 != _iconId) then {
_newList pushback _x;
};
}foreach _list;
if ({(_x select 0 == _iconId)} count _list == 1) then {
private "_newList";
_newList = [];
{
if (_x select 0 != _iconId) then {
_newList pushback _x;
};
}foreach _list;
missionNamespace setvariable [QGVAR(displayIconList), _newList];
call _refresh;
};
missionNamespace setvariable [QGVAR(displayIconList), _newList];
call _refresh;
};
};

View File

@ -36,11 +36,7 @@ if (count _this > 3) then {
};
// don't overwrite more important animations
if (_unit getVariable ["ACE_isUnconscious", false] && {!_force}) exitWith {
if (_animation != "Unconscious") then {
[_unit, "Unconscious", 2] call FUNC(doAnimation);
};
};
if (_unit getVariable ["ACE_isUnconscious", false] && {(_animation != "Unconscious")} && {!_force}) exitWith {};
// don't go unconscious if the unit isn't unconscious
if (_animation == "Unconscious" && {!((_unit getVariable ["ACE_isUnconscious", false]) || (_unit getVariable ["ACE_isDead", false]))}) exitWith {};

View File

@ -7,19 +7,19 @@ _var = _this select 0;
_depth = _this select 1;
_pad = "";
for "_i" from 0 to _depth do {
_pad = _pad + toString [9];
_pad = _pad + toString [9];
};
_depth = _depth + 1;
if(IS_ARRAY(_var)) then {
if((count _var) > 0) then {
diag_log text format["%1[", _pad];
{
[_x, _depth] call FUNC(dumpArray);
} forEach _var;
diag_log text format["%1],", _pad];
} else {
diag_log text format["%1[],", _pad];
};
if((count _var) > 0) then {
diag_log text format["%1[", _pad];
{
[_x, _depth] call FUNC(dumpArray);
} forEach _var;
diag_log text format["%1],", _pad];
} else {
diag_log text format["%1[],", _pad];
};
} else {
diag_log text format["%1%2", _pad, [_var] call FUNC(formatVar)];
diag_log text format["%1%2", _pad, [_var] call FUNC(formatVar)];
};

View File

@ -2,46 +2,46 @@
#define DEBUG_MODE_FULL
#include "script_component.hpp"
/*
diag_log text format["REGISTERED ACE PFH HANDLERS"];
diag_log text format["-------------------------------------------"];
if(!isNil "ACE_PFH") then {
{
private["_pfh"];
_pfh = _x select 0;
diag_log text format["Registered PFH: id=%1, %1:%2", (_pfh select 0), (_pfh select 1), (_pfh select 2) ];
} forEach ACE_PFH;
};*/
if(!isNil "ACE_PFH_COUNTER") then {
{
private["_pfh"];
_pfh = _x select 0;
diag_log text format["Registered PFH: id=%1, %1:%2", (_pfh select 0), (_pfh select 1), (_pfh select 2) ];
} forEach ACE_PFH_COUNTER;
};
diag_log text format["ACE COUNTER RESULTS"];
diag_log text format["-------------------------------------------"];
{
private["_counterEntry", "_iter", "_total", "_count", "_delta", "_averageResult"];
_counterEntry = _x;
_iter = 0;
_total = 0;
_count = 0;
_averageResult = 0;
if( (count _counterEntry) > 3) then {
// calc
{
if(_iter > 2) then {
_count = _count + 1;
_delta = (_x select 1) - (_x select 0);
_total = _total + _delta;
};
_iter = _iter + 1;
} forEach _counterEntry;
// results
_averageResult = (_total / _count) * 1000;
// dump results
diag_log text format["%1: Average: %2s / %3 = %4ms", (_counterEntry select 0), _total, _count, _averageResult];
} else {
diag_log text format["%1: No results", (_counterEntry select 0) ];
};
private["_counterEntry", "_iter", "_total", "_count", "_delta", "_averageResult"];
_counterEntry = _x;
_iter = 0;
_total = 0;
_count = 0;
_averageResult = 0;
if( (count _counterEntry) > 3) then {
// calc
{
if(_iter > 2) then {
_count = _count + 1;
_delta = (_x select 1) - (_x select 0);
_total = _total + _delta;
};
_iter = _iter + 1;
} forEach _counterEntry;
// results
_averageResult = (_total / _count) * 1000;
// dump results
diag_log text format["%1: Average: %2s / %3 = %4ms", (_counterEntry select 0), _total, _count, _averageResult];
} else {
diag_log text format["%1: No results", (_counterEntry select 0) ];
};
} forEach ACE_COUNTERS;
/*
@ -49,21 +49,21 @@ diag_log text format["-------------------------------------------"];
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER"];
diag_log text format["-------------------------------------------"];
{
private["_delay"];
_delay = _x select 2;
//if(_delay > 0) then { _delay = _delay / 1000; };
diag_log text format["%1: %2s, delay=%3, handle=%4",(_x select 0), _delay, (_x select 3), (_x select 4)];
private["_delay"];
_delay = _x select 2;
//if(_delay > 0) then { _delay = _delay / 1000; };
diag_log text format["%1: %2s, delay=%3, handle=%4",(_x select 0), _delay, (_x select 3), (_x select 4)];
} forEach ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER;
// Dump PFH Trackers
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER"];
diag_log text format["-------------------------------------------"];
{
private["_delta"];
_delta = _x select 1;
//if(_delta > 0) then { _delta = _delta / 1000; };
diag_log text format[" DELTA: %1s", _delta];
private["_delta"];
_delta = _x select 1;
//if(_delta > 0) then { _delta = _delta / 1000; };
diag_log text format[" DELTA: %1s", _delta];
} forEach ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER;
//{

View File

@ -1,5 +1,5 @@
/*
* Author: bux578
* Author: bux578, commy2
*
* Returns an array containing all items of a given unit
*
@ -7,32 +7,45 @@
* 0: Unit (Object)
*
* Return value:
* Array with all the gear
* Array with all the gear, format:
* 0: headgear (String)
* 1: goggles (String)
* 2,3: uniform (String, Array)
* 4,5: vest (String, Array)
* 6,7: backpack (String, Array)
* 8-10: rifle (String, Array, Array)
* 11-13: launcher (String, Array, Array)
* 14-16: pistol (String, Array, Array)
* 17: map, compass, watch, etc. (Array)
* 18: binocluar (String)
*
*/
#include "script_component.hpp"
EXPLODE_1_PVT(_this,_unit);
if (isNull _unit) exitWith {[]};
if (isNull _unit) exitWith {[
"",
"",
"", [],
"", [],
"", [],
"", ["","","",""], [],
"", ["","","",""], [],
"", ["","","",""], [],
[],
""
]};
[
(headgear _unit),
(goggles _unit),
(uniform _unit),
(uniformItems _unit),
(vest _unit),
(vestItems _unit),
(backpack _unit),
(backpackItems _unit),
(primaryWeapon _unit),
(primaryWeaponItems _unit),
(primaryWeaponMagazine _unit),
(secondaryWeapon _unit),
(secondaryWeaponItems _unit),
(secondaryWeaponMagazine _unit),
(handgunWeapon _unit),
(handgunItems _unit),
(handgunMagazine _unit),
(assignedItems _unit),
(binocular _unit)
]
headgear _unit,
goggles _unit,
uniform _unit, uniformItems _unit,
vest _unit, vestItems _unit,
backpack _unit, backpackItems _unit,
primaryWeapon _unit, primaryWeaponItems _unit, primaryWeaponMagazine _unit,
secondaryWeapon _unit, secondaryWeaponItems _unit, secondaryWeaponMagazine _unit,
handgunWeapon _unit, handgunItems _unit, handgunMagazine _unit,
assignedItems _unit,
binocular _unit
]

View File

@ -0,0 +1,24 @@
/*
* Author: commy2
*
* What kind of Cfg is the item. Works for CfgMagaines, CfgWeapons and CfgGlasses
*
* Argument:
* 0: A item's classname. (String)
*
* Return value:
* CfgWhatever (String)
*/
#include "script_component.hpp"
private "_item";
_item = _this select 0;
if (isClass (configFile >> "CfgWeapons" >> _item)) exitWith {"CfgWeapons"};
if (isClass (configFile >> "CfgMagazines" >> _item)) exitWith {"CfgMagazines"};
if (isClass (configFile >> "CfgGlasses" >> _item)) exitWith {"CfgGlasses"};
""

View File

@ -0,0 +1,22 @@
/*
* Author: commy2
*
* What kind of Cfg is the object. Works for CfgVehicles and CfgAmmo
*
* Argument:
* 0: An object's classname. (String)
*
* Return value:
* CfgWhatever (String)
*/
#include "script_component.hpp"
private "_object";
_object = _this select 0;
if (isClass (configFile >> "CfgVehicles" >> _object)) exitWith {"CfgVehicles"};
if (isClass (configFile >> "CfgAmmo" >> _object)) exitWith {"CfgAmmo"};
""

View File

@ -16,6 +16,8 @@ private ["_vehicle", "_weapon"];
_vehicle = _this select 0;
_weapon = _this select 1;
if (gunner _vehicle == _vehicle && {_weapon in weapons _vehicle}) exitWith {gunner _vehicle};
private "_gunner";
_gunner = objNull;
@ -23,6 +25,6 @@ _gunner = objNull;
if (_weapon in (_vehicle weaponsTurret _x)) exitWith {
_gunner = _vehicle turretUnit _x;
};
} forEach allTurrets _vehicle;
} forEach allTurrets [_vehicle, true];
_gunner

View File

@ -0,0 +1,83 @@
/*
* Author: commy2
*
* What kind of item is given classname
*
* Argument:
* 0: Classname of a item. (String)
*
* Return value:
* Item type. (Array)
* 0: "weapon", "item", "magazine" or "" (String)
* 1: A description of the item (e.g. "primary" for a weapon or "vest" for a vest item)
*
*/
#include "script_component.hpp"
private "_item";
_item = _this select 0;
_cfgType = [_item] call FUNC(getConfigType);
if (_cfgType == "") exitWith {["",""]};
if (_cfgType == "CfgGlasses") exitWith {["item","glasses"]};
private ["_config", "_type"];
_config = configFile >> _cfgType >> _item;
_type = getNumber (_config >> "type");
if (isNumber (_config >> "ItemInfo" >> "type")) then {
_type = getNumber (_config >> "ItemInfo" >> "type");
};
private "_default";
_default = ["item", "magazine"] select (_cfgType == "CfgMagazines");
switch (true) do {
case (_type == 0): {[_default,"unknown"]};
case (_type == 2^0): {["weapon","primary"]};
case (_type == 2^1): {["weapon","handgun"]};
case (_type == 2^2): {["weapon","secondary"]};
case (_type < 2^4): {["weapon","unknown"]};
case (_type == 2^4): {["magazine","handgun"]}; // handgun
case (_type == 2^8): {["magazine","primary"]}; // rifle
case (_type == 2^9): {["magazine","secondary"]}; // rpg, mg, mines
//case (_type < 2^11): {["magazine","unknown"]};
case (_type == 101): {["item","muzzle"]};
case (_type == 201): {["item","optics"]};
case (_type == 301): {["item","flashlight"]};
case (_type == 302): {["item","under"]}; // czech for bipod item
case (_type == 401): {["item","first_aid_kit"]};
case (_type == 501): {["item","fins"]}; // not implemented
case (_type == 601): {["item","breathing_bomb"]}; // not implemented
case (_type == 603): {["item","goggles"]};
case (_type == 604): {["item","scuba"]}; // not implemented
case (_type == 605): {["item","headgear"]};
case (_type == 611): {["item","radio"]};
case (_type == 616): {["item","hmd"]};
case (_type == 617): {["item","binocular"]};
case (_type == 619): {["item","medikit"]};
case (_type == 620): {["item","toolkit"]};
case (_type == 621): {["item","uav_terminal"]};
case (_type == 701): {["item","vest"]};
case (_type == 801): {["item","uniform"]};
case (_type == 2^12): {
switch (toLower getText (_config >> "simulation")) do {
case ("weapon"): {["weapon","binocular"]};
case ("binocular"): {["weapon","binocular"]};
case ("nvgoggles"): {["item","nvgoggles"]};
case ("itemminedetector"): {["item","minedetector"]};
default {[_default,"unknown"]};
};
};
case (_type == 2^16): {["weapon","vehicle"]};
case (_type == 2^17): {[_default,"unknown"]}; // ???
default {[_default,"unknown"]};
};

View File

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

View File

@ -0,0 +1,58 @@
/*
* Author: commy2
* Read properties of given flashlight. @todo, Can weapons themselves still have flashlights (no attachment)?
*
* Arguments:
* 0: A flashlight (String)
*
* Return Value:
* Stuff from config (Array)
*
*/
#include "script_component.hpp"
private "_weapon";
_weapon = _this select 0;
private "_config";
_config = configFile >> "CfgWeapons" >> _weapon >> "ItemInfo" >> "FlashLight";
private ["_intensity", "_position", "_direction", "_innerAngle", "_outerAngle"];
_intensity = getNumber (_config >> "intensity");
_position = getText (_config >> "position");
_direction = getText (_config >> "direction");
_innerAngle = getNumber (_config >> "innerAngle");
_outerAngle = getNumber (_config >> "outerAngle");
[_intensity, _position, _direction, _innerAngle, _outerAngle]
/*
class FlashLight
{
color[] = {180,156,120};
ambient[] = {0.9,0.78,0.6};
intensity = 20;
size = 1;
innerAngle = 20;
outerAngle = 80;
coneFadeCoef = 5;
position = "flash dir";
direction = "flash";
useFlare = 1;
flareSize = 1.4;
flareMaxDistance = "100.0f";
dayLight = 0;
class Attenuation
{
start = 0.5;
constant = 0;
linear = 0;
quadratic = 1.1;
hardLimitStart = 20;
hardLimitEnd = 30;
};
scale[] = {0};
};
*/

View File

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

View File

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

View File

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

View File

@ -0,0 +1,14 @@
/*
* Author: commy2
*
* Returns a value depending on current zoom level.
*
* Argument:
* None.
*
* Return value:
* Zoom. (Number)
*/
#include "script_component.hpp"
(0.5 - ((worldToScreen positionCameraToWorld [0,1,1]) select 1)) * (getResolution select 5)

View File

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

View File

@ -0,0 +1,109 @@
/*
* Author: commy2
* Calculate light intensity object 1 recieves from object 2
*
* Arguments:
* 0: Object that recieves light (Object)
* 1: Object that emits light (Object)
*
* Return Value:
* Brightest light level
*
*/
#include "script_component.hpp"
private ["_unit", "_lightSource"];
_unit = _this select 0;
_lightSource = _this select 1;
private "_unitPos";
_unitPos = _unit modelToWorld (_unit selectionPosition "spine3");
private "_lightLevel";
_lightLevel = 0;
if (_lightSource isKindOf "CAManBase") then {
// handle persons with flashlights
private "_weapon";
_weapon = currentWeapon _lightSource;
if !(_lightSource isFlashlightOn _weapon) exitWith {};
private ["_flashlight", "_properties", "_intensity", "_innerAngle", "_outerAngle", "_position", "_direction", "_directionToUnit", "_distance", "_angle"];
_flashlight = switch (_weapon) do {
case (primaryWeapon _lightSource): {
primaryWeaponItems _lightSource select 1
};
case (secondaryWeapon _lightSource): {
secondaryWeaponItems _lightSource select 1
};
case (handgunWeapon _lightSource): {
handgunItems _lightSource select 1
};
default {""};
};
_properties = [[_flashlight], FUNC(getLightPropertiesWeapon), uiNamespace, format [QEGVAR(cache,%1_%2), QUOTE(DFUNC(getLightPropertiesWeapon)), _flashlight], 1E11] call FUNC(cachedCall);
//_properties = [_flashlight] call FUNC(getLightPropertiesWeapon);
_innerAngle = (_properties select 3) / 2;
_outerAngle = (_properties select 4) / 2;
_position = _lightSource modelToWorld (_lightSource selectionPosition "rightHand");
_direction = _lightSource weaponDirection _weapon;
_directionToUnit = _position vectorFromTo _unitPos;
_distance = _unitPos distance _position;
_angle = acos (_direction vectorDotProduct _directionToUnit);
_lightLevel = (linearConversion [0, 30, _distance, 1, 0, true]) * (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true]);
} else {
// handle any object, strcutures, cars, tanks, etc. @todo campfires, burning vehicles
private "_lights";
_lights = [_lightSource] call FUNC(getTurnedOnLights);
{
private ["_properties", "_intensity", "_innerAngle", "_outerAngle", "_position", "_direction", "_directionToUnit", "_distance", "_angle"];
_properties = [[_lightSource, _x], FUNC(getLightProperties), uiNamespace, format [QEGVAR(cache,%1_%2_%3), QUOTE(DFUNC(getLightProperties)), typeOf _lightSource, _x], 1E11] call FUNC(cachedCall);
//_properties = [_lightSource, _x] call FUNC(getLightProperties);
// @todo intensity affects range?
//_intensity = _properties select 0;
_innerAngle = (_properties select 3) / 2;
_outerAngle = (_properties select 4) / 2;
// get world position and direction
_position = _lightSource modelToWorld (_lightSource selectionPosition (_properties select 1));
_direction = _lightSource modelToWorld (_lightSource selectionPosition (_properties select 2));
_direction = _position vectorFromTo _direction;
_directionToUnit = _position vectorFromTo _unitPos;
_distance = _unitPos distance _position;
_angle = acos (_direction vectorDotProduct _directionToUnit);
_lightLevel = _lightLevel max ((linearConversion [0, 30, _distance, 1, 0, true]) * (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true]));
//systemChat format ["%1 %2", (linearConversion [0, 30, _distance, 1, 0, true]), (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true])];
} forEach _lights;
// handle campfires
if (inflamed _lightSource) then {
private "_distance";
_distance = _unitPos distance position _lightSource;
_lightLevel = _lightLevel max linearConversion [0, 30, _distance, 0.5, 0, true];
};
};
_lightLevel

View File

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

View File

@ -12,16 +12,23 @@
*/
#include "script_component.hpp"
_eventName = _this select 0;
_eventArgs = _this select 1;
PARAMS_2(_eventName,_eventArgs);
_eventNames = GVAR(events) select 0;
_eventIndex = _eventNames find _eventName;
if(_eventIndex != -1) then {
_events = (GVAR(events) select 1) select _eventIndex;
#ifdef DEBUG_EVENTS
diag_log text format[ARR_2("* Local Event: %1",_eventName)];
diag_log text format[ARR_2(" args=%1",_eventArgs)];
#endif
{
if(!isNil "_x") then {
_eventArgs call CALLSTACK_NAMED(_x, format[ARR_3("Local Event %1 ID: %2",_eventName,_forEachIndex)]);
#ifdef DEBUG_EVENTS_CALLSTACK
diag_log text format[ARR_2(" ID: %1",_forEachIndex)];
#endif
};
} forEach _events;
};

View File

@ -0,0 +1,17 @@
// by commy2
private ["_configs", "_entries"];
_configs = "true" configClasses (configFile >> _this);
_entries = [];
{
{
_name = toLower configName _x;
if !(_name in _entries) then {
diag_log text _name;
_entries pushBack _name;
};
} forEach configProperties [_x, "toLower configName _x find 'ace' == 0", false];
} forEach _configs;

View File

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

View File

@ -1,29 +0,0 @@
/*
* Author: Pabst Mirror, commy2
* When the RscDisplayChannel is loaded, this will constantly uiNamespace variable ace_common_currentChannel
* with the raw localized text of CA_Channel (IDC=101). Only runs while the display is open.
*
* Arguments:
* 0: The RscDisplayChannel Display <DISPLAY>
*
* Return Value:
* Nothing
*
* Example:
* onLoad = QUOTE(_this call FUNC(onLoadRscDisplayChannel));
*
* Public: No
*/
#include "script_component.hpp"
uiNamespace setVariable [QGVAR(currentChannelControl), ((_this select 0) displayCtrl 101)];
["ACE_currentChannel", "onEachFrame", {
if (isNull (uiNamespace getVariable [QGVAR(currentChannelControl), controlNull])) then {
["ACE_currentChannel", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
} else {
private "_localizedChannelText";
_localizedChannelText = ctrlText (uiNamespace getVariable [QGVAR(currentChannelControl), controlNull]);
uiNamespace setVariable [QGVAR(currentChannel), _localizedChannelText];
};
}] call BIS_fnc_addStackedEventhandler;

View File

@ -18,30 +18,30 @@ _type = [_this, 3, 0,[0]] call BIS_fnc_Param;
_parameters = [_this, 4, [], [[]]] call BIS_fnc_Param;
if (isPlayer _reciever) then {
if (!local _reciever) then {
[_this, QUOTE(FUNC(sendDisplayInformationTo)), _reciever, false] call EFUNC(common,execRemoteFnc);
} else {
if (isLocalized _title) then {
_title = localize _title;
};
_localizationArray = [_title];
{
_localizationArray pushback _x;
}foreach _parameters;
_title = format _localizationArray;
if (!local _reciever) then {
[_this, QUOTE(FUNC(sendDisplayInformationTo)), _reciever, false] call EFUNC(common,execRemoteFnc);
} else {
if (isLocalized _title) then {
_title = localize _title;
};
_localizationArray = [_title];
{
_localizationArray pushback _x;
}foreach _parameters;
_title = format _localizationArray;
{
if (isLocalized _x) then {
_localizationArray = [localize _x];
{
_localizationArray pushback _x;
}foreach _parameters;
{
if (isLocalized _x) then {
_localizationArray = [localize _x];
{
_localizationArray pushback _x;
}foreach _parameters;
_content set [_foreachIndex, format _localizationArray];
};
_content set [_foreachIndex, format _localizationArray];
};
}foreach _content;
}foreach _content;
[_title,_content,_type] call EFUNC(common,displayInformation);
};
[_title,_content,_type] call EFUNC(common,displayInformation);
};
};

View File

@ -18,29 +18,29 @@ _type = [_this, 3, 0,[0]] call BIS_fnc_Param;
_parameters = [_this, 4, [], [[]]] call BIS_fnc_Param;
if (isPlayer _reciever) then {
if (!local _reciever) then {
[_this, QUOTE(FUNC(sendDisplayMessageTo)), _reciever, false] call EFUNC(common,execRemoteFnc);
} else {
if (!local _reciever) then {
[_this, QUOTE(FUNC(sendDisplayMessageTo)), _reciever, false] call EFUNC(common,execRemoteFnc);
} else {
if (isLocalized _title) then {
_title = localize _title;
};
if (isLocalized _content) then {
_content = localize _content;
};
if (isLocalized _title) then {
_title = localize _title;
};
if (isLocalized _content) then {
_content = localize _content;
};
_localizationArray = [_title];
{
_localizationArray pushback _x;
}foreach _parameters;
_title = format _localizationArray;
_localizationArray = [_title];
{
_localizationArray pushback _x;
}foreach _parameters;
_title = format _localizationArray;
_localizationArray = [_content];
{
_localizationArray pushback _x;
}foreach _parameters;
_content = format _localizationArray;
_localizationArray = [_content];
{
_localizationArray pushback _x;
}foreach _parameters;
_content = format _localizationArray;
[_title,_content,_type] call EFUNC(common,displayMessage);
};
[_title,_content,_type] call EFUNC(common,displayMessage);
};
};

View File

@ -16,6 +16,10 @@ private ["_eventName", "_eventArgs"];
_eventName = _this select 0;
_eventArgs = _this select 1;
#ifdef DEBUG_EVENTS
diag_log text format[ARR_2("* Server Event: %1",_eventName)];
diag_log text format[ARR_2(" args=%1",_eventArgs)];
#endif
ACEg = [_eventName, _eventArgs];
if(!isServer) then {

View File

@ -21,6 +21,11 @@ _eventName = _this select 0;
_eventTargets = _this select 1;
_eventArgs = _this select 2;
#ifdef DEBUG_EVENTS
diag_log text format[ARR_3("* Target Event: %1 - %2",_eventName,_eventTargets)];
diag_log text format[ARR_2(" args=%1",_eventArgs)];
#endif
ACEc = [_eventName, _eventTargets, _eventArgs];
if(!isServer) then {
publicVariableServer "ACEc";

View File

@ -1,13 +1,13 @@
#include "\z\ace\addons\common\script_component.hpp"
#define VALIDHASH(hash) (IS_ARRAY(hash) && {(count hash) >= 2} && {IS_ARRAY(hash select 0)} && {IS_ARRAY(hash select 1)})
#define ERROR(msg) throw msg + format[" @ %1:%2", _callFrom, _lineNo]
#define HANDLECATCH diag_log text _exception; assert(exception=="")
#define VALIDHASH(hash) (IS_ARRAY(hash) && {(count hash) >= 2} && {IS_ARRAY(hash select 0)} && {IS_ARRAY(hash select 1)})
#define ERROR(msg) throw msg + format[" @ %1:%2", _callFrom, _lineNo]
#define HANDLECATCH diag_log text _exception; assert(exception=="")
#define ERRORDATA(c) private ["_callFrom", "_lineNo"];\
_callFrom = "";\
_lineNo = -1;\
if((count _this) > c) then {\
_callFrom = _this select c;\
_lineNo = _this select c+1;\
};
#define ERRORDATA(c) private ["_callFrom", "_lineNo"];\
_callFrom = "";\
_lineNo = -1;\
if((count _this) > c) then {\
_callFrom = _this select c;\
_lineNo = _this select c+1;\
};

View File

@ -81,7 +81,7 @@ if (!isServer) then {
_index = _files find _x;
if (_index == -1) then {
_missingAddons pushBack _x;
if (_x != "ace_serverconfig") then {_missingAddons pushBack _x;};
} else {
_clientVersion = _versions select _index;

View File

@ -1,351 +1,349 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-16 -->
<!-- Edited with tabler - 2015-04-06 -->
<Project name="ACE">
<Package name="Common">
<Key ID="STR_ACE_Common_ACETeam">
<English>ACE-Team</English>
<German>ACE-Team</German>
<Spanish>ACE-Team</Spanish>
<Polish>ACE-Team</Polish>
<Czech>ACE-Team</Czech>
<French>ACE-Team</French>
<Russian>Команда ACE</Russian>
<Portuguese>ACE-Team</Portuguese>
<Hungarian>ACE-Team</Hungarian>
<Italian>ACE-Team</Italian>
</Key>
<Key ID="STR_ACE_Common_Save">
<English>Save</English>
<German>Speichern</German>
<Spanish>Guardar</Spanish>
<Polish>Zapisz</Polish>
<Czech>Uložit</Czech>
<French>Sauvegarder</French>
<Russian>Сохранить</Russian>
<Portuguese>Salvar</Portuguese>
<Hungarian>Mentés</Hungarian>
<Italian>Salva</Italian>
</Key>
<Key ID="STR_ACE_Common_Cancel">
<English>Cancel</English>
<German>Abbrechen</German>
<Spanish>Cancelar</Spanish>
<Polish>Anuluj</Polish>
<Czech>Zrušit</Czech>
<French>Annuler</French>
<Russian>Отмена</Russian>
<Portuguese>Cancelar</Portuguese>
<Hungarian>Mégse</Hungarian>
<Italian>Annulla</Italian>
</Key>
<Key ID="STR_ACE_Common_Options">
<English>ACE Options</English>
<German>ACE Optionen</German>
<Spanish>Opciones ACE</Spanish>
<Polish>Opcje ACE</Polish>
<Czech>ACE Nastavení</Czech>
<French>ACE Options</French>
<Russian>ACE Настройки</Russian>
<Portuguese>Opções do ACE</Portuguese>
<Hungarian>ACE Opciók</Hungarian>
<Italian>Opzioni ACE</Italian>
</Key>
<!-- These are cardinal directions, in case you didn't guess. -->
<Key ID="STR_ACE_Common_N">
<English>N</English>
<German>N</German>
<Spanish>N</Spanish>
<Polish>N</Polish>
<Czech>S</Czech>
<French>N</French>
<Russian>С</Russian>
<Portuguese>N</Portuguese>
<Hungarian>É</Hungarian>
<Italian>N</Italian>
</Key>
<Key ID="STR_ACE_Common_NNE">
<English>NNE</English>
<German>NNO</German>
<Spanish>NNE</Spanish>
<Polish>NNE</Polish>
<Czech>SSV</Czech>
<French>NNE</French>
<Russian>ССВ</Russian>
<Portuguese>NNE</Portuguese>
<Hungarian>ÉÉK</Hungarian>
<Italian>NNE</Italian>
</Key>
<Key ID="STR_ACE_Common_NE">
<English>NE</English>
<German>NO</German>
<Spanish>NE</Spanish>
<Polish>NE</Polish>
<Czech>SV</Czech>
<French>NE</French>
<Russian>СВ</Russian>
<Portuguese>NE</Portuguese>
<Hungarian>ÉK</Hungarian>
<Italian>NE</Italian>
</Key>
<Key ID="STR_ACE_Common_ENE">
<English>ENE</English>
<German>ONO</German>
<Spanish>ENE</Spanish>
<Polish>ENE</Polish>
<Czech>VSV</Czech>
<French>ENE</French>
<Russian>ВСВ</Russian>
<Portuguese>LNE</Portuguese>
<Hungarian>KÉK</Hungarian>
<Italian>ENE</Italian>
</Key>
<Key ID="STR_ACE_Common_E">
<English>E</English>
<German>O</German>
<Spanish>E</Spanish>
<Polish>E</Polish>
<Czech>V</Czech>
<French>E</French>
<Russian>В</Russian>
<Portuguese>L</Portuguese>
<Hungarian>K</Hungarian>
<Italian>E</Italian>
</Key>
<Key ID="STR_ACE_Common_ESE">
<English>ESE</English>
<German>OSO</German>
<Spanish>ESE</Spanish>
<Polish>ESE</Polish>
<Czech>VJV</Czech>
<French>ESE</French>
<Russian>ВЮВ</Russian>
<Portuguese>LSE</Portuguese>
<Hungarian>KDK</Hungarian>
<Italian>ESE</Italian>
</Key>
<Key ID="STR_ACE_Common_SE">
<English>SE</English>
<German>SO</German>
<Spanish>SE</Spanish>
<Polish>SE</Polish>
<Czech>JV</Czech>
<French>SE</French>
<Russian>ЮВ</Russian>
<Portuguese>SE</Portuguese>
<Hungarian>DK</Hungarian>
<Italian>SE</Italian>
</Key>
<Key ID="STR_ACE_Common_SSE">
<English>SSE</English>
<German>SSO</German>
<Spanish>SSE</Spanish>
<Polish>SSE</Polish>
<Czech>JJV</Czech>
<French>SSE</French>
<Russian>ЮЮВ</Russian>
<Portuguese>SSE</Portuguese>
<Hungarian>DDK</Hungarian>
<Italian>SSE</Italian>
</Key>
<Key ID="STR_ACE_Common_S">
<English>S</English>
<German>S</German>
<Spanish>S</Spanish>
<Polish>S</Polish>
<Czech>J</Czech>
<French>S</French>
<Russian>Ю</Russian>
<Portuguese>S</Portuguese>
<Hungarian>D</Hungarian>
<Italian>S</Italian>
</Key>
<Key ID="STR_ACE_Common_SSW">
<English>SSW</English>
<German>SSW</German>
<Spanish>SSO</Spanish>
<Polish>SSW</Polish>
<Czech>JJZ</Czech>
<French>SSO</French>
<Russian>ЮЮЗ</Russian>
<Portuguese>SSO</Portuguese>
<Hungarian>DDNy</Hungarian>
<Italian>SSO</Italian>
</Key>
<Key ID="STR_ACE_Common_SW">
<English>SW</English>
<German>SW</German>
<Spanish>SO</Spanish>
<Polish>SW</Polish>
<Czech>JZ</Czech>
<French>SO</French>
<Russian>ЮЗ</Russian>
<Portuguese>SO</Portuguese>
<Hungarian>DNy</Hungarian>
<Italian>SO</Italian>
</Key>
<Key ID="STR_ACE_Common_WSW">
<English>WSW</English>
<German>WSW</German>
<Spanish>OSO</Spanish>
<Polish>WSW</Polish>
<Czech>ZJZ</Czech>
<French>OSO</French>
<Russian>ЗЮЗ</Russian>
<Portuguese>OSO</Portuguese>
<Hungarian>NyDNy</Hungarian>
<Italian>OSO</Italian>
</Key>
<Key ID="STR_ACE_Common_W">
<English>W</English>
<German>W</German>
<Spanish>O</Spanish>
<Polish>W</Polish>
<Czech>Z</Czech>
<French>O</French>
<Russian>З</Russian>
<Portuguese>O</Portuguese>
<Hungarian>Ny</Hungarian>
<Italian>O</Italian>
</Key>
<Key ID="STR_ACE_Common_WNW">
<English>WNW</English>
<German>WNW</German>
<Spanish>ONO</Spanish>
<Polish>WNW</Polish>
<Czech>ZSZ</Czech>
<French>ONO</French>
<Russian>ЗСЗ</Russian>
<Portuguese>ONO</Portuguese>
<Hungarian>NyÉNy</Hungarian>
<Italian>ONO</Italian>
</Key>
<Key ID="STR_ACE_Common_NW">
<English>NW</English>
<German>NW</German>
<Spanish>NO</Spanish>
<Polish>NW</Polish>
<Czech>SZ</Czech>
<French>NO</French>
<Russian>СЗ</Russian>
<Portuguese>NO</Portuguese>
<Hungarian>ÉNy</Hungarian>
<Italian>NO</Italian>
</Key>
<Key ID="STR_ACE_Common_NNW">
<English>NNW</English>
<German>NNW</German>
<Spanish>NNO</Spanish>
<Polish>NNW</Polish>
<Czech>SSZ</Czech>
<French>NNO</French>
<Russian>ССЗ</Russian>
<Portuguese>NNO</Portuguese>
<Hungarian>ÉÉNy</Hungarian>
<Italian>NNO</Italian>
</Key>
<Key ID="STR_ACE_Common_ActionAborted">
<English>Action cancelled.</English>
<German>Aktion abgebrochen.</German>
<Spanish>Acción cancelada.</Spanish>
<Polish>Przerwano czynność</Polish>
<Czech>Akce přerušena</Czech>
<French>Action annulée.</French>
<Russian>Действие отменено.</Russian>
<Portuguese>Ação cancelada.</Portuguese>
<Hungarian>Művelet megszakítva.</Hungarian>
<Italian>Azione cancellata.</Italian>
</Key>
<Key ID="STR_ACE_Common_MiscItems">
<English>[ACE] Miscellaneous Items</English>
<German>[ACE] Verschiedenes</German>
<Spanish>[ACE] Objetos varios</Spanish>
<Polish>[ACE] Różne przedmioty</Polish>
<Czech>[ACE] Ostatní předměty</Czech>
<French>[ACE] Objets divers</French>
<Russian>[ACE] Различные предметы</Russian>
<Portuguese>[ACE] Itens diversos</Portuguese>
<Hungarian>[ACE] Egyéb tárgyak</Hungarian>
<Italian>[ACE] Oggetti vari</Italian>
</Key>
<Key ID="STR_ACE_Common_EnableNumberHotkeys">
<English>Disable Command Menu</English>
<German>Befehlsmenü ausschalten</German>
<Spanish>Desactivar menú de mando</Spanish>
<Polish>Wyłącz menu dowodzenia</Polish>
<Czech>Vypnout velící menu</Czech>
<French>Désactiver Menu Commande</French>
<Russian>Выключить командное меню</Russian>
<Hungarian>Parancsnoki menü kikapcsolása</Hungarian>
</Key>
<Key ID="STR_ACE_Common_Unknown">
<English>Unknown</English>
<German>Unbekannt</German>
<Spanish>Desconocido</Spanish>
<Polish>Nieznany</Polish>
<Czech>Neznámý</Czech>
<Russian>Неизвестно</Russian>
<Hungarian>Ismeretlen</Hungarian>
</Key>
<Key ID="STR_ACE_Common_NoVoice">
<English>No Voice</English>
<German>Keine Stimme</German>
<Spanish>Sin voz</Spanish>
<Polish>Brak głosu</Polish>
<Czech>Žádný hlas</Czech>
<Russian>Без голоса</Russian>
<Hungarian>Nincs hang</Hungarian>
</Key>
<Key ID="STR_ACE_ACTION_ACCEPT_REQUEST_KEY_TITLE">
<Original>Accept Requests</Original>
<Polish>Akceptuj prośby</Polish>
<Spanish>Aceptar Peticiones</Spanish>
</Key>
<Key ID="STR_ACE_ACTION_DECLINE_REQUEST_KEY_TITLE">
<Original>Decline Requests</Original>
<Polish>Ignoruj prośby</Polish>
<Spanish>Rechazar Peticiones</Spanish>
</Key>
<Key ID="STR_ACE_ACTION_ACCEPT_REQUEST_KEY_TOOLTIP">
<Original>Accept Requests send by other players. These can be requests to use / share equipment, perform certain actions.</Original>
<Polish>Akceptuj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności.</Polish>
<Spanish>Acepta Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones.</Spanish>
</Key>
<Key ID="STR_ACE_ACTION_DECLINE_REQUEST_KEY_TOOLTIP">
<Original>Decline Requests send by other players. These can be requests to use / share equipment, perform certain actions.</Original>
<Polish>Ignoruj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności.</Polish>
<Spanish>Rechazar Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones.</Spanish>
</Key>
<Key ID="STR_ACE_Common_SettingFeedbackIconsName">
<English>Feedback icons</English>
</Key>
<Key ID="STR_ACE_Common_SettingFeedbackIconsDesc">
<English>Select the position of or disable the feedback icons on your screen. These icons will show to provide extra feedback on your character status and actions performed.</English>
</Key>
<Key ID="STR_ACE_Common_SettingProgressbarLocationName">
<English>Progress bar location</English>
</Key>
<Key ID="STR_ACE_Common_SettingProgressbarLocationDesc">
<English>Set the desired location of the progress bar on your screen.</English>
</Key>
<Key ID="STR_ACE_Common_SettingDisplayTextColorName">
<English>Hint Background color</English>
</Key>
<Key ID="STR_ACE_Common_SettingDisplayTextColorDesc">
<English>The color of the background from the ACE hints.</English>
</Key>
<Key ID="STR_ACE_Common_SettingDisplayTextFontColorName">
<English>Hint text font color</English>
</Key>
<Key ID="STR_ACE_Common_SettingDisplayTextFontColorDesc">
<English>The color of the text font from the ACE hints. This color is the default color for all text displayed through the ACE Hint system, if the hint text has no other color specified.</English>
</Key>
<Key ID="STR_ACE_Common_bananaDisplayName">
<English>Banana</English>
</Key>
<Key ID="STR_ACE_Common_bananaDescr">
<English>A banana is an edible fruit, botanically a berry, produced by several kinds of large herbaceous flowering plants in the genus Musa.</English>
</Key>
</Package>
<Package name="Common">
<Key ID="STR_ACE_Common_ACETeam">
<English>ACE-Team</English>
<German>ACE-Team</German>
<Spanish>ACE-Team</Spanish>
<Polish>ACE-Team</Polish>
<Czech>ACE-Team</Czech>
<French>ACE-Team</French>
<Russian>Команда ACE</Russian>
<Portuguese>ACE-Team</Portuguese>
<Hungarian>ACE-Team</Hungarian>
<Italian>ACE-Team</Italian>
</Key>
<Key ID="STR_ACE_Common_Save">
<English>Save</English>
<German>Speichern</German>
<Spanish>Guardar</Spanish>
<Polish>Zapisz</Polish>
<Czech>Uložit</Czech>
<French>Sauvegarder</French>
<Russian>Сохранить</Russian>
<Portuguese>Salvar</Portuguese>
<Hungarian>Mentés</Hungarian>
<Italian>Salva</Italian>
</Key>
<Key ID="STR_ACE_Common_Cancel">
<English>Cancel</English>
<German>Abbrechen</German>
<Spanish>Cancelar</Spanish>
<Polish>Anuluj</Polish>
<Czech>Zrušit</Czech>
<French>Annuler</French>
<Russian>Отмена</Russian>
<Portuguese>Cancelar</Portuguese>
<Hungarian>Mégse</Hungarian>
<Italian>Annulla</Italian>
</Key>
<Key ID="STR_ACE_Common_Options">
<English>ACE Options</English>
<German>ACE Optionen</German>
<Spanish>Opciones ACE</Spanish>
<Polish>Opcje ACE</Polish>
<Czech>ACE Nastavení</Czech>
<French>ACE Options</French>
<Russian>ACE Настройки</Russian>
<Portuguese>Opções do ACE</Portuguese>
<Hungarian>ACE Opciók</Hungarian>
<Italian>Opzioni ACE</Italian>
</Key>
<!-- These are cardinal directions, in case you didn't guess. -->
<Key ID="STR_ACE_Common_N">
<English>N</English>
<German>N</German>
<Spanish>N</Spanish>
<Polish>N</Polish>
<Czech>S</Czech>
<French>N</French>
<Russian>С</Russian>
<Portuguese>N</Portuguese>
<Hungarian>É</Hungarian>
<Italian>N</Italian>
</Key>
<Key ID="STR_ACE_Common_NNE">
<English>NNE</English>
<German>NNO</German>
<Spanish>NNE</Spanish>
<Polish>NNE</Polish>
<Czech>SSV</Czech>
<French>NNE</French>
<Russian>ССВ</Russian>
<Portuguese>NNE</Portuguese>
<Hungarian>ÉÉK</Hungarian>
<Italian>NNE</Italian>
</Key>
<Key ID="STR_ACE_Common_NE">
<English>NE</English>
<German>NO</German>
<Spanish>NE</Spanish>
<Polish>NE</Polish>
<Czech>SV</Czech>
<French>NE</French>
<Russian>СВ</Russian>
<Portuguese>NE</Portuguese>
<Hungarian>ÉK</Hungarian>
<Italian>NE</Italian>
</Key>
<Key ID="STR_ACE_Common_ENE">
<English>ENE</English>
<German>ONO</German>
<Spanish>ENE</Spanish>
<Polish>ENE</Polish>
<Czech>VSV</Czech>
<French>ENE</French>
<Russian>ВСВ</Russian>
<Portuguese>LNE</Portuguese>
<Hungarian>KÉK</Hungarian>
<Italian>ENE</Italian>
</Key>
<Key ID="STR_ACE_Common_E">
<English>E</English>
<German>O</German>
<Spanish>E</Spanish>
<Polish>E</Polish>
<Czech>V</Czech>
<French>E</French>
<Russian>В</Russian>
<Portuguese>L</Portuguese>
<Hungarian>K</Hungarian>
<Italian>E</Italian>
</Key>
<Key ID="STR_ACE_Common_ESE">
<English>ESE</English>
<German>OSO</German>
<Spanish>ESE</Spanish>
<Polish>ESE</Polish>
<Czech>VJV</Czech>
<French>ESE</French>
<Russian>ВЮВ</Russian>
<Portuguese>LSE</Portuguese>
<Hungarian>KDK</Hungarian>
<Italian>ESE</Italian>
</Key>
<Key ID="STR_ACE_Common_SE">
<English>SE</English>
<German>SO</German>
<Spanish>SE</Spanish>
<Polish>SE</Polish>
<Czech>JV</Czech>
<French>SE</French>
<Russian>ЮВ</Russian>
<Portuguese>SE</Portuguese>
<Hungarian>DK</Hungarian>
<Italian>SE</Italian>
</Key>
<Key ID="STR_ACE_Common_SSE">
<English>SSE</English>
<German>SSO</German>
<Spanish>SSE</Spanish>
<Polish>SSE</Polish>
<Czech>JJV</Czech>
<French>SSE</French>
<Russian>ЮЮВ</Russian>
<Portuguese>SSE</Portuguese>
<Hungarian>DDK</Hungarian>
<Italian>SSE</Italian>
</Key>
<Key ID="STR_ACE_Common_S">
<English>S</English>
<German>S</German>
<Spanish>S</Spanish>
<Polish>S</Polish>
<Czech>J</Czech>
<French>S</French>
<Russian>Ю</Russian>
<Portuguese>S</Portuguese>
<Hungarian>D</Hungarian>
<Italian>S</Italian>
</Key>
<Key ID="STR_ACE_Common_SSW">
<English>SSW</English>
<German>SSW</German>
<Spanish>SSO</Spanish>
<Polish>SSW</Polish>
<Czech>JJZ</Czech>
<French>SSO</French>
<Russian>ЮЮЗ</Russian>
<Portuguese>SSO</Portuguese>
<Hungarian>DDNy</Hungarian>
<Italian>SSO</Italian>
</Key>
<Key ID="STR_ACE_Common_SW">
<English>SW</English>
<German>SW</German>
<Spanish>SO</Spanish>
<Polish>SW</Polish>
<Czech>JZ</Czech>
<French>SO</French>
<Russian>ЮЗ</Russian>
<Portuguese>SO</Portuguese>
<Hungarian>DNy</Hungarian>
<Italian>SO</Italian>
</Key>
<Key ID="STR_ACE_Common_WSW">
<English>WSW</English>
<German>WSW</German>
<Spanish>OSO</Spanish>
<Polish>WSW</Polish>
<Czech>ZJZ</Czech>
<French>OSO</French>
<Russian>ЗЮЗ</Russian>
<Portuguese>OSO</Portuguese>
<Hungarian>NyDNy</Hungarian>
<Italian>OSO</Italian>
</Key>
<Key ID="STR_ACE_Common_W">
<English>W</English>
<German>W</German>
<Spanish>O</Spanish>
<Polish>W</Polish>
<Czech>Z</Czech>
<French>O</French>
<Russian>З</Russian>
<Portuguese>O</Portuguese>
<Hungarian>Ny</Hungarian>
<Italian>O</Italian>
</Key>
<Key ID="STR_ACE_Common_WNW">
<English>WNW</English>
<German>WNW</German>
<Spanish>ONO</Spanish>
<Polish>WNW</Polish>
<Czech>ZSZ</Czech>
<French>ONO</French>
<Russian>ЗСЗ</Russian>
<Portuguese>ONO</Portuguese>
<Hungarian>NyÉNy</Hungarian>
<Italian>ONO</Italian>
</Key>
<Key ID="STR_ACE_Common_NW">
<English>NW</English>
<German>NW</German>
<Spanish>NO</Spanish>
<Polish>NW</Polish>
<Czech>SZ</Czech>
<French>NO</French>
<Russian>СЗ</Russian>
<Portuguese>NO</Portuguese>
<Hungarian>ÉNy</Hungarian>
<Italian>NO</Italian>
</Key>
<Key ID="STR_ACE_Common_NNW">
<English>NNW</English>
<German>NNW</German>
<Spanish>NNO</Spanish>
<Polish>NNW</Polish>
<Czech>SSZ</Czech>
<French>NNO</French>
<Russian>ССЗ</Russian>
<Portuguese>NNO</Portuguese>
<Hungarian>ÉÉNy</Hungarian>
<Italian>NNO</Italian>
</Key>
<Key ID="STR_ACE_Common_ActionAborted">
<English>Action cancelled.</English>
<German>Aktion abgebrochen.</German>
<Spanish>Acción cancelada.</Spanish>
<Polish>Przerwano czynność</Polish>
<Czech>Akce přerušena</Czech>
<French>Action annulée.</French>
<Russian>Действие отменено.</Russian>
<Portuguese>Ação cancelada.</Portuguese>
<Hungarian>Művelet megszakítva.</Hungarian>
<Italian>Azione cancellata.</Italian>
</Key>
<Key ID="STR_ACE_Common_MiscItems">
<English>[ACE] Miscellaneous Items</English>
<German>[ACE] Verschiedenes</German>
<Spanish>[ACE] Objetos varios</Spanish>
<Polish>[ACE] Różne przedmioty</Polish>
<Czech>[ACE] Ostatní předměty</Czech>
<French>[ACE] Objets divers</French>
<Russian>[ACE] Различные предметы</Russian>
<Portuguese>[ACE] Itens diversos</Portuguese>
<Hungarian>[ACE] Egyéb tárgyak</Hungarian>
<Italian>[ACE] Oggetti vari</Italian>
</Key>
<Key ID="STR_ACE_Common_EnableNumberHotkeys">
<English>Disable Command Menu</English>
<German>Befehlsmenü ausschalten</German>
<Spanish>Desactivar menú de mando</Spanish>
<Polish>Wyłącz menu dowodzenia</Polish>
<Czech>Vypnout velící menu</Czech>
<French>Désactiver Menu Commande</French>
<Russian>Выключить командное меню</Russian>
<Hungarian>Parancsnoki menü kikapcsolása</Hungarian>
</Key>
<Key ID="STR_ACE_Common_Unknown">
<English>Unknown</English>
<German>Unbekannt</German>
<Spanish>Desconocido</Spanish>
<Polish>Nieznany</Polish>
<Czech>Neznámý</Czech>
<Russian>Неизвестно</Russian>
<Hungarian>Ismeretlen</Hungarian>
</Key>
<Key ID="STR_ACE_Common_NoVoice">
<English>No Voice</English>
<German>Keine Stimme</German>
<Spanish>Sin voz</Spanish>
<Polish>Brak głosu</Polish>
<Czech>Žádný hlas</Czech>
<Russian>Без голоса</Russian>
<Hungarian>Nincs hang</Hungarian>
</Key>
<Key ID="STR_ACE_ACTION_ACCEPT_REQUEST_KEY_TITLE">
<Polish>Akceptuj prośby</Polish>
<Spanish>Aceptar Peticiones</Spanish>
<English>Accept Requests</English>
</Key>
<Key ID="STR_ACE_ACTION_DECLINE_REQUEST_KEY_TITLE">
<Polish>Ignoruj prośby</Polish>
<Spanish>Rechazar Peticiones</Spanish>
<English>Decline Requests</English>
</Key>
<Key ID="STR_ACE_ACTION_ACCEPT_REQUEST_KEY_TOOLTIP">
<Polish>Akceptuj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności.</Polish>
<Spanish>Acepta Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones.</Spanish>
<English>Accept Requests send by other players. These can be requests to use / share equipment, perform certain actions.</English>
</Key>
<Key ID="STR_ACE_ACTION_DECLINE_REQUEST_KEY_TOOLTIP">
<Polish>Ignoruj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności.</Polish>
<Spanish>Rechazar Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones.</Spanish>
<English>Decline Requests send by other players. These can be requests to use / share equipment, perform certain actions.</English>
</Key>
<Key ID="STR_ACE_Common_SettingFeedbackIconsName">
<English>Feedback icons</English>
</Key>
<Key ID="STR_ACE_Common_SettingFeedbackIconsDesc">
<English>Select the position of or disable the feedback icons on your screen. These icons will show to provide extra feedback on your character status and actions performed.</English>
</Key>
<Key ID="STR_ACE_Common_SettingProgressbarLocationName">
<English>Progress bar location</English>
</Key>
<Key ID="STR_ACE_Common_SettingProgressbarLocationDesc">
<English>Set the desired location of the progress bar on your screen.</English>
</Key>
<Key ID="STR_ACE_Common_SettingDisplayTextColorName">
<English>Hint Background color</English>
</Key>
<Key ID="STR_ACE_Common_SettingDisplayTextColorDesc">
<English>The color of the background from the ACE hints.</English>
</Key>
<Key ID="STR_ACE_Common_SettingDisplayTextFontColorName">
<English>Hint text font color</English>
</Key>
<Key ID="STR_ACE_Common_SettingDisplayTextFontColorDesc">
<English>The color of the text font from the ACE hints. This color is the default color for all text displayed through the ACE Hint system, if the hint text has no other color specified.</English>
</Key>
<Key ID="STR_ACE_Common_bananaDisplayName">
<English>Banana</English>
</Key>
<Key ID="STR_ACE_Common_bananaDescr">
<English>A banana is an edible fruit, botanically a berry, produced by several kinds of large herbaceous flowering plants in the genus Musa.</English>
</Key>
</Package>
</Project>

View File

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

View File

@ -23,11 +23,6 @@ class Extended_Init_EventHandlers {
init = QUOTE(_this call DFUNC(initObject));
};
};
class StaticMortar {
class ADDON {
init = QUOTE(_this call DFUNC(initObject));
};
};
class ReammoBox_F {
class ADDON {
init = QUOTE(_this call DFUNC(initObject));

View File

@ -22,4 +22,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
// a static weapon has to be empty for dragging
if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false};
alive _target && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"]}
alive _target && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false])}

View File

@ -22,4 +22,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
// a static weapon has to be empty for dragging
if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false};
alive _target && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"]}
alive _target && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false])}

View File

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

View File

@ -14,8 +14,8 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
// drop if the crate is destroyed
if !([_target] call EFUNC(common,isAlive)) then {
// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
[_unit, _target] call FUNC(dropObject_carry);
[_this select 1] call CBA_fnc_removePerFrameHandler;
};

View File

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

View File

@ -14,8 +14,8 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
// drop if the crate is destroyed
if !([_target] call EFUNC(common,isAlive)) then {
// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
[_unit, _target] call FUNC(dropObject);
[_this select 1] call CBA_fnc_removePerFrameHandler;
};

View File

@ -1,20 +1,20 @@
/*
Name: AGM_Drag_fnc_GetWeight
Author(s):
L-H, edited by commy2
Name: AGM_Drag_fnc_GetWeight
Author(s):
L-H, edited by commy2
Description:
Returns the weight of a crate.
Parameters:
0: OBJECT - Crate to get weight of
Returns:
NUMBER - Weight
Example:
_weight = Crate1 call AGM_Drag_fnc_GetWeight;
Description:
Returns the weight of a crate.
Parameters:
0: OBJECT - Crate to get weight of
Returns:
NUMBER - Weight
Example:
_weight = Crate1 call AGM_Drag_fnc_GetWeight;
*/
#include "script_component.hpp"
@ -25,24 +25,24 @@ _object = _this select 0;
private ["_totalWeight", "_fnc","_fnc_Extra"];
_totalWeight = 0;
_fnc_Extra = {
private ["_weight", "_items"];
_items = _this select 0;
_weight = 0;
{
_weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> (_this select 2) >> "mass") * ((_items select 1) select _foreachIndex));
} foreach (_items select 0);
_weight
private ["_weight", "_items"];
_items = _this select 0;
_weight = 0;
{
_weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> (_this select 2) >> "mass") * ((_items select 1) select _foreachIndex));
} foreach (_items select 0);
_weight
};
_fnc = {
private ["_weight", "_items"];
_items = _this select 0;
_weight = 0;
{
_weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> "mass") * ((_items select 1) select _foreachIndex));
} foreach (_items select 0);
_weight
private ["_weight", "_items"];
_items = _this select 0;
_weight = 0;
{
_weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> "mass") * ((_items select 1) select _foreachIndex));
} foreach (_items select 0);
_weight
};
_totalWeight = ([getMagazineCargo _object, "CfgMagazines"] call _fnc);
_totalWeight = _totalWeight + ([getItemCargo _object, "CfgWeapons", "ItemInfo"] call _fnc_Extra);

View File

@ -22,8 +22,8 @@ if (_unit getVariable [QGVAR(isDragging), false]) then {
if (_unit getVariable [QGVAR(isCarrying), false]) then {
// drop carried object when not standing
if (stance _unit != "STAND") then {
// drop carried object when not standing; also some exceptions when picking up crate
if (stance _unit != "STAND" && {_anim != "amovpercmstpsnonwnondnon"}) then {
private "_carriedObject";
_carriedObject = _unit getVariable [QGVAR(carriedObject), objNull];

View File

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

View File

@ -56,11 +56,12 @@ if (_target isKindOf "CAManBase") then {
[_unit, "isDragging", true] call EFUNC(common,setforceWalkStatus);
// prevent multiple players from accessing the same object
[_unit, _target, true] call EFUNC(common,claim);
};
// prevent multiple players from accessing the same object
[_unit, _target, true] call EFUNC(common,claim);
// prevents draging and carrying at the same time
_unit setVariable [QGVAR(isCarrying), true, true];

View File

@ -16,8 +16,8 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
// same as dragObjectPFH, checks if object is deleted or dead.
if !([_target] call EFUNC(common,isAlive)) then {
// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled))
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
[_unit, _target] call FUNC(dropObject);
[_this select 1] call CBA_fnc_removePerFrameHandler;
};

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