mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' into explosiveInteraction
This commit is contained in:
commit
9c13a87d83
24
README.md
24
README.md
@ -1,21 +1,23 @@
|
||||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/KoffeinFlummi/ACE3/new-readme/extras/logo.png?token=ACU2mWeJUeshQIVc52XPoNiPpc3PzTauks5Uv24rwA%3D%3D" height="150px" /><br />
|
||||
<a href="https://github.com/KoffeinFlummi/ACE3/releases">
|
||||
<img src="http://img.shields.io/badge/release-3.0-green.svg?style=flat" alt="ACE version">
|
||||
</a>
|
||||
<img src="https://github.com/KoffeinFlummi/ACE3/blob/master/extras/assets/logo/black/ACE3-Logo.jpg" height="80" />
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://github.com/KoffeinFlummi/ACE3/releases">
|
||||
<img src="http://img.shields.io/badge/release-3.0-green.svg?style=flat" alt="ACE version">
|
||||
</a>
|
||||
<a href="#">
|
||||
<img src="http://img.shields.io/badge/download-22_MB-blue.svg?style=flat" alt="ACE download">
|
||||
</a>
|
||||
<img src="http://img.shields.io/badge/download-22_MB-blue.svg?style=flat" alt="ACE download">
|
||||
</a>
|
||||
<a href="https://github.com/KoffeinFlummi/ACE3/issues">
|
||||
<img src="http://img.shields.io/github/issues/KoffeinFlummi/ACE3.svg?style=flat" alt="ACE issues">
|
||||
</a>
|
||||
<img src="http://img.shields.io/github/issues/KoffeinFlummi/ACE3.svg?style=flat" alt="ACE issues">
|
||||
</a>
|
||||
<a href="https://github.com/KoffeinFlummi/ACE3/blob/master/LICENSE">
|
||||
<img src="http://img.shields.io/badge/license-GPLv2-red.svg?style=flat" alt="ACE license">
|
||||
</a>
|
||||
<img src="http://img.shields.io/badge/license-GPLv2-red.svg?style=flat" alt="ACE license">
|
||||
</a>
|
||||
</p>
|
||||
<p align="center"><sup><strong>Requires the latest version of <a href="http://www.armaholic.com/page.php?id=18767">CBA A3</a> | <a href="#">BIF thread</a></strong></sup></p>
|
||||
|
||||
**ACE 3** is a join effort by the teams behind **ACE 2**, **AGM** and **CSE** to improve the realism and authenticity of Arma 3.
|
||||
**ACE3** is a joint effort by the teams behind **ACE2**, **AGM** and **CSE** to improve the realism and authenticity of Arma 3.
|
||||
|
||||
This mod is entirely **open-source**, and everyone is free to propose changes or maintain their own, customized version as long as they make their changes open to the public in accordance with the GNU General Public License (for more information check the license file attached to this project).
|
||||
|
||||
|
BIN
TO_MERGE/agm/Optics/agm_optics_pip.p3d
Normal file
BIN
TO_MERGE/agm/Optics/agm_optics_pip.p3d
Normal file
Binary file not shown.
25
TO_MERGE/agm/Optics/clientInit.sqf
Normal file
25
TO_MERGE/agm/Optics/clientInit.sqf
Normal file
@ -0,0 +1,25 @@
|
||||
// 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};
|
||||
};
|
454
TO_MERGE/agm/Optics/config.cpp
Normal file
454
TO_MERGE/agm/Optics/config.cpp
Normal file
@ -0,0 +1,454 @@
|
||||
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 = "*";
|
||||
};
|
||||
};
|
||||
};
|
BIN
TO_MERGE/agm/Optics/data/arco/arco-bodyNight_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/arco/arco-bodyNight_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/arco/arco-body_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/arco/arco-body_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/arco/arco-reticle65Illum_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/arco/arco-reticle65Illum_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/arco/arco-reticle65_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/arco/arco-reticle65_ca.paa
Normal file
Binary file not shown.
8
TO_MERGE/agm/Optics/data/black.rvmat
Normal file
8
TO_MERGE/agm/Optics/data/black.rvmat
Normal file
@ -0,0 +1,8 @@
|
||||
ambient[]={0,0,0,0.89999998};
|
||||
diffuse[]={0,0,0,0.89999998};
|
||||
forcedDiffuse[]={0,0,0,1};
|
||||
emmisive[]={0,0,0,1};
|
||||
specular[]={0,0,0,0};
|
||||
specularPower=1;
|
||||
PixelShaderID="Normal";
|
||||
VertexShaderID="Basic";
|
20
TO_MERGE/agm/Optics/data/em.rvmat
Normal file
20
TO_MERGE/agm/Optics/data/em.rvmat
Normal file
@ -0,0 +1,20 @@
|
||||
ambient[]={1,1,1,1};
|
||||
diffuse[]={1,1,1,1};
|
||||
forcedDiffuse[]={0,0,0,0};
|
||||
emmisive[]={1,1,1,1};
|
||||
specular[]={1,0.99956858,1,1};
|
||||
specularPower=1;
|
||||
PixelShaderID="Normal";
|
||||
VertexShaderID="Basic";
|
||||
class Stage1
|
||||
{
|
||||
texture="#(argb,8,8,3)color(0.5,0.5,0.5,0.5,DT)";
|
||||
uvSource="tex";
|
||||
class uvTransform
|
||||
{
|
||||
aside[]={1,0,0};
|
||||
up[]={0,1,0};
|
||||
dir[]={0,0,0};
|
||||
pos[]={0,0,0};
|
||||
};
|
||||
};
|
BIN
TO_MERGE/agm/Optics/data/hamr/hamr-bodyNight_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/hamr/hamr-bodyNight_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/hamr/hamr-body_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/hamr/hamr-body_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/hamr/hamr-reticle65Illum_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/hamr/hamr-reticle65Illum_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/hamr/hamr-reticle65_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/hamr/hamr-reticle65_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/mrco/mrco-bodyNight_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/mrco/mrco-bodyNight_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/mrco/mrco-body_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/mrco/mrco-body_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/mrco/mrco-reticle556Illum_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/mrco/mrco-reticle556Illum_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/mrco/mrco-reticle556_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/mrco/mrco-reticle556_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/scopeblack-100_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/scopeblack-100_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/scopeblack-70_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/scopeblack-70_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/scopeblack-80_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/scopeblack-80_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/scopeblack-90_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/scopeblack-90_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/sos/sos-bodyNight_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/sos/sos-bodyNight_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/sos/sos-body_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/sos/sos-body_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/sos/sos-reticleMLRIllum_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/sos/sos-reticleMLRIllum_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/sos/sos-reticleMLR_ca.paa
Normal file
BIN
TO_MERGE/agm/Optics/data/sos/sos-reticleMLR_ca.paa
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/tmr_optics_reticle100.p3d
Normal file
BIN
TO_MERGE/agm/Optics/data/tmr_optics_reticle100.p3d
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/tmr_optics_reticle70.p3d
Normal file
BIN
TO_MERGE/agm/Optics/data/tmr_optics_reticle70.p3d
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/tmr_optics_reticle80.p3d
Normal file
BIN
TO_MERGE/agm/Optics/data/tmr_optics_reticle80.p3d
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/tmr_optics_reticle90.p3d
Normal file
BIN
TO_MERGE/agm/Optics/data/tmr_optics_reticle90.p3d
Normal file
Binary file not shown.
BIN
TO_MERGE/agm/Optics/data/tmr_reticle_clear.p3d
Normal file
BIN
TO_MERGE/agm/Optics/data/tmr_reticle_clear.p3d
Normal file
Binary file not shown.
149
TO_MERGE/agm/Optics/functions/fn_firedEH.sqf
Normal file
149
TO_MERGE/agm/Optics/functions/fn_firedEH.sqf
Normal file
@ -0,0 +1,149 @@
|
||||
/*
|
||||
* 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;
|
||||
};
|
19
TO_MERGE/agm/Optics/functions/fn_hideScope.sqf
Normal file
19
TO_MERGE/agm/Optics/functions/fn_hideScope.sqf
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* 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;
|
25
TO_MERGE/agm/Optics/functions/fn_initScope.sqf
Normal file
25
TO_MERGE/agm/Optics/functions/fn_initScope.sqf
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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
|
94
TO_MERGE/agm/Optics/functions/fn_mainLoop.sqf
Normal file
94
TO_MERGE/agm/Optics/functions/fn_mainLoop.sqf
Normal file
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* 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;
|
@ -6,7 +6,7 @@
|
||||
displayName = "$STR_ACE_Attach_AttachDetach"; \
|
||||
condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \
|
||||
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \
|
||||
exceptions[] = {"ACE_Drag_isNotDragging"}; \
|
||||
exceptions[] = {"isNotDragging"}; \
|
||||
showDisabled = 0; \
|
||||
priority = 0; \
|
||||
icon = PATHTOF(UI\attach_ca.paa); \
|
||||
@ -16,7 +16,7 @@
|
||||
displayName = "$STR_ACE_Attach_Detach"; \
|
||||
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \
|
||||
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \
|
||||
exceptions[] = {"ACE_Drag_isNotDragging"}; \
|
||||
exceptions[] = {"isNotDragging"}; \
|
||||
showDisabled = 0; \
|
||||
priority = 0; \
|
||||
icon = PATHTOF(UI\detach_ca.paa); \
|
||||
@ -57,7 +57,7 @@ class CfgVehicles {
|
||||
displayName = "$STR_ACE_Attach_AttachDetach";
|
||||
condition = QUOTE(([ARR_3(_player, _player, '')] call FUNC(canAttach)));
|
||||
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(openAttachUI); );
|
||||
exceptions[] = {"ACE_Drag_isNotDragging"};
|
||||
exceptions[] = {"isNotDragging"};
|
||||
showDisabled = 0;
|
||||
priority = 5;
|
||||
icon = PATHTOF(UI\attach_ca.paa);
|
||||
@ -67,7 +67,7 @@ class CfgVehicles {
|
||||
displayName = "$STR_ACE_Attach_Detach";
|
||||
condition = QUOTE(([ARR_2(_player, _player)] call FUNC(canDetach)));
|
||||
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(detach) );
|
||||
exceptions[] = {"ACE_Drag_isNotDragging"};
|
||||
exceptions[] = {"isNotDragging"};
|
||||
showDisabled = 0;
|
||||
priority = 5;
|
||||
icon = PATHTOF(UI\detach_ca.paa);
|
||||
|
@ -6,7 +6,7 @@ class CfgPatches {
|
||||
weapons[] = {"ACE_IR_Strobe_Item"};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_interaction"};
|
||||
author[] = {"KoffeinFlummi","eRazeri","CAA-Picard"};
|
||||
author[] = {"KoffeinFlummi","eRazeri","esteldunedain"};
|
||||
authorUrl = "https://github.com/KoffeinFlummi/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Author: eRazeri and CAA-Picard
|
||||
* Author: eRazeri and esteldunedain
|
||||
* Attach an item to the unit
|
||||
*
|
||||
* Arguments:
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Author: eRazeri and CAA-Picard
|
||||
* Author: eRazeri and esteldunedain
|
||||
* Detach an item from a unit
|
||||
*
|
||||
* Arguments:
|
||||
|
1
addons/backpacks/$PBOPREFIX$
Normal file
1
addons/backpacks/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\backpacks
|
@ -5,6 +5,12 @@ class Extended_PreInit_EventHandlers {
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_InventoryOpened_EventHandlers {
|
||||
class CAManBase {
|
||||
class GVAR(onOpenInventory) {
|
3
addons/backpacks/XEH_postInit.sqf
Normal file
3
addons/backpacks/XEH_postInit.sqf
Normal file
@ -0,0 +1,3 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
["backpackOpened", {_this call FUNC(backpackOpened)}] call EFUNC(common,addEventHandler);
|
@ -2,6 +2,7 @@
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(backpackOpened);
|
||||
PREP(getBackpackAssignedUnit);
|
||||
PREP(isBackpack);
|
||||
PREP(onOpenInventory);
|
@ -5,7 +5,7 @@ class CfgPatches {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common","ace_interaction"};
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"bux","commy2"};
|
||||
authorUrl = "https://github.com/commy2/";
|
||||
VERSION_CONFIG;
|
||||
@ -13,4 +13,3 @@ class CfgPatches {
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
51
addons/backpacks/functions/fnc_backpackOpened.sqf
Normal file
51
addons/backpacks/functions/fnc_backpackOpened.sqf
Normal file
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Someone opened your backpack. Execute locally.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Who accessed your inventory? (Object)
|
||||
* 1: Unit that wields the backpack (Object)
|
||||
* 2: The backpack object (Object)
|
||||
*
|
||||
* Return value:
|
||||
* None.
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_target"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_target = _this select 1;
|
||||
_backpack = _this select 2;
|
||||
|
||||
// do cam shake if the target is the player
|
||||
if ([_target] call EFUNC(common,isPlayer)) then {
|
||||
addCamShake [4, 0.5, 5];
|
||||
};
|
||||
|
||||
// play a rustling sound
|
||||
private ["_sounds", "_position"];
|
||||
|
||||
_sounds = [
|
||||
/*"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWpstDnon_medic.wss",
|
||||
"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWrflDnon_medic.wss",
|
||||
"a3\sounds_f\characters\ingame\AinvPpneMstpSlayWpstDnon_medic.wss",
|
||||
"a3\sounds_f\characters\ingame\AinvPpneMstpSlayWrflDnon_medic.wss"*/
|
||||
|
||||
QUOTE(PATHTO_R(sounds\zip_in.wav)),
|
||||
QUOTE(PATHTO_R(sounds\zip_out.wav))
|
||||
];
|
||||
|
||||
_position = _target modelToWorld (_target selectionPosition "Spine3");
|
||||
_position = _position call EFUNC(common,positionToASL);
|
||||
|
||||
playSound3D [
|
||||
_sounds select floor random count _sounds,
|
||||
objNull,
|
||||
false,
|
||||
_position,
|
||||
1,
|
||||
1,
|
||||
50
|
||||
];
|
30
addons/backpacks/functions/fnc_onOpenInventory.sqf
Normal file
30
addons/backpacks/functions/fnc_onOpenInventory.sqf
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Handle the open inventory event. Display message on traget client.
|
||||
*
|
||||
* Argument:
|
||||
* Input from "InventoryOpened" eventhandler
|
||||
*
|
||||
* Return value:
|
||||
* false. Always open the inventory dialog. (Bool)
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_backpack"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_backpack = _this select 1;
|
||||
|
||||
// exit if the target is not a backpack
|
||||
if !([_backpack] call FUNC(isBackpack)) exitWith {};
|
||||
|
||||
// get the unit that wears the backpack object
|
||||
private "_target";
|
||||
_target = [_backpack] call FUNC(getBackpackAssignedUnit);
|
||||
|
||||
// raise event on target unit
|
||||
["backpackOpened", _target, [_unit, _target, _backpack]] call EFUNC(common,targetEvent);
|
||||
|
||||
// return false to open inventory as usual
|
||||
false
|
1
addons/backpacks/functions/script_component.hpp
Normal file
1
addons/backpacks/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\backpacks\script_component.hpp"
|
12
addons/backpacks/script_component.hpp
Normal file
12
addons/backpacks/script_component.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
#define COMPONENT backpacks
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_BACKPACKS
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_ENABLED_BACKPACKS
|
||||
#define DEBUG_SETTINGS DEBUG_ENABLED_BACKPACKS
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
BIN
addons/backpacks/sounds/zip_in.wav
Normal file
BIN
addons/backpacks/sounds/zip_in.wav
Normal file
Binary file not shown.
BIN
addons/backpacks/sounds/zip_out.wav
Normal file
BIN
addons/backpacks/sounds/zip_out.wav
Normal file
Binary file not shown.
@ -1,41 +0,0 @@
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
@ -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;
|
||||
};
|
||||
};
|
@ -12,7 +12,5 @@ class CfgPatches {
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgAmmo.hpp"
|
||||
#include "CfgMagazines.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "CfgWeapons.hpp"
|
||||
|
@ -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));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -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 {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -39,7 +39,7 @@ class CfgVehicles {
|
||||
distance = 4;
|
||||
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canStopEscorting));
|
||||
statement = QUOTE([ARR_3(_player,_target, false)] call FUNC(doEscortCaptive));
|
||||
exceptions[] = {QGVAR(isNotEscorting)};
|
||||
exceptions[] = {"isNotEscorting"};
|
||||
showDisabled = 0;
|
||||
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
|
||||
priority = 2.3;
|
||||
@ -50,7 +50,7 @@ class CfgVehicles {
|
||||
distance = 4;
|
||||
condition = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(canLoadCaptive));
|
||||
statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(doLoadCaptive));
|
||||
exceptions[] = {QGVAR(isNotEscorting)};
|
||||
exceptions[] = {"isNotEscorting"};
|
||||
showDisabled = 0;
|
||||
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
|
||||
priority = 2.2;
|
||||
@ -74,7 +74,7 @@ class CfgVehicles {
|
||||
displayName = "$STR_ACE_Captives_StopEscorting";
|
||||
condition = QUOTE([ARR_2(_player, objNull)] call FUNC(canStopEscorting));
|
||||
statement = QUOTE([ARR_3(_player,objNull, false)] call FUNC(doEscortCaptive));
|
||||
exceptions[] = {QGVAR(isNotEscorting)};
|
||||
exceptions[] = {"isNotEscorting"};
|
||||
showDisabled = 0;
|
||||
priority = 2.3;
|
||||
hotkey = "C";
|
||||
@ -91,7 +91,7 @@ class CfgVehicles {
|
||||
displayName = "$STR_ACE_Captives_StopSurrendering";
|
||||
condition = QUOTE([ARR_2(_player, false)] call FUNC(canSurrender));
|
||||
statement = QUOTE([ARR_2(_player, false)] call FUNC(setSurrendered));
|
||||
exceptions[] = {QGVAR(isNotSurrendering)};
|
||||
exceptions[] = {"isNotSurrendering"};
|
||||
showDisabled = 0;
|
||||
priority = 0;
|
||||
};
|
||||
@ -107,7 +107,7 @@ class CfgVehicles {
|
||||
distance = 4; \
|
||||
condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \
|
||||
statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(doLoadCaptive)); \
|
||||
exceptions[] = {QGVAR(isNotEscorting)}; \
|
||||
exceptions[] = {"isNotEscorting"}; \
|
||||
showDisabled = 0; \
|
||||
priority = 1.2; \
|
||||
hotkey = "L"; \
|
||||
@ -154,15 +154,10 @@ class CfgVehicles {
|
||||
MACRO_LOADUNLOADCAPTIVE
|
||||
};
|
||||
|
||||
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
|
||||
name = #ITEM; \
|
||||
count = COUNT; \
|
||||
};
|
||||
|
||||
class Box_NATO_Support_F;
|
||||
class ACE_Box_Misc: Box_NATO_Support_F {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(ACE_CableTie,12)
|
||||
MACRO_ADDITEM(ACE_CableTie,12);
|
||||
};
|
||||
};
|
||||
|
||||
@ -183,7 +178,7 @@ class CfgVehicles {
|
||||
curatorCost = 0; //???
|
||||
isGlobal = 1; //run global
|
||||
isTriggerActivated = 1; //Wait for triggers
|
||||
// icon = QUOTE(PATHTOF(ui\todo.paa));
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Surrender_ca.paa));
|
||||
functionPriority = 0;
|
||||
class Arguments {};
|
||||
class ModuleDescription: ModuleDescription {
|
||||
|
BIN
addons/captives/UI/Icon_Module_Make_Unit_Surrender_ca.paa
Normal file
BIN
addons/captives/UI/Icon_Module_Make_Unit_Surrender_ca.paa
Normal file
Binary file not shown.
@ -27,12 +27,11 @@ if (isServer) then {
|
||||
["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler);
|
||||
["SetSurrendered", {_this call FUNC(setSurrendered)}] call EFUNC(common,addEventHandler);
|
||||
|
||||
//TODO: Medical Integration Events???
|
||||
//Medical Integration Events???
|
||||
["medical_onUnconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call EFUNC(common,addEventHandler);
|
||||
|
||||
// [_unit, "knockedOut", {
|
||||
// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleKnockedOut};
|
||||
// }] call ACE_Core_fnc_addCustomEventhandler;
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
// [_unit, "wokeUp", {
|
||||
// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleWokeUp};
|
||||
// }] call ACE_Core_fnc_addCustomEventhandler;
|
||||
["isNotEscorting", {!(GETVAR(_this select 0,GVAR(isEscorting),false))}] call EFUNC(common,addCanInteractWithCondition);
|
||||
["isNotHandcuffed", {!(GETVAR(_this select 0,GVAR(isHandcuffed),false))}] call EFUNC(common,addCanInteractWithCondition);
|
||||
["isNotSurrendering", {!(GETVAR(_this select 0,GVAR(isSurrendering),false))}] call EFUNC(common,addCanInteractWithCondition);
|
||||
|
@ -19,10 +19,10 @@ PREP(doUnloadCaptive);
|
||||
PREP(handleGetIn);
|
||||
PREP(handleGetOut);
|
||||
PREP(handleKilled);
|
||||
PREP(handleKnockedOut);
|
||||
PREP(handleOnUnconscious);
|
||||
PREP(handlePlayerChanged);
|
||||
PREP(handleRespawn);
|
||||
PREP(handleUnitInitPost);
|
||||
PREP(handleWokeUp);
|
||||
PREP(handleZeusDisplayChanged);
|
||||
PREP(moduleSurrender);
|
||||
PREP(setHandcuffed);
|
||||
|
@ -16,16 +16,3 @@ class CfgPatches {
|
||||
#include "CfgMoves.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "CfgWeapons.hpp"
|
||||
|
||||
|
||||
class ACE_canInteractConditions {
|
||||
class GVAR(isNotEscorting) {
|
||||
condition = QUOTE(!(GETVAR(player,QGVAR(isEscorting),false)));
|
||||
};
|
||||
class GVAR(isNotHandcuffed) {
|
||||
condition = QUOTE(!(GETVAR(player,QGVAR(isHandcuffed),false)));
|
||||
};
|
||||
class GVAR(isNotSurrendering) {
|
||||
condition = QUOTE(!(GETVAR(player,QGVAR(isSurrendering),false)));
|
||||
};
|
||||
};
|
||||
|
@ -51,7 +51,7 @@ if (_state) then {
|
||||
_unit setVariable [QGVAR(escortedUnit), objNull, true];
|
||||
};
|
||||
};
|
||||
[_escortFnc, 0.2, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler;
|
||||
[_escortFnc, 0, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
} else {
|
||||
_unit setVariable [QGVAR(isEscorting), false, true];
|
||||
|
@ -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);
|
||||
};
|
||||
|
@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Author: commy2, PabstMirror
|
||||
* Handles when a unit gets knocked out. Ends surrendering.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [bob, true] call ACE_captives_fnc_handleKnockedOut
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
||||
//ToDo: Waiting on medical integration
|
||||
|
||||
PARAMS_1(_unit);
|
||||
|
||||
if (_unit getVariable [QGVAR(isSurrendering), false]) then { //If surrendering, stop
|
||||
[_unit, false] call FUNC(setSurrendered);
|
||||
};
|
36
addons/captives/functions/fnc_handleOnUnconscious.sqf
Normal file
36
addons/captives/functions/fnc_handleOnUnconscious.sqf
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Author: commy2, PabstMirror
|
||||
* Handles the "medical_onUnconscious" event
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 0: Is Unconsisisiouses <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [bob, true] call ACE_captives_fnc_handleOnUnconscious
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_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 {
|
||||
[_unit, false] call FUNC(setSurrendered);
|
||||
};
|
||||
} else {
|
||||
//Woke up: if handcuffed, goto animation
|
||||
if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
|
||||
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
|
||||
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
|
||||
};
|
||||
};
|
39
addons/captives/functions/fnc_handleRespawn.sqf
Normal file
39
addons/captives/functions/fnc_handleRespawn.sqf
Normal 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);
|
||||
};
|
@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* TODO
|
||||
*
|
||||
* Arguments:
|
||||
* 0: _unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* The return value <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [bob] call ACE_captives_fnc_handleWokeUp
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_unit);
|
||||
|
||||
if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
|
||||
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
|
||||
[_unit, "ACE_AmovPercMstpScapWnonDnon", 0] call EFUNC(common,doAnimation);
|
||||
};
|
@ -52,7 +52,7 @@ if (_state) then {
|
||||
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
|
||||
_animChangedEHID = _unit addEventHandler ["AnimChanged", {
|
||||
PARAMS_2(_unit,_newAnimation);
|
||||
if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && (_newAnimation != "Unconscious")) then {
|
||||
if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
|
||||
ERROR("Handcuff animation interrupted");
|
||||
systemChat format ["debug %2: new %1", _newAnimation, time];
|
||||
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
|
||||
@ -71,8 +71,8 @@ if (_state) then {
|
||||
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
|
||||
_unit setVariable [QGVAR(handcuffAnimEHID), -1];
|
||||
|
||||
if ((vehicle _unit) == _unit) then {
|
||||
//Break out of hands up animation loop (doAnimation handles Unconscious prioity)
|
||||
if (((vehicle _unit) == _unit) && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
|
||||
//Break out of hands up animation loop
|
||||
[_unit, "ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
|
||||
};
|
||||
|
||||
|
@ -50,7 +50,7 @@ if (_state) then {
|
||||
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
|
||||
_animChangedEHID = _unit addEventHandler ["AnimChanged", {
|
||||
PARAMS_2(_unit,_newAnimation);
|
||||
if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && (_newAnimation != "Unconscious")) then {
|
||||
if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
|
||||
ERROR("Surrender animation interrupted");
|
||||
systemChat format ["debug %2: new %1", _newAnimation, time];
|
||||
[_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation);
|
||||
@ -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
|
||||
|
@ -1,5 +1,6 @@
|
||||
|
||||
class CfgActions {
|
||||
// fixes pick up action on mine detectors, because all ACE items are of that simulationClass and BI doesn't seem to care
|
||||
class None;
|
||||
class TakeWeapon: None {
|
||||
show = 0;
|
@ -42,19 +42,3 @@ class Extended_Respawn_EventHandlers {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Killed_EventHandlers {
|
||||
class CAManBase {
|
||||
class GVAR(dropObject) {
|
||||
Killed = QUOTE(if (local (_this select 0)) then {[ARR_2(_this select 0, ObjNull)] call FUNC(carryObj)};);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_GetIn_EventHandlers {
|
||||
class CAManBase {
|
||||
class GVAR(dropObject) {
|
||||
GetIn = QUOTE(if (local (_this select 0)) then {[ARR_2(_this select 0, ObjNull)] call FUNC(carryObj)};);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
76
addons/common/CfgMoves.hpp
Normal file
76
addons/common/CfgMoves.hpp
Normal file
@ -0,0 +1,76 @@
|
||||
|
||||
class CfgMovesBasic {
|
||||
class Default;
|
||||
class Actions {
|
||||
// fixes grab animation with equipped pistol
|
||||
class NoActions;
|
||||
class PistolStandActions: NoActions {
|
||||
grabDrag = "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2";
|
||||
};
|
||||
class LauncherKneelActions: NoActions {
|
||||
grabDrag = "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2";
|
||||
};
|
||||
class CivilStandActions: NoActions {
|
||||
grabDrag = "AmovPercMstpSlowWrflDnon_AcinPknlMwlkSlowWrflDb_2";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class CfgMovesMaleSdr: CfgMovesBasic {
|
||||
class AgonyBase;
|
||||
class AgonyBaseRfl;
|
||||
class StandBase;
|
||||
class HealBase;
|
||||
|
||||
class States {
|
||||
// fixes being able to reload in some animations, can't remember now what exactly
|
||||
class AinjPfalMstpSnonWnonDnon_carried_Down: AgonyBase {
|
||||
canReload = 0;
|
||||
};
|
||||
class AinjPfalMstpSnonWnonDnon_carried_Up: AgonyBase {
|
||||
canReload = 0;
|
||||
};
|
||||
class AinjPfalMstpSnonWrflDnon_carried_Down: AgonyBase {
|
||||
canReload = 0;
|
||||
};
|
||||
class AinjPfalMstpSnonWrflDnon_carried_Up: AgonyBaseRfl {
|
||||
canReload = 0;
|
||||
};
|
||||
|
||||
class AmovPpneMstpSnonWnonDnon_injured;
|
||||
class AinjPpneMstpSnonWnonDnon: AmovPpneMstpSnonWnonDnon_injured {
|
||||
canReload = 0;
|
||||
};
|
||||
class AmovPpneMstpSrasWrflDnon_injured;
|
||||
class AinjPpneMstpSnonWrflDnon: AmovPpneMstpSrasWrflDnon_injured {
|
||||
canReload = 0;
|
||||
};
|
||||
|
||||
// mark as on ladder animation
|
||||
class LadderCivilStatic: StandBase {
|
||||
ACE_isLadder = 1;
|
||||
};
|
||||
|
||||
// dunno, important
|
||||
class AmovPercMstpSnonWnonDnon_AcinPknlMwlkSnonWnonDb_1;
|
||||
class AcinPknlMstpSnonWnonDnon: AmovPercMstpSnonWnonDnon_AcinPknlMwlkSnonWnonDb_1 {
|
||||
enableDirectControl = 1;
|
||||
};
|
||||
class AcinPknlMwlkSnonWnonDb: AmovPercMstpSnonWnonDnon_AcinPknlMwlkSnonWnonDb_1 {
|
||||
enableDirectControl = 1;
|
||||
};
|
||||
|
||||
// fix falling back to unconsciousness animation and disable rotating in that state
|
||||
class Unconscious: Default {
|
||||
ConnectTo[] = {};
|
||||
head = "headNo";
|
||||
forceAim = 1;
|
||||
static = 1;
|
||||
};
|
||||
|
||||
// idk. Flummi?
|
||||
class AinvPknlMstpSnonWnonDnon_medic0: HealBase {
|
||||
variantsPlayer[] = {};
|
||||
};
|
||||
};
|
||||
};
|
@ -33,7 +33,7 @@ class CfgVehicles {
|
||||
function = QFUNC(moduleCheckPBOs);
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
icon = QUOTE(PATHTOF(UI\IconCheckPBO_ca.paa));
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_CheckPBO_ca.paa));
|
||||
class Arguments {
|
||||
class Action {
|
||||
displayName = "Action";
|
||||
@ -87,6 +87,7 @@ class CfgVehicles {
|
||||
displayName = "LSD Vehicles";
|
||||
function = "ACE_Common_fnc_moduleLSDVehicles";
|
||||
scope = 2;
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_LSD_ca.paa));
|
||||
isGlobal = 1;
|
||||
class Arguments {
|
||||
};
|
||||
|
@ -218,6 +218,7 @@ class CfgVoice {
|
||||
displayName = "$STR_ACE_Common_NoVoice";
|
||||
};
|
||||
};
|
||||
|
||||
class CfgVoiceTypes {
|
||||
class ACE_NoVoice {
|
||||
name = "$STR_ACE_Common_NoVoice";
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user