Merge branch 'master' into agmGrenadesPort

This commit is contained in:
PabstMirror 2015-01-17 00:15:07 -06:00
commit 853dfba86a
271 changed files with 7120 additions and 6285 deletions

View File

@ -1,4 +1,53 @@
ACE3
====
Placeholder.
<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>
<a href="#">
<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>
<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>
</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**, **CSE** and **RHS** 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).
The mod is **built modularly** — almost any PBO can be removed, thus a team can maintain its own tailored version of ACE, which excludes a select number of components that they don't like, or which conflict with other add-ons. Components themselves, like e.g. the medical system, also include various customization options, allowing mission designers to tweak the overall experience.
More information on the purpose of the different components of ACE and which ones they rely on can be found [here](https://github.com/KoffeinFlummi/ACE3/wiki#features).
### Features
* Improved medical system
* Logistics system including cargo transport and vehicle maintenance
* Explosives system including different trigger types
* Captivity system
* Realistic names for vehicles and weapons
* Realistic ballistics including wind and humidity
* Backblast simulation
* Weapon resting and bipod deployment
* A fire control system for armored vehicles and helicopters
***and more...***
For a full list of current features, check [the official wiki](https://github.com/KoffeinFlummi/ACE3/wiki).
#### Guides & How-Tos
If you installed ACE3, but have trouble understanding how it all works, or where to start — see [Getting Started](https://github.com/KoffeinFlummi/ACE3/wiki/Getting-Started).
#### Contributing
If you want to help put with the ongoing development, you can do so by looking for possible bugs or by contributing new features. To contribute something to ACE, simply fork this repository and submit your pull requests for review by other collaborators. In the process, feel free to add yourself to the author array of any .pbo you will be editing and the AUTHORS.txt file.
To report a bug, propose a feature, or suggest a change to the existing one — please, use our [Issue Tracker](https://github.com/KoffeinFlummi/ACE3/issues).
For detailed information on how to make your weapons or vehicles compatible with ACE — read [this article](https://github.com/KoffeinFlummi/ACE3/wiki/For-Addon-Makers).
#### Testing & Building
If you want to help us test the latest development changes, feel free to download our master branch, using either git — if familiar with the process — or directly, by following [this link](https://github.com/KoffeinFlummi/ACE3/archive/master.zip).
To find out how to build a version of ACE for testing, follow [these instructions](https://github.com/KoffeinFlummi/ACE3/wiki/Developers-::-Setting-up-your-development-environment).

View File

@ -1,94 +0,0 @@
#define AVERAGEDURATION 6
#define INTERVAL 0.25
#define MAXVIRTUALG 5.4
if !(hasInterface) exitWith {};
AGM_GForces = [];
AGM_GForces_Index = 0;
AGM_GForces_CC = ppEffectCreate ["ColorCorrections", 4215];
AGM_GForces_CC ppEffectEnable true;
AGM_GForces_CC ppEffectForceInNVG true;
AGM_GForces_CC ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]];
AGM_GForces_CC ppEffectCommit 0.4;
0 spawn {
while {True} do {
_player = AGM_player;
if !((vehicle _player isKindOf "Air") or ((getPos _player select 2) > 5)) then {
AGM_GForces = [];
AGM_GForces_Index = 0;
waitUntil {sleep 5; (vehicle _player isKindOf "Air") or ((getPos _player select 2) > 5)};
};
_oldVel = velocity (vehicle _player);
sleep INTERVAL;
_newVel = velocity (vehicle _player);
_accel = ((_newVel vectorDiff _oldVel) vectorMultiply (1 / INTERVAL)) vectorAdd [0, 0, 9.8];
AGM_GForce_Current = (_accel vectorDotProduct vectorUp (vehicle _player)) / 9.8;
// Cap maximum G's to +- 10 to avoid g-effects when the update is low fps.
AGM_GForce_Current = (AGM_GForce_Current max -10) min 10;
AGM_GForces set [AGM_GForces_Index, AGM_GForce_Current];
AGM_GForces_Index = (AGM_GForces_Index + 1) % round (AVERAGEDURATION / INTERVAL);
};
};
/*
* source: http://en.wikipedia.org/wiki/G-LOC
* untrained persons without gsuit will fall unconscious between 4 and 6G
* pilots in gsuits will sustain up to 9G
* a person is for average 12 seconds unconscious
* after being unconscious, a person is unable to do simple tasks for average 15 seconds
*
* _upTolerance converts the effective 9G of a pilot to virtual 5.4G (= 0.8*0.75*9G)
* pilots with gsuit will get unconscious at an _average of 9G
* normal men without gsuit will get unconscious at an _average of 5.4G
*/
0 spawn {
while {True} do {
sleep INTERVAL;
_player = AGM_player;
_average = 0;
if (count AGM_GForces > 0) then {
_sum = 0;
{
_sum = _sum + _x;
} forEach AGM_GForces;
_average = _sum / (count AGM_GForces);
};
_downTolerance = _player getVariable ["AGM_GForceCoef",
getNumber (configFile >> "CfgVehicles" >> (typeOf _player) >> "AGM_GForceCoef")];
_upTolerance = _downTolerance * getNumber (configFile >> "CfgWeapons" >> (uniform _player) >> "AGM_GForceCoef");
["GForces", [_average, _upTolerance], {format ["_g _avgG _avgG*_upTol: %1, %2, %3", AGM_GForce_Current, _this select 0, (_this select 0) * (_this select 1)]}] call AGM_Debug_fnc_log;
if (((_average * _upTolerance) > MAXVIRTUALG) and {isClass (configFile >> "CfgPatches" >> "AGM_Medical") and {!(_player getVariable ["AGM_isUnconscious", false])}}) then {
[_player, (10 + floor(random 5))] call AGM_Medical_fnc_knockOut;
};
if ((abs _average > 2) and !(_player getVariable ["AGM_isUnconscious", false])) then {
if (_average > 0) then {
_strength = 1.2 - (((_average - 2) * _upTolerance) / (MAXVIRTUALG - 2));
AGM_GForces_CC ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[_strength,_strength,0,0,0,0.1,0.5]];
addCamShake [((abs _average) - 2) / 3, 1, 15];
} else {
_strength = 1.2 - ((((-1 * _average) - 2) * _downTolerance) / (MAXVIRTUALG - 2));
AGM_GForces_CC ppEffectAdjust [1,1,0,[1,0.2,0.2,1],[0,0,0,0],[1,1,1,1],[_strength,_strength,0,0,0,0.1,0.5]];
addCamShake [((abs _average) - 2) / 5, 1, 15];
};
} else {
AGM_GForces_CC ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]];
};
AGM_GForces_CC ppEffectCommit INTERVAL;
};
};

View File

@ -1,56 +0,0 @@
class CfgPatches {
class AGM_GForces {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"KoffeinFlummi"};
authorUrl = "https://github.com/KoffeinFlummi/";
};
};
class Extended_PostInit_EventHandlers {
class AGM_GForces {
clientInit = "call compile preprocessFileLineNumbers '\AGM_GForces\clientInit.sqf'";
};
};
class CfgWeapons {
class ItemCore;
class Uniform_Base: ItemCore {
AGM_GForceCoef = 1;
};
class U_B_PilotCoveralls: Uniform_Base {
AGM_GForceCoef = 0.8;
};
class U_I_pilotCoveralls: Uniform_Base {
AGM_GForceCoef = 0.8;
};
class U_O_PilotCoveralls: Uniform_Base {
AGM_GForceCoef = 0.8;
};
};
class CfgVehicles {
class Man;
class CAManBase: Man {
AGM_GForceCoef = 1;
};
class B_Soldier_05_f;
class B_Pilot_F: B_Soldier_05_f {
AGM_GForceCoef = 0.75;
};
class I_Soldier_04_F;
class I_pilot_F: I_Soldier_04_F {
AGM_GForceCoef = 0.75;
};
class O_helipilot_F;
class O_Pilot_F: O_helipilot_F {
AGM_GForceCoef = 0.75;
};
};

View File

@ -1,522 +0,0 @@
class CfgPatches{
class AGM_Inventory {
units[] = {};
weapons[] = {};
requiredVersion = 0.6;
requiredAddons[] = {"AGM_Core"};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"Pabst Mirror"};
authorUrl = "https://github.com/PabstMirror/";
};
};
class RscText;
class RscPicture;
class RscListBox;
class RscProgress;
class RscStructuredText;
class RscActiveText;
class RscCombo;
class RscControlsGroupNoScrollbars;
/*
Adjust the scaling of the inventory screen
-changes it from scaling based on user's interface size to a static size
-text size and row height size are uneffected
-also tweaks the height of the two ProgressBars which looked odd scaled up so much
*/
class RscDisplayInventory {
class controls {
class CA_ContainerBackground: RscText {
//crate: GroundLoad adjust size
x = "1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "12 * (safeZoneH / 40)";
// h = "23 * ((safeZoneH / 1.2) / 25)";
h = "22.5 * ((safeZoneH / 1.2) / 25)";
};
class CA_PlayerBackground: RscText {
//center player's container: decrease height because of progressbar height decrease
x = "14.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "2 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "24.4 * (safeZoneH / 40)";
// h = "22 * ((safeZoneH / 1.2) / 25)";
h = "21.5 * ((safeZoneH / 1.2) / 25)";
};
class TitleBackground: RscText {
x = "14.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "24.4 * (safeZoneH / 40)";
h = "1 * ((safeZoneH / 1.2) / 25)";
};
class PlayersName: RscText {
text = "Player name:";
x = "15.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "19.8 * (safeZoneH / 40)";
h = "1 * ((safeZoneH / 1.2) / 25)";
};
class RankBackground: RscText {
x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "1.25 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "0.6 * (safeZoneH / 40)";
h = "0.6 * ((safeZoneH / 1.2) / 25)";
};
class RankPicture: RscPicture {
x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "1.25 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "0.6 * (safeZoneH / 40)";
h = "0.6 * ((safeZoneH / 1.2) / 25)";
};
class ButtonBack: RscActiveText {
x = "38 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "1 * (safeZoneH / 40)";
h = "1 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotPrimary: RscPicture {
x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "11.9 * (safeZoneH / 40)";
h = "3 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotPrimaryMuzzle: BackgroundSlotPrimary {
x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotPrimaryFlashlight: BackgroundSlotPrimary {
x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotPrimaryOptics: BackgroundSlotPrimary {
x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotPrimaryMagazine: BackgroundSlotPrimary {
x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotSecondary: BackgroundSlotPrimary {
x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "11.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "11.9 * (safeZoneH / 40)";
h = "3 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotSecondaryMuzzle: BackgroundSlotPrimary {
x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotSecondaryFlashlight: BackgroundSlotPrimary {
x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotSecondaryOptics: BackgroundSlotPrimary {
x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotSecondaryMagazine: BackgroundSlotPrimary {
x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotHandgun: BackgroundSlotPrimary {
x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "17 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "11.9 * (safeZoneH / 40)";
h = "3 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotHandgunMuzzle: BackgroundSlotPrimary {
x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotHandgunFlashlight: BackgroundSlotPrimary {
x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotHandgunOptics: BackgroundSlotPrimary {
x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotHandgunMagazine: BackgroundSlotPrimary {
x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotHeadgear: BackgroundSlotPrimary {
x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2.9 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotGoggles: BackgroundSlotPrimary {
x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2.9 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotHMD: BackgroundSlotPrimary {
x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2.9 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotBinoculars: BackgroundSlotPrimary {
x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2.9 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotMap: BackgroundSlotPrimary {
x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.12 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotGPS: BackgroundSlotPrimary {
x = "17.32 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.12 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotCompass: BackgroundSlotPrimary {
x = "21.76 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.12 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotRadio: BackgroundSlotPrimary {
x = "19.54 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.12 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class BackgroundSlotWatch: BackgroundSlotPrimary {
x = "23.98 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.12 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class ExternalContainerBackground: RscPicture {
x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "3.7 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "11 * (safeZoneH / 40)";
h = "18.4 * ((safeZoneH / 1.2) / 25)";
// h = "15.4 * ((safeZoneH / 1.2) / 25)";
};
class PlayerContainerBackground: ExternalContainerBackground {
x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "11 * (safeZoneH / 40)";
h = "14 * ((safeZoneH / 1.2) / 25)";
};
class GroundTab: RscActiveText {
x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "1.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "5.5 * (safeZoneH / 40)";
h = "1 * ((safeZoneH / 1.2) / 25)";
};
class SoldierTab: GroundTab {
x = "7 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "1.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "5.5 * (safeZoneH / 40)";
h = "1 * ((safeZoneH / 1.2) / 25)";
};
class GroundContainer: RscListBox {
x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "3.7 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "11 * (safeZoneH / 40)";
h = "18.4 * ((safeZoneH / 1.2) / 25)";
};
// class SoldierContainer: GroundContainer {};
class GroundFilter: RscCombo {
x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "2.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "11 * (safeZoneH / 40)";
h = "1 * ((safeZoneH / 1.2) / 25)";
};
class GroundLoad: RscProgress {
//crate: GroundLoad adjust size
x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "22.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "11 * (safeZoneH / 40)";
// h = "1 * ((safeZoneH / 1.2) / 25)";
h = "0.5 * ((safeZoneH / 1.2) / 25)";
};
class SlotPrimary: GroundTab {
x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "11.9 * (safeZoneH / 40)";
h = "3 * ((safeZoneH / 1.2) / 25)";
};
class SlotPrimaryMuzzle: SlotPrimary {
x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class SlotPrimaryGrip: SlotPrimary {
w = 0;
h = 0;
x = "39 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "9 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
};
class SlotPrimaryFlashlight: SlotPrimary {
x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class SlotPrimaryOptics: SlotPrimary {
x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class SlotPrimaryMagazine: SlotPrimary {
x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class SlotSecondary: SlotPrimary {
x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "11.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "11.9 * (safeZoneH / 40)";
h = "3 * ((safeZoneH / 1.2) / 25)";
};
class SlotSecondaryMuzzle: SlotPrimary {
x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class SlotSecondaryGrip: SlotPrimary {
w = 0;
h = 0;
x = "39 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "14.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
};
class SlotSecondaryFlashlight: SlotPrimary {
x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class SlotSecondaryOptics: SlotPrimary {
x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class SlotSecondaryMagazine: SlotPrimary {
x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class SlotHandgun: SlotPrimary {
x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "17 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "11.9 * (safeZoneH / 40)";
h = "3 * ((safeZoneH / 1.2) / 25)";
};
class SlotHandgunMuzzle: SlotPrimary {
x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class SlotHandgunGrip: SlotPrimary {
w = 0;
h = 0;
x = "39 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
};
class SlotHandgunFlashlight: SlotPrimary {
x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class SlotHandgunOptics: SlotPrimary {
x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class SlotHandgunMagazine: SlotPrimary {
x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class SlotHeadgear: SlotPrimary {
x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2.9 * ((safeZoneH / 1.2) / 25)";
};
class SlotGoggles: SlotPrimary {
x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2.9 * ((safeZoneH / 1.2) / 25)";
};
class SlotHMD: SlotPrimary {
x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2.9 * ((safeZoneH / 1.2) / 25)";
};
class SlotBinoculars: SlotPrimary {
x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2.9 * (safeZoneH / 40)";
h = "2.9 * ((safeZoneH / 1.2) / 25)";
};
class SlotMap: SlotPrimary {
x = "15.16 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class SlotGPS: SlotPrimary {
x = "17.38 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class SlotCompass: SlotPrimary {
x = "21.82 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class SlotRadio: SlotPrimary {
x = "19.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class SlotWatch: SlotPrimary {
x = "24.04 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "2 * (safeZoneH / 40)";
h = "2 * ((safeZoneH / 1.2) / 25)";
};
class UniformTab: GroundTab {
x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "3.5 * (safeZoneH / 40)";
h = "3 * ((safeZoneH / 1.2) / 25)";
};
class UniformSlot: SlotPrimary {
x = "15.35 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "3 * (safeZoneH / 40)";
h = "3 * ((safeZoneH / 1.2) / 25)";
};
class UniformLoad: GroundLoad {
x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "5.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "3.5 * (safeZoneH / 40)";
h = "0.5 * ((safeZoneH / 1.2) / 25)";
};
class UniformContainer: GroundContainer {
x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "11 * (safeZoneH / 40)";
h = "14 * ((safeZoneH / 1.2) / 25)";
};
class VestTab: UniformTab {
x = "18.85 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "3.5 * (safeZoneH / 40)";
h = "3 * ((safeZoneH / 1.2) / 25)";
};
class VestSlot: SlotPrimary {
x = "19.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "3 * (safeZoneH / 40)";
h = "3 * ((safeZoneH / 1.2) / 25)";
};
class VestLoad: GroundLoad {
x = "18.85 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "5.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "3.5 * (safeZoneH / 40)";
h = "0.5 * ((safeZoneH / 1.2) / 25)";
};
// class VestContainer: UniformContainer{};
class BackpackTab: UniformTab {
x = "22.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "3.5 * (safeZoneH / 40)";
h = "3 * ((safeZoneH / 1.2) / 25)";
};
class BackpackSlot: SlotPrimary {
x = "22.85 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "3 * (safeZoneH / 40)";
h = "3 * ((safeZoneH / 1.2) / 25)";
};
class BackpackLoad: GroundLoad {
x = "22.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "5.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "3.5 * (safeZoneH / 40)";
h = "0.5 * ((safeZoneH / 1.2) / 25)";
};
// class BackpackContainer: UniformContainer{};
class TotalLoad: GroundLoad {
//center: progressbar height decrease
x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "22.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "23.4 * (safeZoneH / 40)";
// h = "1 * ((safeZoneH / 1.2) / 25)";
h = "0.5 * ((safeZoneH / 1.2) / 25)";
};
class ContainerMarker: GroundTab {
x = "0 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "24 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "1 * (safeZoneH / 40)";
h = "1 * ((safeZoneH / 1.2) / 25)";
};
class GroundMarker: ContainerMarker {
x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "24 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "1 * (safeZoneH / 40)";
h = "1 * ((safeZoneH / 1.2) / 25)";
};
class SoldierMarker: ContainerMarker {
x = "3 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "24 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "1 * (safeZoneH / 40)";
h = "1 * ((safeZoneH / 1.2) / 25)";
};
};
};

View File

@ -1,48 +0,0 @@
class CfgPatches {
class AGM_MagazineRepack {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core, AGM_Interaction};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"commy2", "CAA-Picard"};
authorUrl = "https://github.com/commy2/";
};
};
class CfgFunctions {
class AGM_MagazineRepack {
class AGM_MagazineRepack {
file = "\AGM_MagazineRepack\functions";
class magazineRepack;
class magazineRepackCallback;
class openSelectMagazineUI;
};
};
};
class CfgVehicles {
class Man;
class CAManBase: Man {
class AGM_SelfActions {
class AGM_RepackMagazines {
displayName = "$STR_AGM_MagazineRepack_RepackMagazines";
condition = "true";
statement = "call AGM_MagazineRepack_fnc_magazineRepack";
showDisabled = 0;
priority = -2;
icon = "AGM_MagazineRepack\UI\repack_ca.paa";
hotkey = "R";
enableInside = 1;
};
};
};
};
class AGM_Parameters_Numeric {
AGM_MagazineRepack_TimePerAmmo = 1.5;
AGM_MagazineRepack_TimePerMagazine = 2.0;
};

View File

@ -1,74 +0,0 @@
// by commy2, esteldunedain
private ["_magazines", "_ammos", "_repackTime", "_magazine", "_ammo", "_count", "_index", "_i", "_j", "_ammoToTransfer", "_ammoAvailable", "_ammoNeeded"];
_magazines = [];
_ammos = [];
_repackTime = [];
// get all mags and ammo count
{
_magazine = _x select 0;
_ammo = _x select 1;
_count = getNumber (configfile >> "CfgMagazines" >> _magazine >> "count");
if (_ammo != _count && {_count > 1}) then { // additional checks here
if !(_magazine in _magazines) then {
_index = count _magazines;
_magazines set [_index, _magazine];
_ammos set [_index, [_ammo]];
} else {
_index = _magazines find _magazine;
_ammos set [_index, (_ammos select _index) + [_ammo]];
};
};
} forEach magazinesAmmoFull AGM_player;
// Remove invalid magazines
{
if (count _x < 2) then {
_magazines set [_forEachIndex, -1];
_ammos set [_forEachIndex, [-1]];
};
} forEach _ammos;
_magazines = _magazines - [-1];
_ammos = _ammos - [[-1]];
{
// Calculate actual ammo to transfer during repack
_count = getNumber (configfile >> "CfgMagazines" >> (_magazines select _forEachIndex) >> "count");
// Sort Ascending
_list = _x call BIS_fnc_sortNum;
["MagazineRepack", _list] call AGM_Debug_fnc_log;
_i = 0;
_j = count _x - 1;
_ammoToTransfer = 0;
_ammoAvailable = 0;
while {_i < _j} do {
_ammoNeeded = _count - (_list select _j);
_exit = false;
while {_i < _j && {!_exit}} do {
_ammoAvailable = _list select _i;
if (_ammoAvailable >= _ammoNeeded) then {
_list set [_i, _ammoAvailable - _ammoNeeded];
_ammoToTransfer = _ammoToTransfer + _ammoNeeded;
_exit = true;
} else {
_ammoNeeded = _ammoNeeded - _ammoAvailable;
_ammoToTransfer = _ammoToTransfer + _ammoAvailable;
_i = _i + 1;
};
};
_j = _j - 1;
};
_repackTime set [_forEachIndex, _ammoToTransfer * AGM_MagazineRepack_TimePerAmmo + (count _x) * AGM_MagazineRepack_TimePerMagazine];
} forEach _ammos;
["MagazineRepack", [_magazines, _repackTime]] call AGM_Debug_fnc_log;
[_magazines, _repackTime] call AGM_MagazineRepack_fnc_openSelectMagazineUI;

View File

@ -1,104 +0,0 @@
// by commy2
private ["_magazine", "_ammo", "_ammoCount", "_fullMagazinesCount", "_restAmmo", "_isLoaded", "_weapon", "_reloadAction", "_text", "_picture"];
_magazine = _this select 0;
// exit if the last magazine of this type was taken out of the backpack
if !(_magazine in magazines player) exitWith {};
// get current ammo count
_ammo = 0;
{
if (_x select 0 == _magazine) then {
_ammo = _ammo + (_x select 1);
};
} forEach magazinesAmmoFull player;
// how many rounds fit in one mag
_ammoCount = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count");
// calculate new vaules
_fullMagazinesCount = floor (_ammo / _ammoCount);
_restAmmo = _ammo - _fullMagazinesCount * _ammoCount;
// remove old magazines
player removeMagazines _magazine;
_isLoaded = false;
// reload rifle
if (_magazine in primaryWeaponMagazine player) then {
_weapon = primaryWeapon player;
if (_fullMagazinesCount > 0) then {
player setAmmo [_weapon, _ammoCount];
_fullMagazinesCount = _fullMagazinesCount - 1;
} else {
player setAmmo [_weapon, _restAmmo];
_restAmmo = 0;
};
if (_weapon == currentWeapon player) then {
_reloadAction = getText (configFile >> "CfgWeapons" >> _weapon >> "reloadAction");
player playActionNow _reloadAction;
};
_isLoaded = true;
};
// reload pistol
if (_magazine in handgunMagazine player) then {
_weapon = handgunWeapon player;
if (_fullMagazinesCount > 0) then {
player setAmmo [_weapon, _ammoCount];
_fullMagazinesCount = _fullMagazinesCount - 1;
} else {
player setAmmo [_weapon, _restAmmo];
_restAmmo = 0;
};
if (_weapon == currentWeapon player) then {
_reloadAction = getText (configFile >> "CfgWeapons" >> _weapon >> "reloadAction");
player playActionNow _reloadAction;
};
_isLoaded = true;
};
// reload rocket launcher (just in case ...)
if (_magazine in secondaryWeaponMagazine player) then {
_weapon = secondaryWeapon player;
if (_fullMagazinesCount > 0) then {
player setAmmo [_weapon, _ammoCount];
_fullMagazinesCount = _fullMagazinesCount - 1;
} else {
player setAmmo [_weapon, _restAmmo];
_restAmmo = 0;
};
if (_weapon == currentWeapon player) then {
_reloadAction = getText (configFile >> "CfgWeapons" >> _weapon >> "reloadAction");
player playActionNow _reloadAction;
};
_isLoaded = true;
};
// add new magazines
for "_a" from 1 to _fullMagazinesCount do {
player addMagazine _magazine;
};
if (_restAmmo > 0) then {
player addMagazine [_magazine, _restAmmo];
};
// display text if successful
_text = format [localize "STR_AGM_MagazineRepack_RepackedMagazinesDetail", [_fullMagazinesCount, _fullMagazinesCount + 1] select _isLoaded, _restAmmo];
_picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture");
_text = parseText format ["<img align='center' size='1.8' color='#ffffff' image='%1'/> <br/> <t align='center'>%2</t> <br/> <t align='center'>%3</t>", _picture, localize "STR_AGM_MagazineRepack_RepackedMagazines", _text];
[_text] call AGM_Core_fnc_displayTextStructured;

View File

@ -1,38 +0,0 @@
// by commy2
private ["_magazines", "_repackTime", "_listIDC", "_count", "_index", "_magazine", "_time", "_displayName", "_picture"];
_magazines = _this select 0;
_repackTime = _this select 1;
_count = count _magazines;
_actions = [localize "STR_AGM_MagazineRepack_SelectMagazineMenu", localize "STR_AGM_MagazineRepack_SelectMagazine"] call AGM_Interaction_fnc_prepareSelectMenu;
for "_index" from 0 to (_count - 1) do {
_magazine = _magazines select _index;
_time = _repackTime select _index;
_displayName = getText (configFile >> "CfgMagazines" >> _magazine >> "displayName");
_picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture");
_actions = [
_actions,
_displayName,
_picture,
[_magazine, _time]
] call AGM_Interaction_fnc_AddSelectableItem;
};
[
_actions,
{
_data = _this;
call AGM_Interaction_fnc_hideMenu;
if (isNil "_data") exitWith {};
_data set [1, [_data select 1] call AGM_Core_fnc_toNumber];
[_data select 1, _data, "AGM_MagazineRepack_fnc_magazineRepackCallback", localize "STR_AGM_MagazineRepack_RepackingMagazine"] call AGM_Core_fnc_progressBar;
[player] call AGM_core_fnc_goKneeling;
},
{
call AGM_Interaction_fnc_hideMenu;
if !(profileNamespace getVariable ["AGM_Interaction_AutoCloseMenu", false]) then {"Default" call AGM_Interaction_fnc_openMenuSelf};
}
] call AGM_Interaction_fnc_openSelectMenu;

View File

@ -1,30 +0,0 @@
// by commy2
if (!hasInterface) exitWith {};
AGM_NightVision_ppEffectBlur = ppEffectCreate ["dynamicBlur", 1234];
AGM_NightVision_ppEffectBlur ppEffectForceInNVG true;
AGM_NightVision_ppEffectBlur ppEffectAdjust [0];
AGM_NightVision_ppEffectBlur ppEffectCommit 0;
AGM_NightVision_ppEffectRadialBlur = ppEffectCreate ["radialBlur", 1238];
AGM_NightVision_ppEffectRadialBlur ppEffectForceInNVG true;
AGM_NightVision_ppEffectRadialBlur ppEffectAdjust [0, 0, 0, 0];
AGM_NightVision_ppEffectRadialBlur ppEffectCommit 0;
AGM_NightVision_ppEffect = ppEffectCreate ["FilmGrain", 1235];
AGM_NightVision_ppEffect ppEffectAdjust [0.25, 2.5, 2.5, 2.5*0.3, 2.5*0.3, false];
AGM_NightVision_ppEffect ppEffectCommit 0;
AGM_NightVision_ppEffectNVGBrightness = ppEffectCreate ["ColorCorrections", 1236];
AGM_NightVision_ppEffectNVGBrightness ppEffectForceInNVG true;
AGM_NightVision_ppEffectNVGBrightness ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
AGM_NightVision_ppEffectNVGBrightness ppEffectCommit 0;
AGM_NightVision_ppEffectMuzzleFlash = ppEffectCreate ["ColorCorrections", 1237];
AGM_NightVision_ppEffectMuzzleFlash ppEffectEnable true;
AGM_NightVision_ppEffectMuzzleFlash ppEffectForceInNVG true;
AGM_NightVision_ppEffectMuzzleFlash ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
AGM_NightVision_ppEffectMuzzleFlash ppEffectCommit 0;
0 spawn compile preprocessFileLineNumbers "\AGM_NightVision\nightVision.sqf";

View File

@ -1,142 +0,0 @@
class CfgPatches {
class AGM_NightVision {
units[] = {};
weapons[] = {"AGM_NVG_Gen1", "AGM_NVG_Gen2", /*"AGM_NVG_Gen3",*/ "AGM_NVG_Gen4", "AGM_NVG_Wide"};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"commy2", "KoffeinFlummi"};
authorUrl = "https://github.com/commy2/";
};
};
class CfgFunctions {
class AGM_NightVision {
class AGM_NightVision {
file = "\AGM_nightvision\functions";
class blending;
class decreaseNVGBrightness;
class increaseNVGBrightness;
};
};
};
class Extended_PostInit_EventHandlers {
class AGM_NightVision {
clientInit = "call compile preprocessFileLineNumbers '\AGM_NightVision\clientInit.sqf'";
};
};
class Extended_FiredBIS_EventHandlers {
class AllVehicles {
class AGM_NightVision_Blending {
clientFiredBIS = "if (_this select 0 == vehicle AGM_player && {currentVisionMode (_this select 0) == 1}) then {_this call AGM_NightVision_fnc_blending};";
};
};
};
class AGM_Core_Default_Keys {
class increaseNVGBrightness {
displayName = "$STR_AGM_NightVision_IncreaseNVGBrightness";
condition = "currentVisionMode _player == 1";
statement = "[_player, _vehicle] call AGM_NightVision_fnc_increaseNVGBrightness";
key = 201;
shift = 0;
control = 0;
alt = 1;
allowHolding = 1;
};
class decreaseNVGBrightness {
displayName = "$STR_AGM_NightVision_DecreaseNVGBrightness";
condition = "currentVisionMode _player == 1";
statement = "[_player, _vehicle] call AGM_NightVision_fnc_decreaseNVGBrightness";
key = 209;
shift = 0;
control = 0;
alt = 1;
allowHolding = 1;
};
};
class CfgVehicles {
class All {
AGM_NightVision_grain = 0.75;
AGM_NightVision_blur = 0.055;
};
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
name = #ITEM; \
count = COUNT; \
};
class Box_NATO_Support_F;
class AGM_Box_Misc: Box_NATO_Support_F {
class TransportItems {
MACRO_ADDITEM(AGM_NVG_Gen1,6)
MACRO_ADDITEM(AGM_NVG_Gen2,6)
//MACRO_ADDITEM(AGM_NVG_Gen3,6)
MACRO_ADDITEM(AGM_NVG_Gen4,6)
MACRO_ADDITEM(AGM_NVG_Wide,6)
};
};
};
class CfgWeapons {
class Binocular;
class NVGoggles: Binocular {
displayName = "$STR_AGM_NightVision_NVG_Gen3_brown";
AGM_NightVision_grain = 0.75;
AGM_NightVision_blur = 0.055;
AGM_NightVision_radBlur = 0.001;
};
class NVGoggles_OPFOR: NVGoggles {
displayName = "$STR_AGM_NightVision_NVG_Gen3_black";
};
class NVGoggles_INDEP: NVGoggles {
displayName = "$STR_AGM_NightVision_NVG_Gen3_green";
};
class AGM_NVG_Gen1: NVGoggles_OPFOR {
author = "$STR_AGM_Core_AGMTeam";
modelOptics = "\A3\weapons_f\reticle\optics_night";
displayName = "$STR_AGM_NightVision_NVG_Gen1";
AGM_NightVision_grain = 2.25;
AGM_NightVision_blur = 0.22;
AGM_NightVision_radBlur = 0.004;
};
class AGM_NVG_Gen2: NVGoggles_INDEP {
author = "$STR_AGM_Core_AGMTeam";
modelOptics = "\A3\weapons_f\reticle\optics_night";
displayName = "$STR_AGM_NightVision_NVG_Gen2";
AGM_NightVision_grain = 1.5;
AGM_NightVision_blur = 0.11;
AGM_NightVision_radBlur = 0.002;
};
/*class AGM_NVG_Gen3: NVGoggles {
author = "$STR_AGM_Core_AGMTeam";
modelOptics = "\A3\weapons_f\reticle\optics_night";
displayName = "$STR_AGM_NightVision_NVG_Gen3";
AGM_NightVision_grain = 0.75;
AGM_NightVision_blur = 0.055;
AGM_NightVision_radBlur = 0.001;
};*/
class AGM_NVG_Gen4: NVGoggles {
author = "$STR_AGM_Core_AGMTeam";
modelOptics = "\A3\weapons_f\reticle\optics_night";
displayName = "$STR_AGM_NightVision_NVG_Gen4";
AGM_NightVision_grain = 0.0;
AGM_NightVision_blur = 0.0;
AGM_NightVision_radBlur = 0.0;
};
class AGM_NVG_Wide: NVGoggles {
author = "$STR_AGM_Core_AGMTeam";
// modelOptics = "\AGM_NightVision\weapons\agm_nvg_wide";
modelOptics = "\agm_nightvision\agm_nvg_wide_optics.p3d";
displayName = "$STR_AGM_NightVision_NVG_FullScreen";
AGM_NightVision_grain = 0.75;
AGM_NightVision_blur = 0.055;
AGM_NightVision_radBlur = 0.001;
};
};

View File

@ -1,20 +0,0 @@
// by commy2
private ["_player", "_vehicle", "_brightness"];
_player = _this select 0;
_vehicle = _this select 1;
_brightness = _player getVariable ["AGM_NVGBrightness", 0];
if (_brightness > -1) then {
_brightness = round (10 * _brightness - 1) / 10;
_player setVariable ["AGM_NVGBrightness", _brightness, false];
AGM_NightVision_ppEffectNVGBrightness ppEffectAdjust [1, 1, _brightness / 4, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
AGM_NightVision_ppEffectNVGBrightness ppEffectCommit 0;
[format [localize "STR_AGM_NightVision_NVGBrightness", format ["%1%", _brightness * 100]]] call AGM_Core_fnc_displayTextStructured;
playSound "AGM_Sound_Click";
};

View File

@ -1,20 +0,0 @@
// by commy2
private ["_player", "_vehicle", "_brightness"];
_player = _this select 0;
_vehicle = _this select 1;
_brightness = _player getVariable ["AGM_NVGBrightness", 0];
if (_brightness < 1) then {
_brightness = round (10 * _brightness + 1) / 10;
_player setVariable ["AGM_NVGBrightness", _brightness, false];
AGM_NightVision_ppEffectNVGBrightness ppEffectAdjust [1, 1, _brightness / 4, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
AGM_NightVision_ppEffectNVGBrightness ppEffectCommit 0;
[format [localize "STR_AGM_NightVision_NVGBrightness", format ["%1%", _brightness * 100]]] call AGM_Core_fnc_displayTextStructured;
playSound "AGM_Sound_Click";
};

View File

@ -1,100 +0,0 @@
//by commy2
private ["_currentVehicle", "_currentTurret", "_currentHMD", "_grainSetting", "_blurSetting"];
_currentView = "";
_currentVehicle = objNull;
_currentTurret = [-1];
_currentHMD = "";
while {true} do {
AGM_NightVision_ppEffect ppEffectEnable false;
AGM_NightVision_ppEffectBlur ppEffectEnable false;
AGM_NightVision_ppEffectRadialBlur ppEffectEnable false;
AGM_NightVision_ppEffectNVGBrightness ppEffectEnable false;
waitUntil {currentVisionMode AGM_player == 1};
AGM_NightVision_ppEffect ppEffectEnable true;
AGM_NightVision_ppEffectBlur ppEffectEnable true;
AGM_NightVision_ppEffectRadialBlur ppEffectEnable true;
AGM_NightVision_ppEffectNVGBrightness ppEffectEnable true;
waitUntil {
// any updates?
if (hmd AGM_player != _currentHMD || {cameraView != _currentView} || {vehicle AGM_player != _currentVehicle} || {!(_currentTurret isEqualTo []) && {AGM_player != _currentVehicle turretUnit _currentTurret}}) then {
_currentHMD = hmd AGM_player;
_currentView = cameraView;
_currentVehicle = vehicle AGM_player;
_currentTurret = [AGM_player] call AGM_Core_fnc_getTurretIndex;
private ["_config", "_fnc_isUsingHMD"];
_config = configFile >> "CfgVehicles" >> typeOf _currentVehicle;
_fnc_isUsingHMD = {
if (_currentView != "GUNNER") exitWith {true}; // asume hmd usage outside of gunner view
if (AGM_player == driver _currentVehicle) exitWith {
!("NVG" in getArray (_config >> "ViewOptics" >> "visionMode"));
};
private "_turretConfig";
_turretConfig = [_config, _currentTurret] call AGM_Core_fnc_getTurretConfigPath;
_turretConfig = _turretConfig >> "OpticsIn";
private "_result";
_result = true;
for "_index" from 0 to (count _turretConfig - 1) do {
if ("NVG" in getArray (_turretConfig select _index >> "visionMode")) exitWith {_result = false};
true
};
_result
};
// on foot or in vehicle using hmd
if (_currentVehicle == AGM_player || _fnc_isUsingHMD) then {
_grainSetting = getNumber (configFile >> "CfgWeapons" >> _currentHMD >> "AGM_NightVision_grain");
_blurSetting = getNumber (configFile >> "CfgWeapons" >> _currentHMD >> "AGM_NightVision_blur");
_radBlurSetting = getNumber (configFile >> "CfgWeapons" >> _currentHMD >> "AGM_NightVision_radBlur");
AGM_NightVision_ppEffect ppEffectAdjust [0.25, 2.5, 2.5, _grainSetting, _grainSetting, false];
AGM_NightVision_ppEffect ppEffectCommit 0;
AGM_NightVision_ppEffectBlur ppEffectAdjust [_blurSetting];
AGM_NightVision_ppEffectBlur ppEffectCommit 0;
AGM_NightVision_ppEffectRadialBlur ppEffectAdjust [_radBlurSetting, _radBlurSetting, 0.2, 0.2];
AGM_NightVision_ppEffectRadialBlur ppEffectCommit 0;
// in vehicle and not using hmd
} else {
_grainSetting = _currentVehicle getVariable ["AGM_NightVision_grain", getNumber (_config >> "AGM_NightVision_grain")];
_blurSetting = _currentVehicle getVariable ["AGM_NightVision_blur", getNumber (_config >> "AGM_NightVision_blur")];
_radBlurSetting = _currentVehicle getVariable ["AGM_NightVision_radBlur", getNumber (_config >> "AGM_NightVision_radBlur")];
AGM_NightVision_ppEffect ppEffectAdjust [0.25, 2.5, 2.5, _grainSetting, _grainSetting, false];
AGM_NightVision_ppEffect ppEffectCommit 0;
AGM_NightVision_ppEffectBlur ppEffectAdjust [_blurSetting];
AGM_NightVision_ppEffectBlur ppEffectCommit 0;
AGM_NightVision_ppEffectRadialBlur ppEffectAdjust [_radBlurSetting, _radBlurSetting, 0.2, 0.2];
AGM_NightVision_ppEffectRadialBlur ppEffectCommit 0;
};
};
// Detect if curator interface is open and disable effects
if (!isNull findDisplay 312) then {
AGM_NightVision_ppEffect ppEffectEnable false;
AGM_NightVision_ppEffectBlur ppEffectEnable false;
AGM_NightVision_ppEffectRadialBlur ppEffectEnable false;
AGM_NightVision_ppEffectNVGBrightness ppEffectEnable false;
waitUntil {isNull findDisplay 312};
AGM_NightVision_ppEffect ppEffectEnable true;
AGM_NightVision_ppEffectBlur ppEffectEnable true;
AGM_NightVision_ppEffectRadialBlur ppEffectEnable true;
AGM_NightVision_ppEffectNVGBrightness ppEffectEnable true;
};
currentVisionMode AGM_player != 1
};
};

View File

@ -1,18 +0,0 @@
// by commy2
0 spawn {
waitUntil {!isNull AGM_player};
[AGM_player] call AGM_Core_fnc_muteUnit;
AGM_player setVariable ["AGM_NoRadio_isMuted", true, true];
};
[missionNamespace, "playerChanged", {
[_this select 0] call AGM_Core_fnc_muteUnit;
(_this select 0) setVariable ["AGM_NoRadio_isMuted", true, true];
if (!((_this select 1) getVariable ["AGM_isUnconscious", false]) && {alive (_this select 1)}) then {
[_this select 1] call AGM_Core_fnc_unmuteUnit;
};
(_this select 1) setVariable ["AGM_NoRadio_isMuted", false, true];
}] call AGM_Core_fnc_addCustomEventHandler;

View File

@ -1,20 +0,0 @@
class CfgPatches {
class AGM_NoRadio {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"commy2"};
authorUrl = "https://github.com/commy2/";
};
};
class Extended_PostInit_EventHandlers {
class AGM_NoRadio {
clientInit = "call compile preprocessFileLineNumbers '\AGM_NoRadio\clientInit.sqf'";
serverInit = "call compile preprocessFileLineNumbers '\AGM_NoRadio\serverInit.sqf'";
};
};

View File

@ -1,8 +0,0 @@
// by commy2
addMissionEventHandler ["HandleDisconnect", {
if !((_this select 0) getVariable ["AGM_isUnconscious", false]) then {
_this call AGM_Core_fnc_unmuteUnit;
};
(_this select 0) setVariable ["AGM_NoRadio_isMuted", false, true];
}];

View File

@ -29,5 +29,5 @@
};
// don't show speed and height when in expert mode
["Parachute", {if (!cadetMode) then {_dlg = _this select 0; {(_dlg displayCtrl _x) ctrlShow false} forEach [121, 122, 1004, 1005, 1006, 1014];};}] call AGM_Core_fnc_addInfoDisplayEventHandler;
["Soldier", {if (!cadetMode) then {_dlg = _this select 0; {_ctrl = (_dlg displayCtrl _x); _ctrl ctrlSetPosition [0,0,0,0]; _ctrl ctrlCommit 0;} forEach [380, 382]};}] call AGM_Core_fnc_addInfoDisplayEventHandler;
["Parachute", {if (!cadetMode) then {_dlg = _this select 0; {(_dlg displayCtrl _x) ctrlShow false} forEach [121, 122, 1004, 1005, 1006, 1014];};}] call AGM_Core_fnc_addInfoDisplayEventHandler; //@todo addEventHandler infoDisplayChanged with select 1 == "Parachute"
["Soldier", {if (!cadetMode) then {_dlg = _this select 0; {_ctrl = (_dlg displayCtrl _x); _ctrl ctrlSetPosition [0,0,0,0]; _ctrl ctrlCommit 0;} forEach [380, 382]};}] call AGM_Core_fnc_addInfoDisplayEventHandler; //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"

View File

@ -1,366 +0,0 @@
// SEE LICENSE.TXT FOR LICENSING INFORMATION
class CfgPatches {
class AGM_Recoil {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"KoffeinFlummi", "TaoSensai", "commy2"};
authorUrl = "https://github.com/Taosenai/tmr";
};
};
class CfgFunctions {
class AGM_Recoil {
class AGM_Recoil {
file = "\AGM_Recoil\functions";
class burstDispersion;
class camshake;
};
};
};
class Extended_FiredBis_EventHandlers {
class CAManBase {
class AGM_Recoil_CamShake {
clientFiredBis = "if (_this select 0 == AGM_player) then {_this call AGM_Recoil_fnc_camshake; _this call AGM_Recoil_fnc_burstDispersion;};";
};
};
class Tank {
class AGM_Recoil_CamShake {
clientFiredBis = "if (_this select 0 == vehicle AGM_player) then {_this call AGM_Recoil_fnc_camshake;};";
};
};
class Car {
class AGM_Recoil_CamShake {
clientFiredBis = "if (_this select 0 == vehicle AGM_player) then {_this call AGM_Recoil_fnc_camshake;};";
};
};
class Helicopter {
class AGM_Recoil_CamShake {
clientFiredBis = "if (_this select 0 == vehicle AGM_player) then {_this call AGM_Recoil_fnc_camshake;};";
};
};
class Plane {
class AGM_Recoil_CamShake {
clientFiredBis = "if (_this select 0 == vehicle AGM_player) then {_this call AGM_Recoil_fnc_camshake;};";
};
};
class Ship_F {
class AGM_Recoil_CamShake {
clientFiredBis = "if (_this select 0 == vehicle AGM_player) then {_this call AGM_Recoil_fnc_camshake;};";
};
};
class StaticWeapon {
class AGM_Recoil_CamShake {
clientFiredBis = "if (_this select 0 == vehicle AGM_player) then {_this call AGM_Recoil_fnc_camshake;};";
};
};
};
// DOC: http://forums.bistudio.com/showthread.php?94464-explaining-the-cfgRecoils-array
class CfgRecoils {
#define KICKBACK 0.07
#define KICKBACKPRONE 0.05
#define MUZZLECLIMB 0.01
#define MUZZLERECOVERY -0.004
// BASE RECOILS
pistolBase[] = {0,0.8*KICKBACK,0.9*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.9*MUZZLERECOVERY, 0.3,0,0};
subMachineGunBase[] = {0,0.5*KICKBACK,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
assaultRifleBase[] = {0,1*KICKBACK,1*MUZZLECLIMB, 0.12,0,0, 0.15,0,1*MUZZLERECOVERY, 0.3,0,0};
machinegunBase[] = {0,1*KICKBACK,1*MUZZLECLIMB, 0.12,0,0, 0.15,0,1*MUZZLERECOVERY, 0.3,0,0};
launcherBase[] = {0,0,0};
// PISTOLS
recoil_pistol_light[] = {0,0.8*KICKBACK,0.9*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.9*MUZZLERECOVERY, 0.3,0,0};
recoil_pistol_heavy[] = {0,1.1*KICKBACK,1.4*MUZZLECLIMB, 0.12,0,0, 0.15,0,1.4*MUZZLERECOVERY, 0.3,0,0};
recoil_prone_pistol_light[] = {0,0.8*KICKBACKPRONE,0.9*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.9*MUZZLERECOVERY, 0.3,0,0};
recoil_prone_pistol_heavy[] = {0,1.1*KICKBACKPRONE,1.4*MUZZLECLIMB, 0.12,0,0, 0.15,0,1.4*MUZZLERECOVERY, 0.3,0,0};
// SUBMACHINE GUNS
recoil_single_smg_01[] = {0,0.5*KICKBACK,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
recoil_burst_smg_01[] = {0,0.5*KICKBACK,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_smg_01[] = {0,0.5*KICKBACK,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
recoil_single_prone_smg_01[] = {0,0.5*KICKBACKPRONE,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
recoil_burst_prone_smg_01[] = {0,0.5*KICKBACKPRONE,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_prone_smg_01[] = {0,0.5*KICKBACKPRONE,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
recoil_single_smg_02[] = {0,0.5*KICKBACK,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
recoil_burst_smg_02[] = {0,0.5*KICKBACK,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_smg_02[] = {0,0.5*KICKBACK,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
recoil_single_prone_smg_02[] = {0,0.5*KICKBACKPRONE,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
recoil_burst_prone_smg_02[] = {0,0.5*KICKBACKPRONE,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_prone_smg_02[] = {0,0.5*KICKBACKPRONE,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
recoil_single_pdw[] = {0,0.5*KICKBACK,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
recoil_burst_pdw[] = {0,0.5*KICKBACK,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_pdw[] = {0,0.5*KICKBACK,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
recoil_single_prone_pdw[] = {0,0.5*KICKBACKPRONE,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
recoil_burst_prone_pdw[] = {0,0.5*KICKBACKPRONE,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_prone_pdw[] = {0,0.5*KICKBACKPRONE,0.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.5*MUZZLERECOVERY, 0.3,0,0};
// ASSAULT RIFLES
recoil_single_mx[] = {0,1*KICKBACK,1*MUZZLECLIMB, 0.12,0,0, 0.15,0,1*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_mx[] = {0,1*KICKBACK,1*MUZZLECLIMB, 0.12,0,0, 0.15,0,1*MUZZLERECOVERY, 0.3,0,0};
recoil_single_prone_mx[] = {0,1*KICKBACKPRONE,1*MUZZLECLIMB, 0.12,0,0, 0.15,0,1*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_prone_mx[] = {0,1*KICKBACKPRONE,1*MUZZLECLIMB, 0.12,0,0, 0.15,0,1*MUZZLERECOVERY, 0.3,0,0};
recoil_single_ktb[] = {0,1*KICKBACK,1*MUZZLECLIMB, 0.12,0,0, 0.15,0,1*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_ktb[] = {0,1*KICKBACK,1*MUZZLECLIMB, 0.12,0,0, 0.15,0,1*MUZZLERECOVERY, 0.3,0,0};
recoil_single_prone_ktb[] = {0,1*KICKBACKPRONE,1*MUZZLECLIMB, 0.12,0,0, 0.15,0,1*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_prone_ktb[] = {0,1*KICKBACKPRONE,1*MUZZLECLIMB, 0.12,0,0, 0.15,0,1*MUZZLERECOVERY, 0.3,0,0};
recoil_single_mk20[] = {0,0.8*KICKBACK,0.8*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.8*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_mk20[] = {0,0.8*KICKBACK,0.8*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.8*MUZZLERECOVERY, 0.3,0,0};
recoil_single_prone_mk20[] = {0,0.8*KICKBACKPRONE,0.8*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.8*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_prone_mk20[] = {0,0.8*KICKBACKPRONE,0.8*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.8*MUZZLERECOVERY, 0.3,0,0};
recoil_single_trg[] = {0,0.8*KICKBACK,0.8*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.8*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_trg[] = {0,0.8*KICKBACK,0.8*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.8*MUZZLERECOVERY, 0.3,0,0};
recoil_single_prone_trg[] = {0,0.8*KICKBACKPRONE,0.8*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.8*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_prone_trg[] = {0,0.8*KICKBACKPRONE,0.8*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.8*MUZZLERECOVERY, 0.3,0,0};
recoil_single_sdar[] = {0,0.8*KICKBACK,0.8*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.8*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_sdar[] = {0,0.8*KICKBACK,0.8*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.8*MUZZLERECOVERY, 0.3,0,0};
recoil_single_prone_sdar[] = {0,0.8*KICKBACKPRONE,0.8*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.8*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_prone_sdar[] = {0,0.8*KICKBACKPRONE,0.8*MUZZLECLIMB, 0.12,0,0, 0.15,0,0.8*MUZZLERECOVERY, 0.3,0,0};
// MACHINE GUNS
recoil_single_mk200[] = {0,1*KICKBACK,1*MUZZLECLIMB, 0.12,0,0, 0.15,0,1*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_mk200[] = {0,1*KICKBACK,1*MUZZLECLIMB, 0.12,0,0, 0.15,0,1*MUZZLERECOVERY, 0.3,0,0};
recoil_single_prone_mk200[] = {0,1*KICKBACKPRONE,1*MUZZLECLIMB, 0.12,0,0, 0.15,0,1*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_prone_mk200[] = {0,1*KICKBACKPRONE,1*MUZZLECLIMB, 0.12,0,0, 0.15,0,1*MUZZLERECOVERY, 0.3,0,0};
recoil_single_zafir[] = {0,1.5*KICKBACK,1.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,1.5*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_zafir[] = {0,1.5*KICKBACK,1.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,1.5*MUZZLERECOVERY, 0.3,0,0};
recoil_single_prone_zafir[] = {0,1.5*KICKBACKPRONE,1.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,1.5*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_prone_zafir[] = {0,1.5*KICKBACKPRONE,1.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,1.5*MUZZLERECOVERY, 0.3,0,0};
// PRECISION RIFLES
recoil_single_dmr[] = {0,1.5*KICKBACK,1.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,1.5*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_dmr[] = {0,1.5*KICKBACK,1.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,1.5*MUZZLERECOVERY, 0.3,0,0};
recoil_single_prone_dmr[] = {0,1.5*KICKBACKPRONE,1.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,1.5*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_prone_dmr[] = {0,1.5*KICKBACKPRONE,1.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,1.5*MUZZLERECOVERY, 0.3,0,0};
recoil_single_ebr[] = {0,1.5*KICKBACK,1.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,1.5*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_ebr[] = {0,1.5*KICKBACK,1.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,1.5*MUZZLERECOVERY, 0.3,0,0};
recoil_single_prone_ebr[] = {0,1.5*KICKBACKPRONE,1.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,1.5*MUZZLERECOVERY, 0.3,0,0};
recoil_auto_prone_ebr[] = {0,1.5*KICKBACKPRONE,1.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,1.5*MUZZLERECOVERY, 0.3,0,0};
recoil_single_gm6[] = {0,2.5*KICKBACK,2.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,2.5*MUZZLERECOVERY, 0.3,0,0};
recoil_single_prone_gm6[] = {0,2.5*KICKBACKPRONE,2.5*MUZZLECLIMB, 0.12,0,0, 0.15,0,2.5*MUZZLERECOVERY, 0.3,0,0};
// LAUNCHERS
recoil_single_law[] = {0,0,0};
recoil_single_nlaw[] = {0,0,0};
recoil_single_titan[] = {0,0,0};
};
class CfgCameraShake {
// What does this do, really? It seems like the engine no longer respects it.
defaultCaliberCoefWeaponFire = 0;
};
// Completely disable BI's camshake on fire.
#define AGM_CAMSHAKEFIRE_BASE 0
#define AGM_CAMSHAKEFIRE_LESS 0
#define AGM_CAMSHAKEFIRE_MORE 0
// Go through all modes that have a camshakefire defined and change it to ours.
class CfgMovesBasic {
class Default {
camShakeFire = AGM_CAMSHAKEFIRE_BASE;
};
};
class CfgMovesMaleSdr : CfgMovesBasic {
class States {
class AmovPercMstpSlowWrflDnon;
class AmovPknlMstpSlowWrflDnon : AmovPercMstpSlowWrflDnon {
camShakeFire = AGM_CAMSHAKEFIRE_LESS;
};
class AmovPercMstpSrasWrflDnon;
class AmovPpneMstpSrasWrflDnon : AmovPercMstpSrasWrflDnon {
camShakeFire = AGM_CAMSHAKEFIRE_LESS;
};
class AmovPknlMstpSrasWlnrDnon : Default {
camShakeFire = AGM_CAMSHAKEFIRE_LESS;
};
class AmovPknlMrunSlowWrflDf;
class AmovPknlMtacSlowWrflDf : AmovPknlMrunSlowWrflDf {
camShakeFire = AGM_CAMSHAKEFIRE_MORE;
};
class AmovPknlMrunSlowWrflDfl;
class AmovPknlMtacSlowWrflDfl : AmovPknlMrunSlowWrflDfl {
camShakeFire = AGM_CAMSHAKEFIRE_MORE;
};
class AmovPknlMrunSlowWrflDl;
class AmovPknlMtacSlowWrflDl : AmovPknlMrunSlowWrflDl {
camShakeFire = AGM_CAMSHAKEFIRE_MORE;
};
class AmovPknlMrunSlowWrflDbl;
class AmovPknlMtacSlowWrflDbl : AmovPknlMrunSlowWrflDbl {
camShakeFire = AGM_CAMSHAKEFIRE_MORE;
};
class AmovPknlMrunSlowWrflDb;
class AmovPknlMtacSlowWrflDb : AmovPknlMrunSlowWrflDb {
camShakeFire = AGM_CAMSHAKEFIRE_MORE;
};
class AmovPknlMrunSlowWrflDbr;
class AmovPknlMtacSlowWrflDbr : AmovPknlMrunSlowWrflDbr {
camShakeFire = AGM_CAMSHAKEFIRE_MORE;
};
class AmovPknlMrunSlowWrflDr;
class AmovPknlMtacSlowWrflDr : AmovPknlMrunSlowWrflDr {
camShakeFire = AGM_CAMSHAKEFIRE_MORE;
};
class AmovPknlMrunSlowWrflDfr;
class AmovPknlMtacSlowWrflDfr : AmovPknlMrunSlowWrflDfr {
camShakeFire = AGM_CAMSHAKEFIRE_MORE;
};
class AmovPknlMstpSrasWrflDnon;
class AmovPknlMwlkSrasWrflDf : AmovPknlMstpSrasWrflDnon {
camShakeFire = AGM_CAMSHAKEFIRE_BASE;
};
class AmovPknlMrunSrasWrflDf;
class AmovPknlMtacSrasWrflDf : AmovPknlMrunSrasWrflDf {
camShakeFire = AGM_CAMSHAKEFIRE_MORE;
};
class AmovPknlMwlkSrasWpstDf;
class AmovPknlMtacSrasWpstDf : AmovPknlMwlkSrasWpstDf {
camShakeFire = AGM_CAMSHAKEFIRE_MORE;
};
};
};
// Ammo
class CfgAmmo {
class MissileCore;
class MissileBase: MissileCore {
AGM_Recoil_shakeMultiplier = 2;
};
class BombCore;
class LaserBombCore: BombCore {
AGM_Recoil_shakeMultiplier = 2;
};
class Bo_Mk82: BombCore {
AGM_Recoil_shakeMultiplier = 2;
};
class RocketCore;
class ArtilleryRocketCore: RocketCore {
AGM_Recoil_shakeMultiplier = 1.4;
};
class RocketBase: RocketCore {
AGM_Recoil_shakeMultiplier = 1.4;
};
class BulletCore;
class BulletBase: BulletCore {
AGM_Recoil_shakeMultiplier = 1;
};
class ShotgunCore;
class ShotgunBase: ShotgunCore {
AGM_Recoil_shakeMultiplier = 1.1;
};
class ShellCore;
class ShellBase: ShellCore {
AGM_Recoil_shakeMultiplier = 3;
};
class SubmunitionCore;
class SubmunitionBase: SubmunitionCore {
AGM_Recoil_shakeMultiplier = 3;
};
class ShotDeployCore;
class ShotDeployBase: ShotDeployCore {
AGM_Recoil_shakeMultiplier = 3;
};
};
// Weapons
// 1. Set the recoil profiles for all fire modes.
// 2. Set the shake multiplier. This determines the camshake for the weapon.
// Ex: agm_recoil_shakeMultiplier = 1;
// disabled currently
#define SHAKEMULTIPLIER_BASE 0
class CfgWeapons {
class CannonCore;
class autocannon_Base_F: CannonCore {
agm_recoil_shakeMultiplier = SHAKEMULTIPLIER_BASE;
};
class autocannon_35mm: CannonCore {
agm_recoil_shakeMultiplier = SHAKEMULTIPLIER_BASE;
};
class cannon_120mm: CannonCore {
agm_recoil_shakeMultiplier = SHAKEMULTIPLIER_BASE;
};
class mortar_155mm_AMOS: CannonCore {
agm_recoil_shakeMultiplier = SHAKEMULTIPLIER_BASE;
};
class mortar_82mm: CannonCore {
agm_recoil_shakeMultiplier = SHAKEMULTIPLIER_BASE;
};
// No camshake for gatlings
class gatling_20mm: CannonCore {
agm_recoil_shakeMultiplier = 0;
};
class gatling_25mm: CannonCore {
agm_recoil_shakeMultiplier = 0;
};
class gatling_30mm: CannonCore {
agm_recoil_shakeMultiplier = 0;
};
class MGunCore;
class MGun: MGunCore {
agm_recoil_shakeMultiplier = SHAKEMULTIPLIER_BASE;
};
// No camshake for smoke launchers
class SmokeLauncher: MGun {
agm_recoil_shakeMultiplier = 0;
};
// No camshake for coax machine guns
class LMG_RCWS;
class LMG_M200: LMG_RCWS {
agm_recoil_shakeMultiplier = 0;
};
class LMG_coax: LMG_RCWS {
agm_recoil_shakeMultiplier = 0;
};
class LMG_Minigun: LMG_RCWS {
agm_recoil_shakeMultiplier = 0;
};
};
// Vehicles
class CfgVehicles {
class LandVehicle;
class Tank: LandVehicle {
AGM_enableCamshake = 1;
};
class Car: LandVehicle {
AGM_enableCamshake = 1;
};
class StaticWeapon: LandVehicle {
AGM_enableCamshake = 1;
};
class Allvehicles;
class Air: Allvehicles {
AGM_enableCamshake = 1;
};
};

View File

@ -1,73 +0,0 @@
class CfgPatches {
class AGM_Reload {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"commy2", "KoffeinFlummi"};
authorUrl = "https://github.com/commy2/";
};
};
class CfgFunctions {
class AGM_Reload {
class AGM_Reload {
file = "\AGM_Reload\functions";
class checkAmmo;
};
};
};
class Extended_Take_EventHandlers {
class CAManBase {
class AGM_AmmoIndicatorReload {
clientTake = "if (_this select 0 == AGM_player && {(_this select 1) in [uniformContainer (_this select 0), vestContainer (_this select 0), backpackContainer (_this select 0)]} && {_this select 2 == currentMagazine (_this select 0)}) then {[_this select 0, vehicle (_this select 0), true] call AGM_Reload_fnc_checkAmmo};";
};
};
};
class AGM_Core_Default_Keys {
class checkAmmo {
displayName = "$STR_AGM_Reload_checkAmmo";
condition = "[_player] call AGM_Core_fnc_canUseWeapon || {_vehicle isKindOf 'StaticWeapon'}";
statement = "[_player, _vehicle, false] call AGM_Reload_fnc_checkAmmo";
key = 19;
shift = 0;
control = 1;
alt = 0;
};
};
class CfgActions {
class LoadMagazine;
class LoadEmptyMagazine : LoadMagazine {
showWindow = 0;
textDefault = "";
};
};
class RscControlsGroup;
class RscText;
class RscInGameUI {
class RscUnitInfo {
// Soldier only
class WeaponInfoControlsGroupLeft: RscControlsGroup {
class controls {
class CA_AmmoCount: RscText {
sizeEx = 0;
};
};
};
// Vehicles only
/*class WeaponInfoControlsGroupRight: RscControlsGroup {
class controls {
class CA_AmmoCount: RscText {
sizeEx = 0;
};
};
};*/
};
};

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +0,0 @@
// by commy2
private ["_weapon", "_config"];
_weapon = _this select 0;
_config = configFile >> "CfgWeapons" >> _weapon;
getNumber (_config >> "AGM_Bipod") == 1 || {getNumber (_config >> "tmr_autorest_deployable") == 1}

View File

@ -1,191 +0,0 @@
/*
* Author: KoffeinFlummi, edited by commy2
*
* Rests the player's weapon if possible.
*
* Arguments:
* None
*
* Return Values:
* None
*
*/
#define RESTEDRECOIL 0.6
#define BIPODRECOIL 0.3
#define MAXDISTANCE 1
#define MAXANGLE 15
#define MAXHEIGHT 0.45
#define CAMSHAKE [1,0.5,5]
private ["_unit", "_vehicle", "_weapon"];
_unit = _this select 0;
_vehicle = _this select 1;
_weapon = _this select 2;
if (_weapon != primaryWeapon _unit) exitWith {};
// UNREST THE WEAPON
private "_fnc_unRestWeapon";
_fnc_unRestWeapon = {
addCamShake CAMSHAKE;
private "_animation";
_animation = animationState _unit;
if (_unit getVariable ["AGM_bipodDeployed", false]) then {
_unit setUnitRecoilCoefficient (unitRecoilCoefficient _unit / BIPODRECOIL);
if (_animation find "_agm_deploy" != -1) then {
//[_unit, [_animation, "_agm_deploy", ""] call CBA_fnc_replace, 2] call AGM_Core_fnc_doAnimation;
_unit switchMove ([_animation, "_agm_deploy", ""] call CBA_fnc_replace);
};
private "_picture";
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
[localize "STR_AGM_Resting_BipodUndeployed", _picture] call AGM_Core_fnc_displayTextPicture;
} else {
_unit setUnitRecoilCoefficient (unitRecoilCoefficient _unit / RESTEDRECOIL);
if (_animation find "_agm_rested" != -1) then {
//[_unit, [_animation, "_agm_rested", ""] call CBA_fnc_replace, 2] call AGM_Core_fnc_doAnimation;
_unit switchMove ([_animation, "_agm_rested", ""] call CBA_fnc_replace);
};
private "_picture";
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
[localize "STR_AGM_Resting_WeaponLifted", _picture] call AGM_Core_fnc_displayTextPicture;
};
_unit setVariable ["AGM_weaponRested", false];
_unit setVariable ["AGM_bipodDeployed", false];
};
if (_unit getVariable ["AGM_weaponRested", false]) exitWith {call _fnc_unRestWeapon};
// exit if this is not an available animation
if (!isClass (configFile >> "CfgMovesMaleSdr" >> "States" >> format ["%1_agm_deploy", animationState _unit])) exitWith {};
// PREPARE INTERSECTS
private "_fnc_getIntersection";
_fnc_getIntersection = {
private ["_weaponPos", "_weaponDir", "_weaponPosDown"];
_weaponPos = ATLtoASL (_unit modelToWorld (_unit selectionPosition "RightHand"));
_weaponDir = _unit weaponDirection _weapon;
_weaponPosDown = _weaponPos vectorAdd [0,0,-MAXHEIGHT];
private ["_checkPosMiddle", "_checkPosLeft", "_checkPosRight", "_checkPosDown"];
_checkPosMiddle = [
(_weaponPos select 0) + MAXDISTANCE * (_weaponDir select 0),
(_weaponPos select 1) + MAXDISTANCE * (_weaponDir select 1),
(_weaponPos select 2) + MAXDISTANCE * (_weaponDir select 2)
];
_checkPosLeft = [
(_weaponPos select 0) + MAXDISTANCE * sin (((_weaponDir select 0) atan2 (_weaponDir select 1)) + 360 - MAXANGLE),
(_weaponPos select 1) + MAXDISTANCE * cos (((_weaponDir select 0) atan2 (_weaponDir select 1)) + 360 - MAXANGLE),
(_weaponPos select 2) + MAXDISTANCE * (_weaponDir select 2)
];
_checkPosRight = [
(_weaponPos select 0) + MAXDISTANCE * sin (((_weaponDir select 0) atan2 (_weaponDir select 1)) + MAXANGLE),
(_weaponPos select 1) + MAXDISTANCE * cos (((_weaponDir select 0) atan2 (_weaponDir select 1)) + MAXANGLE),
(_weaponPos select 2) + MAXDISTANCE * (_weaponDir select 2)
];
_checkPosDown = [
(_weaponPos select 0) + MAXDISTANCE * (_weaponDir select 0),
(_weaponPos select 1) + MAXDISTANCE * (_weaponDir select 1),
(_weaponPos select 2) + MAXDISTANCE * (_weaponDir select 2) - MAXHEIGHT
];
/* UNCOMMENT THIS FOR DEBUGGING
weaponPos = ASLtoATL _weaponPos;
weaponPosDown = ASLtoATL _weaponPosDown;
checkPosMiddle = ASLtoATL _checkPosMiddle;
checkPosLeft = ASLtoATL _checkPosLeft;
checkPosRight = ASLtoATL _checkPosRight;
checkPosDown = ASLtoATL _checkPosDown;
onEachFrame {
drawLine3D [weaponPos, checkPosMiddle, [1,0,0,1]];
drawLine3D [weaponPos, checkPosLeft, [1,0,0,1]];
drawLine3D [weaponPos, checkPosRight, [1,0,0,1]];
drawLine3D [weaponPosDown, checkPosDown, [1,0,0,1]];
};*/
private ["_intersectsMiddle", "_intersectsLeft", "_intersectsRight", "_intersectsDown"];
_intersectsMiddle = lineIntersects [_weaponPos, _checkPosMiddle];
_intersectsLeft = lineIntersects [_weaponPos, _checkPosLeft];
_intersectsRight = lineIntersects [_weaponPos, _checkPosRight];
_intersectsDown = lineIntersects [_weaponPos, _checkPosDown] || {terrainIntersectASL [_weaponPosDown, _checkPosDown]};
[_intersectsMiddle, _intersectsLeft, _intersectsRight, _intersectsDown]
};
// CHECK FOR APPROPRIATE SURFACE
private "_intersects";
_intersects = call _fnc_getIntersection;
if (true in _intersects) then {
_unit setVariable ["AGM_weaponRested", true];
private "_restedPosition";
_restedPosition = getPosASL _unit;
// REST THE WEAPON
addCamShake CAMSHAKE;
if ([_weapon] call AGM_Resting_fnc_hasBipod && {_intersects select 3}) then {
_unit setVariable ["AGM_bipodDeployed", true];
_unit setUnitRecoilCoefficient (BIPODRECOIL * unitRecoilCoefficient _unit);
//[_unit, format ["%1_agm_deploy", animationState _unit], 2] call AGM_Core_fnc_doAnimation;
_unit switchMove format ["%1_agm_deploy", animationState _unit];
private "_picture";
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
[localize "STR_AGM_Resting_BipodDeployed", _picture] call AGM_Core_fnc_displayTextPicture;
} else {
_unit setVariable ["AGM_bipodDeployed", false];
_unit setUnitRecoilCoefficient (RESTEDRECOIL * unitRecoilCoefficient _unit);
//[_unit, format ["%1_agm_rested", animationState _unit], 2] call AGM_Core_fnc_doAnimation;
_unit switchMove format ["%1_agm_rested", animationState _unit];
private "_picture";
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
[localize "STR_AGM_Resting_WeaponRested", _picture] call AGM_Core_fnc_displayTextPicture;
};
// CHECK FOR PLAYER MOVING AWAY, CHANGING WEAPONS ETC
[_unit, _vehicle, _weapon, _fnc_unRestWeapon, _fnc_getIntersection, _restedPosition] spawn {
_unit = _this select 0;
_vehicle = _this select 1;
_weapon = _this select 2;
_fnc_unRestWeapon = _this select 3;
_fnc_getIntersection = _this select 4;
_restedPosition = _this select 5;
while {_unit getVariable ["AGM_weaponRested", false]} do {
_intersects = call _fnc_getIntersection;
if (
_unit != AGM_player
|| {_vehicle != vehicle _unit}
|| {inputAction "reloadMagazine" != 0}
|| {weaponLowered _unit}
|| {speed _unit > 1}
|| {currentWeapon _unit != _weapon}
|| {getPosASL _unit distanceSqr _restedPosition > 1}
|| {!(true in _intersects)}
) exitWith {call _fnc_unRestWeapon};
sleep 0.3;
};
};
};

View File

@ -2,3 +2,4 @@
// by commy2
//["Soldier", {_player = AGM_player; if (currentWeapon _player in (_player getVariable ["AGM_SafeMode_safedWeapons", []])) then {[false] call AGM_SafeMode_setSafeModeVisual}] call AGM_Core_fnc_addInfoDisplayEventHandler;
//@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"

View File

@ -1,467 +0,0 @@
class CfgPatches {
class AGM_Vehicles {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"commy2", "KoffeinFlummi"};
authorUrl = "https://github.com/KoffeinFlummi/";
};
};
class CfgFunctions {
class AGM_Vehicles {
class AGM_Vehicles {
file = "AGM_Vehicles\functions";
class speedLimiter;
class startEngine;
};
};
};
class AGM_Core_Default_Keys {
class speedLimiter {
displayName = "$STR_AGM_SpeedLimiter";
condition = "_player == driver _vehicle && {_vehicle isKindOf 'Car' || {_vehicle isKindOf 'Tank'}}";
statement = "[_player, _vehicle] call AGM_Vehicles_fnc_speedLimiter";
key = 211;
shift = 0;
control = 0;
alt = 0;
};
};
class Extended_Engine_EventHandlers {
class Car {
class AGM_EngineStartDelay {
clientEngine = "_this call AGM_Vehicles_fnc_startEngine";
};
};
};
#define FUEL_FACTOR 0.165
// fuel capacity = range in km * FUEL_FACTOR
class CfgVehicles {
class All {
class Turrets {};
};
class AllVehicles: All {
class NewTurret {
class Turrets {};
};
};
class Land: AllVehicles {};
class LandVehicle: Land {
class CommanderOptics: NewTurret {};
};
class Car: LandVehicle {};
class Tank: LandVehicle {
class Turrets {
class MainTurret: NewTurret {
class Turrets {
class CommanderOptics: NewTurret {};
};
};
};
};
class APC: Tank {
class Turrets: Turrets {
class MainTurret: MainTurret {};
};
};
class Ship: AllVehicles {
class Turrets {
class MainTurret;
};
};
class Tank_F: Tank {
class Turrets {
class MainTurret: NewTurret {
class Turrets {
class CommanderOptics: CommanderOptics {};
};
};
};
};
class Car_F: Car {
class Turrets {
class MainTurret: NewTurret {};
};
};
class Wheeled_APC_F: Car_F {
class Turrets {
class MainTurret: NewTurret {
class Turrets {
class CommanderOptics: CommanderOptics {};
};
};
};
};
class APC_Tracked_01_base_F: Tank_F {
fuelCapacity = 500 * FUEL_FACTOR;
class Turrets: Turrets {
class MainTurret: MainTurret {
class Turrets {};
};
};
};
class APC_Tracked_02_base_F: Tank_F {
fuelCapacity = 600 * FUEL_FACTOR; // NO FUCKING DATA
class Turrets: Turrets {
class MainTurret: MainTurret {
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};
};
};
};
class O_APC_Tracked_02_base_F: APC_Tracked_02_base_F {};
class O_APC_Tracked_02_cannon_F: O_APC_Tracked_02_base_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
weapons[] = {"autocannon_30mm_CTWS","AGM_LMG_coax_MBT_01","missiles_titan"};
magazines[] = {"140Rnd_30mm_MP_shells_Tracer_Green","60Rnd_30mm_APFSDS_shells_Tracer_Green","2000Rnd_762x51_Belt_Green","2Rnd_GAT_missiles"};
};
};
};
class APC_Tracked_03_base_F: Tank_F {
fuelCapacity = 660 * FUEL_FACTOR;
class Turrets: Turrets {
class MainTurret: MainTurret {
weapons[] = {"autocannon_30mm","AGM_LMG_coax_APC_Tracked_03"};
magazines[] = {"140Rnd_30mm_MP_shells_Tracer_Yellow","60Rnd_30mm_APFSDS_shells_Tracer_Yellow","1000Rnd_762x51_Belt_Yellow","1000Rnd_762x51_Belt_Yellow"};
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};
};
};
};
class MBT_03_base_F: Tank_F {
fuelCapacity = 550 * FUEL_FACTOR;
class Turrets: Turrets {
class MainTurret: MainTurret {
weapons[] = {"cannon_120mm_long","AGM_LMG_coax_MBT_01"};
magazines[] = {"28Rnd_120mm_APFSDS_shells_Tracer_Yellow","14Rnd_120mm_HE_shells_Tracer_Yellow","2000Rnd_762x51_Belt_Yellow","2000Rnd_762x51_Belt_Yellow"};
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};
};
};
};
class MBT_01_base_F: Tank_F {
fuelCapacity = 500 * FUEL_FACTOR;
class Turrets: Turrets {
class MainTurret: MainTurret {
weapons[] = {"cannon_120mm","AGM_LMG_coax_MBT_01"};
magazines[] = {"32Rnd_120mm_APFSDS_shells_Tracer_Red","16Rnd_120mm_HE_shells_Tracer_Red","2000Rnd_762x51_Belt_Green","2000Rnd_762x51_Belt_Green"};
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};
};
};
};
class B_MBT_01_base_F: MBT_01_base_F {};
class B_MBT_01_cannon_F: B_MBT_01_base_F {};
class MBT_02_base_F: Tank_F {
fuelCapacity = 600 * FUEL_FACTOR; // again, couldn't find proper data
class Turrets: Turrets {
class MainTurret: MainTurret {
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};
};
};
};
class Ship_F: Ship {};
class Boat_F: Ship_F {};
class Boat_Armed_01_base_F: Boat_F {
class Turrets: Turrets {
class FrontTurret;
class RearTurret: FrontTurret {};
};
};
class Boat_Armed_01_minigun_base_F: Boat_Armed_01_base_F {};
class B_Boat_Armed_01_minigun_F: Boat_Armed_01_minigun_base_F {
class Turrets: Turrets {
class FrontTurret: FrontTurret {};
class RearTurret: RearTurret {
magazines[] = {"2000Rnd_762x51_Belt_T_Red"};
};
};
};
class I_Boat_Armed_01_minigun_F: Boat_Armed_01_minigun_base_F {
class Turrets: Turrets {
class FrontTurret: FrontTurret {};
class RearTurret: RearTurret {
magazines[] = {"2000Rnd_762x51_Belt_T_Yellow"};
};
};
};
class Truck_F: Car_F {
class Turrets: Turrets {};
};
class MRAP_01_base_F: Car_F {
fuelCapacity = 510 * FUEL_FACTOR;
};
class MRAP_02_base_F: Car_F {
fuelCapacity = 500 * FUEL_FACTOR; // couldn't find any data for the punisher
};
class O_MRAP_02_F: MRAP_02_base_F {
class Turrets {};
};
class Offroad_01_base_F: Car_F {
//fuelCapacity = 45;
};
class MRAP_03_base_F: Car_F {
fuelCapacity = 860 * FUEL_FACTOR;
smokeLauncherGrenadeCount = 3;
smokeLauncherAngle = 80;
class Turrets: Turrets {
class CommanderTurret: MainTurret {
stabilizedInAxes = 3;
};
};
};
class MRAP_03_hmg_base_F: MRAP_03_base_F {
smokeLauncherGrenadeCount = 3;
smokeLauncherAngle = 80;
class Turrets: Turrets {
class MainTurret: MainTurret {};
class CommanderTurret: CommanderTurret {
stabilizedInAxes = 3;
};
};
};
class MRAP_03_gmg_base_F: MRAP_03_hmg_base_F {
smokeLauncherGrenadeCount = 3;
smokeLauncherAngle = 80;
class Turrets: Turrets {
class MainTurret: MainTurret {};
class CommanderTurret: CommanderTurret {
stabilizedInAxes = 3;
};
};
};
class Truck_01_base_F: Truck_F {
fuelCapacity = 644 * FUEL_FACTOR;
class Turrets {};
};
class Truck_02_base_F: Truck_F {
fuelCapacity = 1100 * FUEL_FACTOR;
class Turrets {};
};
class Truck_03_base_F: Truck_F {
fuelCapacity = 900 * FUEL_FACTOR; // NO. FUCKING. DATA.
class Turrets {};
};
class Hatchback_01_base_F: Car_F {
//fuelCapacity = 45;
class Turrets {};
};
class SUV_01_base_F: Car_F {
//fuelCapacity = 45;
class Turrets {};
};
class Van_01_base_F: Truck_F {
//fuelCapacity = 45;
class Turrets {};
};
class APC_Wheeled_01_base_F: Wheeled_APC_F {
fuelCapacity = 800 * FUEL_FACTOR;
class Turrets: Turrets {
class MainTurret: MainTurret {
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};
};
};
};
class B_APC_Wheeled_01_base_F: APC_Wheeled_01_base_F {};
class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
weapons[] = {"autocannon_40mm_CTWS","AGM_LMG_coax_MBT_01"};
magazines[] = {"60Rnd_40mm_GPR_Tracer_Red_shells","40Rnd_40mm_APFSDS_Tracer_Red_shells","2000Rnd_762x51_Belt_Green"};
};
};
};
class APC_Wheeled_02_base_F: Wheeled_APC_F {
fuelCapacity = 700 * FUEL_FACTOR;
class Turrets: Turrets {
class MainTurret: MainTurret {
class Turrets {};
};
class CommanderOptics: CommanderOptics {};
};
};
class B_MBT_01_TUSK_F: B_MBT_01_cannon_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
weapons[] = {"cannon_105mm","AGM_LMG_coax_MBT_01"};
magazines[] = {"40Rnd_105mm_APFSDS_T_Red","20Rnd_105mm_HEAT_MP_T_Red","2000Rnd_762x51_Belt_Green","2000Rnd_762x51_Belt_Green"};
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};
};
};
};
class APC_Wheeled_03_base_F: Wheeled_APC_F {
fuelCapacity = 700 * FUEL_FACTOR;
class Turrets: Turrets {
class MainTurret: MainTurret {
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};
};
};
};
class I_APC_Wheeled_03_base_F: APC_Wheeled_03_base_F {};
class I_APC_Wheeled_03_cannon_F: I_APC_Wheeled_03_base_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
weapons[] = {"autocannon_30mm_CTWS","AGM_LMG_coax_MBT_01","missiles_titan"};
magazines[] = {"140Rnd_30mm_MP_shells_Tracer_Yellow","60Rnd_30mm_APFSDS_shells_Tracer_Yellow","2000Rnd_762x51_Belt_Yellow","2Rnd_GAT_missiles"};
};
};
};
};
class CfgWeapons {
class MGunCore;
class MGun: MGunCore {};
class LMG_RCWS: MGun {};
class LMG_coax;
class AGM_LMG_coax_MBT_01: LMG_coax {};
class AGM_LMG_coax_APC_Tracked_03: LMG_coax {};
class autocannon_Base_F;
class LMG_Minigun: LMG_RCWS {
magazines[] = {"1000Rnd_65x39_Belt","1000Rnd_65x39_Belt_Green","1000Rnd_65x39_Belt_Tracer_Green","1000Rnd_65x39_Belt_Tracer_Red","1000Rnd_65x39_Belt_Tracer_Yellow","1000Rnd_65x39_Belt_Yellow","2000Rnd_65x39_Belt","2000Rnd_65x39_Belt_Green","2000Rnd_65x39_Belt_Tracer_Green","2000Rnd_65x39_Belt_Tracer_Green_Splash","2000Rnd_65x39_Belt_Tracer_Red","2000Rnd_65x39_Belt_Tracer_Yellow","2000Rnd_65x39_Belt_Tracer_Yellow_Splash","2000Rnd_65x39_Belt_Yellow","2000Rnd_762x51_Belt_T_Green","2000Rnd_762x51_Belt_T_Red","2000Rnd_762x51_Belt_T_Yellow","200Rnd_65x39_Belt","200Rnd_65x39_Belt_Tracer_Green","200Rnd_65x39_Belt_Tracer_Red","200Rnd_65x39_Belt_Tracer_Yellow","5000Rnd_762x51_Belt","5000Rnd_762x51_Yellow_Belt"};
class manual: MGun {
reloadTime = 0.015;
dispersion = 0.006;
};
class close: manual{};
class short: close{};
class medium: close{};
class far: close{};
};
class HMG_127: LMG_RCWS {
class manual: MGun {};
};
class HMG_01: HMG_127 {
reloadTime = 0.23;
class manual: manual {
reloadTime = 0.23;
};
class close: manual {
reloadTime = 0.23;
};
class short: close {
reloadTime = 0.23;
};
class medium: close {
reloadTime = 0.23;
};
class far: close {
reloadTime = 0.23;
};
};
class autocannon_30mm_CTWS: autocannon_Base_F {
class AP: autocannon_Base_F {
magazines[] = {"60Rnd_30mm_APFSDS_shells","60Rnd_30mm_APFSDS_shells_Tracer_Red","60Rnd_30mm_APFSDS_shells_Tracer_Green","60Rnd_30mm_APFSDS_shells_Tracer_Yellow","140Rnd_30mm_MP_shells","140Rnd_30mm_MP_shells_Tracer_Red","140Rnd_30mm_MP_shells_Tracer_Green","140Rnd_30mm_MP_shells_Tracer_Yellow"};
magazineReloadTime = 0;
};
muzzles[] = {"AP"};
};
class autocannon_40mm_CTWS: autocannon_Base_F {
class AP: autocannon_Base_F {
magazines[] = {"40Rnd_40mm_APFSDS_shells","40Rnd_40mm_APFSDS_Tracer_Red_shells","40Rnd_40mm_APFSDS_Tracer_Green_shells","40Rnd_40mm_APFSDS_Tracer_Yellow_shells","60Rnd_40mm_GPR_shells","60Rnd_40mm_GPR_Tracer_Red_shells","60Rnd_40mm_GPR_Tracer_Green_shells","60Rnd_40mm_GPR_Tracer_Yellow_shells"};
magazineReloadTime = 0;
};
muzzles[] = {"AP"};
};
// comp RHS
class RHS_weap_M242BC: autocannon_30mm_CTWS {
muzzles[] = {"AP","HE"};
};
};
class CfgAmmo {
class MissileBase;
class M_Mo_120mm_AT: MissileBase {
cost = 400000; // Stop it from aiming at FUCKING RABBITS.
weaponLockSystem = 2;
};
class M_Mo_120mm_AT_LG: M_Mo_120mm_AT {
cost = 400000;
weaponLockSystem = 4;
};
class M_Mo_82mm_AT: MissileBase {
cost = 400000;
weaponLockSystem = 2;
};
class M_Mo_82mm_AT_LG: M_Mo_82mm_AT {
cost = 400000;
weaponLockSystem = 4;
};
};

View File

@ -1,33 +0,0 @@
// by commy2
_this spawn {
_player = _this select 0;
_vehicle = _this select 1;
if (missionNamespace getVariable ["AGM_isSpeedLimiter", false]) exitWith {
[localize "STR_AGM_SpeedLimiter_Off"] call AGM_Core_fnc_displayTextStructured;
playSound "AGM_Sound_Click";
AGM_isSpeedLimiter = false;
};
[localize "STR_AGM_SpeedLimiter_On"] call AGM_Core_fnc_displayTextStructured;
playSound "AGM_Sound_Click";
AGM_isSpeedLimiter = true;
_maxSpeed = speed _vehicle;
if (_maxSpeed < 10) then {_maxSpeed = 10};
waitUntil {
_speed = speed _vehicle;
if (_speed > _maxSpeed) then {
_velocity = velocity _vehicle;
_vehicle setVelocity [
(_velocity select 0) * _maxSpeed / _speed,
(_velocity select 1) * _maxSpeed / _speed,
(_velocity select 2) * _maxSpeed / _speed
];
};
!AGM_isSpeedLimiter || {_player != driver _vehicle}
};
AGM_isSpeedLimiter = false;
};

View File

@ -1,25 +0,0 @@
// by commy2
#define STARTUP_DELAY 1.3
private ["_vehicle", "_isEngineOn", "_player"];
_vehicle = _this select 0;
_isEngineOn = _this select 1;
_player = AGM_player;
if (_isEngineOn && {_player == driver _vehicle} && {speed _vehicle == 0}) then {
[_vehicle] spawn {
_vehicle = _this select 0;
_direction = [vectorDir _vehicle, vectorUp _vehicle];
_time = time + STARTUP_DELAY;
waitUntil {
_vehicle setVelocity [0, 0, 0];
_vehicle setVectorDirAndUp _direction;
time > _time
};
};
};

View File

@ -46,4 +46,4 @@ AGM_WeaponSelect_AllMagazines = uiNamespace getVariable "AGM_WeaponSelect_Al
// hide grenade count if none is selected
[uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
["Soldier", {[_this select 0, call AGM_WeaponSelect_fnc_getSelectedGrenade != ""] call AGM_WeaponSelect_fnc_toggleGrenadeCount}] call AGM_Core_fnc_addInfoDisplayEventHandler;
["Soldier", {[_this select 0, call AGM_WeaponSelect_fnc_getSelectedGrenade != ""] call AGM_WeaponSelect_fnc_toggleGrenadeCount}] call AGM_Core_fnc_addInfoDisplayEventHandler; //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"

View File

@ -5,8 +5,8 @@
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_ENABLED_AI
#define DEBUG_SETTINGS DEBUG_ENABLED_AI
#ifdef DEBUG_SETTINGS_AI
#define DEBUG_SETTINGS DEBUG_SETTINGS_AI
#endif
#include "\z\ace\Addons\main\script_macros.hpp"

View File

@ -5,8 +5,8 @@
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_ENABLED_AIRCRAFT
#define DEBUG_SETTINGS DEBUG_ENABLED_AIRCRAFT
#ifdef DEBUG_SETTINGS_AIRCRAFT
#define DEBUG_SETTINGS DEBUG_SETTINGS_AIRCRAFT
#endif
#include "\z\ace\addons\main\script_macros.hpp"

View File

@ -544,7 +544,7 @@ class CfgWeapons {
/* Flash suppressors */
class ACE_muzzle_mzls_H: ItemCore {
author = "$STR_ACE_Core_AGMTeam";
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_muzzle_mzls_H";
htMin = 1;
htMax = 600;
@ -597,7 +597,7 @@ class CfgWeapons {
};
class ACE_muzzle_mzls_B: ACE_muzzle_mzls_H {
author = "$STR_ACE_Core_AGMTeam";
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_muzzle_mzls_B";
displayName = "$STR_ACE_muzzle_mzls_B";
picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_h_ca.paa";
@ -643,7 +643,7 @@ class CfgWeapons {
};
class ACE_muzzle_mzls_L: ACE_muzzle_mzls_H {
author = "$STR_ACE_Core_AGMTeam";
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_muzzle_mzls_L";
displayName = "$STR_ACE_muzzle_mzls_L";
picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_l_ca.paa";
@ -689,7 +689,7 @@ class CfgWeapons {
};
class ACE_muzzle_mzls_smg_01: ACE_muzzle_mzls_H {
author = "$STR_ACE_Core_AGMTeam";
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_muzzle_mzls_smg_01";
displayName = "$STR_ACE_muzzle_mzls_smg_01";
picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_l_ca.paa";
@ -735,7 +735,7 @@ class CfgWeapons {
};
class ACE_muzzle_mzls_smg_02: ACE_muzzle_mzls_H {
author = "$STR_ACE_Core_AGMTeam";
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_muzzle_mzls_smg_02";
displayName = "$STR_ACE_muzzle_mzls_smg_02";
picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_l_ca.paa";

View File

@ -5,8 +5,8 @@
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_ENABLED_BALLISTICS
#define DEBUG_SETTINGS DEBUG_ENABLED_BALLISTICS
#ifdef DEBUG_SETTINGS_BALLISTICS
#define DEBUG_SETTINGS DEBUG_SETTINGS_BALLISTICS
#endif
#include "\z\ace\addons\main\script_macros.hpp"

View File

@ -2,24 +2,27 @@
class RscInGameUI {
class RscUnitInfo;
class RscUnitInfoSoldier: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgSoldier', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoSoldier', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
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 = "uiNamespace setVariable ['ACE_dlgVehicle', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoVehicle', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
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 = "uiNamespace setVariable ['ACE_dlgAircraft', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAircraft', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
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 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););
};
class RscUnitInfoShip: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgShip', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoShip', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
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 RscUnitInfoParachute: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgParachute', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoParachute', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
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 RscDisplayInventory {
onLoad = "[""onLoad"",_this,""RscDisplayInventory"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInventory', [-1, [], []]]) select 2);";
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 {

View File

@ -19,9 +19,8 @@ if (_currentVersion != _previousVersion) then {
0 spawn COMPILE_FILE(scripts\Version\checkVersionNumber);
//add network event handlers
"ACEg" addPublicVariableEventHandler { _this call FUNC(_handletNetEvent); };
"ACEc" addPublicVariableEventHandler { _this call FUNC(_handletNetEvent); };
"ACEg" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); };
"ACEc" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); };
// everything that only player controlled machines need, goes below this
if (!hasInterface) exitWith {};
@ -63,13 +62,73 @@ call COMPILE_FILE(scripts\KeyInput\initScrollWheel);
enableCamShake true;
// Set the name for the current player
[missionNamespace, "playerChanged", {
if (alive (_this select 0)) then {
[_this select 0] call FUNC(setName)
};
if (alive (_this select 1)) then {
[_this select 1] call FUNC(setName)
};
}] call FUNC(addCustomEventhandler);
["playerChanged", {
EXPLODE_2_PVT(_this,_newPlayer,_oldPlayer);
if (alive _newPlayer) then {
[_newPlayer] call FUNC(setName)
};
if (alive _oldPlayer) then {
[_oldPlayer] call FUNC(setName)
};
}] call FUNC(addEventhandler);
GVAR(OldPlayerInventory) = ACE_player call FUNC(getAllGear);
GVAR(OldPlayerVisionMode) = currentVisionMode ACE_player;
GVAR(OldZeusDisplayIsOpen) = !(isNull findDisplay 312);
GVAR(OldCameraView) = cameraView;
GVAR(OldPlayerVehicle) = vehicle ACE_player;
GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex);
// PFH to raise varios events
[{
// "playerInventoryChanged" event
_newPlayerInventory = ACE_player call FUNC(getAllGear);
if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then {
// Raise ACE event locally
GVAR(OldPlayerInventory) = _newPlayerInventory;
["playerInventoryChanged", [ACE_player, _newPlayerInventory]] call FUNC(localEvent);
};
// "playerVisionModeChanged" event
_newPlayerVisionMode = currentVisionMode ACE_player;
if !(_newPlayerVisionMode isEqualTo GVAR(OldPlayerVisionMode)) then {
// Raise ACE event locally
GVAR(OldPlayerVisionMode) = _newPlayerVisionMode;
["playerVisionModeChanged", [ACE_player, _newPlayerVisionMode]] call FUNC(localEvent);
};
// "zeusDisplayChanged" event
_newZeusDisplayIsOpen = !(isNull findDisplay 312);
if !(_newZeusDisplayIsOpen isEqualTo GVAR(OldZeusDisplayIsOpen)) then {
// Raise ACE event locally
GVAR(OldZeusDisplayIsOpen) = _newZeusDisplayIsOpen;
["zeusDisplayChanged", [ACE_player, _newZeusDisplayIsOpen]] call FUNC(localEvent);
};
// "cameraViewChanged" event
_newCameraView = cameraView;
if !(_newCameraView isEqualTo GVAR(OldCameraView)) then {
// Raise ACE event locally
GVAR(OldCameraView) = _newCameraView;
["cameraViewChanged", [ACE_player, _newCameraView]] call FUNC(localEvent);
};
// "playerVehicleChanged" event
_newPlayerVehicle = vehicle ACE_player;
if !(_newPlayerVehicle isEqualTo GVAR(OldPlayerVehicle)) then {
// Raise ACE event locally
GVAR(OldPlayerVehicle) = _newPlayerVehicle;
["playerVehicleChanged", [ACE_player, _newPlayerVehicle]] call FUNC(localEvent);
};
// "playerTurretChanged" event
[ACE_player] call FUNC(getTurretIndex);
if !(_newPlayerTurret isEqualTo GVAR(OldPlayerTurret)) then {
// Raise ACE event locally
GVAR(OldPlayerTurret) = _newPlayerTurret;
["playerTurretChanged", [ACE_player, _newPlayerTurret]] call FUNC(localEvent);
};
}, 0, []] call cba_fnc_addPerFrameHandler;

View File

@ -6,9 +6,7 @@ PREP(addActionEventHandler);
PREP(addActionMenuEventHandler);
PREP(addCameraEventHandler);
PREP(addCustomEventHandler);
PREP(addInfoDisplayEventHandler);
PREP(addMapMarkerCreatedEventHandler);
PREP(addInventoryDisplayLoadedEventHandler);
PREP(addScrollWheelEventHandler);
PREP(adminKick);
PREP(ambientBrightness);
@ -38,6 +36,7 @@ PREP(execRemoteFnc);
PREP(executePersistent);
PREP(filter);
PREP(fixLoweredRifleAnimation);
PREP(getAllGear);
PREP(getCaptivityStatus);
PREP(getConfigCommander);
PREP(getConfigGunner);
@ -100,8 +99,6 @@ PREP(removeActionEventHandler);
PREP(removeActionMenuEventHandler);
PREP(removeCameraEventHandler);
PREP(removeCustomEventHandler);
PREP(removeInfoDisplayEventHandler);
PREP(removeInventoryDisplayLoadedEventHandler);
PREP(removeMapMarkerCreatedEventHandler);
PREP(removeScrollWheelEventHandler);
PREP(restoreVariablesJIP);
@ -138,26 +135,51 @@ PREP(addCuratorUnloadEventhandler);
PREP(fixCrateContent);
//ACE events global variables
GVAR(netEvents) = [[],[]];
GVAR(events) = [[],[]];
PREP(globalEvent);
PREP(_handleNetEvent);
PREP(addNetEventHandler);
PREP(addEventHandler);
PREP(targetEvent);
PREP(serverEvent);
PREP(localEvent);
PREP(removeEventHandler);
PREP(removeAlLEventHandlers);
// hashes
PREP(hashCreate);
PREP(hashSet);
PREP(hashGet);
PREP(hashHasKey);
PREP(hashRem);
PREP(hashListCreateList);
PREP(hashListCreateHash);
PREP(hashListSelect);
PREP(hashListSet);
PREP(hashListPush);
// Loop to update the ACE_player variable
ACE_player = player;
if (hasInterface) then {
["ACE_CheckForPlayerChange", "onEachFrame", {
// PFH to update the ACE_player variable
[{
if !(ACE_player isEqualTo (missionNamespace getVariable ["BIS_fnc_moduleRemoteControl_unit", player])) then {
_this = ACE_player;
_oldPlayer = ACE_player;
ACE_player = missionNamespace getVariable ["BIS_fnc_moduleRemoteControl_unit", player];
uiNamespace setVariable ["ACE_player", ACE_player];
[missionNamespace, "playerChanged", [ACE_player, _this]] call FUNC(callCustomEventHandlers);
// Raise custom event. @todo, remove
[missionNamespace, "playerChanged", [ACE_player, _oldPlayer]] call FUNC(callCustomEventHandlers);
// Raise ACE event
["playerChanged", [ACE_player, _oldPlayer]] call FUNC(localEvent);
};
}] call BIS_fnc_addStackedEventHandler;
}, 0, []] call cba_fnc_addPerFrameHandler;
};

View File

@ -12,10 +12,10 @@ if(_eventType == "ACEg") then {
_eventName = _event select 0;
_eventArgs = _event select 1;
_eventNames = GVAR(netEvents) select 0;
_eventNames = GVAR(events) select 0;
_eventIndex = _eventNames find _eventName;
if(_eventIndex != -1) then {
_events = (GVAR(netEvents) select 1) select _eventIndex;
_events = (GVAR(events) select 1) select _eventIndex;
{
if(!isNil "_x") then {
_eventArgs call CALLSTACK_NAMED(_x, format[ARR_3("Net Event %1 ID: %2",_eventName,_forEachIndex)]);

View File

@ -1,29 +1,29 @@
/*
* Author: Nou
*
* Add a network event handler.
* Add a event handler.
*
* Argument:
* 0: Event name (string)
* 1: Event code (code)
*
* Return value:
* Event handler ID number (for use with fnc_removeNetEventHandler)
* Event handler ID number (for use with fnc_removeEventHandler)
*/
#include "script_component.hpp"
private ["_eventName", "_eventCode", "_eventNames", "_eventFunctions", "_eventNameCount", "_eventIndex", "_eventFunctionCount"];
_eventName = _this select 0;
_eventCode = _this select 1;
_eventNames = GVAR(netEvents) select 0;
_eventNames = GVAR(events) select 0;
_eventFunctions = [];
_eventIndex = _eventNames find _eventName;
if(_eventIndex != -1) then {
_eventFunctions = (GVAR(netEvents) select 1) select _eventIndex;
_eventFunctions = (GVAR(events) select 1) select _eventIndex;
} else {
_eventNameCount = count _eventNames;
_eventNames set[_eventNameCount, _eventName];
(GVAR(netEvents) select 1) set[_eventNameCount, _eventFunctions];
(GVAR(events) select 1) set[_eventNameCount, _eventFunctions];
};
_eventFunctionCount = count _eventFunctions;

View File

@ -1,35 +0,0 @@
/*
* Author: commy2
*
* Add a unit info type handler.
*
* Argument:
* 0: Type. Can be "Soldier", "Vehicle", "Aircraft", "Ship", "Parachute" or "Any". "Any" will execute for any compatible display (String)
* 1: Code to execute (Code or String)
*
* Return value:
* ID of the event script (used to remove it later).
*/
#include "script_component.hpp"
private ["_type", "_statement", "_actionsVar", "_id", "_actionIDs", "_actions"];
_type = format ["ACE_onLoadInfo%1", _this select 0];
_statement = _this select 1;
if (typeName _statement == "STRING") then {
_statement = compile _statement;
};
_actionsVar = missionNamespace getVariable [_type, [-1, [], []]];
_id = (_actionsVar select 0) + 1;
_actionIDs = _actionsVar select 1;
_actions = _actionsVar select 2;
_actionIDs pushBack _id;
_actions pushBack _statement;
missionNamespace setVariable [_type, [_id, _actionIDs, _actions]];
_id

View File

@ -1,33 +0,0 @@
/*
* Author: commy2
*
* Add an inventory display opened handler.
*
* Argument:
* 0: Code to execute (Code or String)
*
* Return value:
* ID of the event script (used to remove it later).
*/
#include "script_component.hpp"
private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"];
_statement = _this select 0;
if (typeName _statement == "STRING") then {
_statement = compile _statement;
};
_actionsVar = missionNamespace getVariable ["ACE_onLoadInventory", [-1, [], []]];
_id = (_actionsVar select 0) + 1;
_actionIDs = _actionsVar select 1;
_actions = _actionsVar select 2;
_actionIDs pushBack _id;
_actions pushBack _statement;
missionNamespace setVariable ["ACE_onLoadInventory", [_id, _actionIDs, _actions]];
_id

View File

@ -41,8 +41,8 @@ _this spawn {
waitUntil {
if (call _fnc_check) then {
closeDialog 0;
call ACE_Interaction_fnc_hideMenu;
call EFUNC(interaction,hideMenu);
};
(isNil "ACE_Interaction_MainButton" && !dialog) || {!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])} //Exit loop if DisableMouse dialog open
(isNil QEGVAR(interaction,MainButton) && !dialog) || {!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])} //Exit loop if DisableMouse dialog open
};
};

View File

@ -1,26 +1,21 @@
/*
Name: ACE_Respawn_fnc_getAllGear
Author(s):
bux578
Description:
returns an array containing all items of a given unit
Parameters:
0: OBJECT - unit
Returns:
ARRAY
*/
* Author: bux578
*
* Returns an array containing all items of a given unit
*
* Argument:
* 0: Unit (Object)
*
* Return value:
* Array with all the gear
*/
#include "script_component.hpp"
private ["_unit", "_allGear"];
EXPLODE_1_PVT(_this,_unit);
_unit = _this select 0;
if (isNull _unit) exitWith {[]};
_allGear = [
[
(headgear _unit),
(goggles _unit),
(uniform _unit),
@ -40,6 +35,4 @@ _allGear = [
(handgunMagazine _unit),
(assignedItems _unit),
(binocular _unit)
];
_allGear
]

View File

@ -16,6 +16,8 @@ private ["_unit", "_vehicle", "_turrets", "_units", "_index"];
_unit = _this select 0;
_vehicle = vehicle _unit;
if (_unit == _vehicle) exitWith {[]};
//_turrets = [typeOf _vehicle] call FUNC(getTurrets);
_turrets = allTurrets [_vehicle, true];

View File

@ -0,0 +1,5 @@
//fnc_hashCreate.sqf
#include "script_component.hpp"
// diag_log text format["%1 HASH CREATE"];
[[],[]]

View File

@ -0,0 +1,26 @@
//fnc_hashGet.sqf
#include "script_component.hpp"
private ["_hash", "_key", "_val", "_index"];
// diag_log text format["%1 HASH GET: %2", diag_tickTime, _this];
_hash = _this select 0;
_key = _this select 1;
ERRORDATA(2);
_val = nil;
try {
if(VALIDHASH(_hash)) then {
_index = (_hash select 0) find _key;
if(_index != -1) then {
_val = (_hash select 1) select _index;
if(IS_STRING(_val) && {_val == "ACREHASHREMOVEDONOTUSETHISVAL"}) then {
_val = nil;
};
};
} else {
ERROR("Input hash is not valid");
};
} catch {
HANDLECATCH;
};
_val

View File

@ -0,0 +1,23 @@
//fnc_hashHasKey.sqf
#include "script_component.hpp"
private ["_hash", "_key", "_val", "_index"];
// diag_log text format["%1 HASH HAS KEY: %2", diag_tickTime, _this];
_hash = _this select 0;
_key = _this select 1;
ERRORDATA(2);
_val = false;
try {
if(VALIDHASH(_hash)) then {
_index = (_hash select 0) find _key;
if(_index != -1) then {
_val = true;
};
} else {
ERROR("Input hash is not valid");
};
} catch {
HANDLECATCH;
};
_val

View File

@ -0,0 +1,18 @@
//fnc_hashListCreateHash.sqf
#include "script_component.hpp"
private ["_hashList", "_hashKeys"];
_hashList = _this select 0;
ERRORDATA(1);
_hashKeys = [];
try {
if(VALIDHASH(_hashList)) then {
_hashKeys = (_hashList select 0);
} else {
ERROR("Input hashlist is not valid");
};
} catch {
HANDLECATCH;
};
[_hashKeys, []];

View File

@ -0,0 +1,7 @@
//fnc_hashListCreateList.sqf
#include "script_component.hpp"
private ["_keys"];
_keys = _this select 0;
[_keys,[]];

View File

@ -0,0 +1,17 @@
//fnc_hashListPush.sqf
#include "script_component.hpp"
private ["_hashList", "_value"];
_hashList = _this select 0;
_value = _this select 1;
ERRORDATA(2);
try {
if(VALIDHASH(_hashList)) then {
[_hashList, (count (_hashList select 1)), _value] call FUNC(hashListSet);
} else {
ERROR("Input hashlist in push not valid");
};
} catch {
HANDLECATCH;
};

View File

@ -0,0 +1,27 @@
//fnc_hashListSelect.sqf
#include "script_component.hpp"
private ["_hashList", "_index", "_hash", "_keys", "_hashes", "_values"];
_hashList = _this select 0;
_index = _this select 1;
ERRORDATA(2);
_hash = nil;
try {
if(VALIDHASH(_hashList)) then {
_keys = _hashList select 0;
_hashes = _hashList select 1;
if(_index < (count _hashes)) then {
_values = _hashes select _index;
_hash = [_keys, _values, 1];
} else {
ERROR("Index of hashlist is out of range");
};
} else {
ERROR("Input hashlist is not valid");
};
} catch {
HANDLECATCH;
};
_hash;

View File

@ -0,0 +1,24 @@
//fnc_hashListSet.sqf
#include "script_component.hpp"
private ["_hashList", "_index", "_value", "_vals"];
_hashList = _this select 0;
_index = _this select 1;
_value = _this select 2;
ERRORDATA(3);
try {
if(VALIDHASH(_hashList)) then {
if(VALIDHASH(_value)) then {
_vals = _value select 1;
(_hashList select 1) set[_index, _vals];
} else {
ERROR("Set hash in hashlist is not valid");
};
} else {
ERROR("Input hashlist is not valid");
};
} catch {
HANDLECATCH;
};

View File

@ -0,0 +1,30 @@
//fnc_hashRem.sqf
#include "script_component.hpp"
private ["_hash", "_key", "_val", "_index"];
_hash = _this select 0;
_key = _this select 1;
ERRORDATA(2);
_val = nil;
try {
if(VALIDHASH(_hash)) then {
_index = (_hash select 0) find _key;
if(_index != -1) then {
(_hash select 1) set[_index, "ACREHASHREMOVEDONOTUSETHISVAL"];
// is this hash is not part of a hash list?
// if it is we need to leave the keys intact.
if((count _hash) == 2) then {
// if this is a standalone hash then we can clean it up
(_hash select 0) set[_index, "ACREHASHREMOVEDONOTUSETHISVAL"];
_hash set[0, ((_hash select 0) - ["ACREHASHREMOVEDONOTUSETHISVAL"])];
_hash set[1, ((_hash select 1) - ["ACREHASHREMOVEDONOTUSETHISVAL"])];
};
};
} else {
ERROR("Input hash is not valid");
};
} catch {
HANDLECATCH;
};
true

View File

@ -0,0 +1,27 @@
//fnc_hashSet.sqf
#include "script_component.hpp"
private ["_hash", "_key", "_val", "_index"];
// diag_log text format["%1 HASH SET: %2", diag_tickTime, _this];
_hash = _this select 0;
_key = _this select 1;
_val = _this select 2;
ERRORDATA(3);
try {
if(VALIDHASH(_hash)) then {
_index = (_hash select 0) find _key;
if(_index == -1) then {
_index = (_hash select 0) find "ACREHASHREMOVEDONOTUSETHISVAL";
if(_index == -1) then {
_index = (count (_hash select 0));
};
(_hash select 0) set[_index, _key];
};
(_hash select 1) set[_index, _val];
} else {
ERROR("Input hash is not valid");
};
} catch {
HANDLECATCH;
};

View File

@ -0,0 +1,27 @@
/*
* Author: Nou
*
* Execute a local event on this client only.
*
* Argument:
* 0: Event name (string)
* 1: Event args (any)
*
* Return value:
* Nothing
*/
#include "script_component.hpp"
_eventName = _this select 0;
_eventArgs = _this select 1;
_eventNames = GVAR(events) select 0;
_eventIndex = _eventNames find _eventName;
if(_eventIndex != -1) then {
_events = (GVAR(events) select 1) select _eventIndex;
{
if(!isNil "_x") then {
_eventArgs call CALLSTACK_NAMED(_x, format[ARR_3("Local Event %1 ID: %2",_eventName,_forEachIndex)]);
};
} forEach _events;
};

View File

@ -0,0 +1,21 @@
/*
* Author: Nou
*
* Remove all events of a certain event type.
*
* Argument:
* 0: Event name (string)
*
* Return value:
* Nothing
*/
#include "script_component.hpp"
private ["_eventName", "_eventNames", "_eventFunctions", "_eventIndex"];
_eventName = _this select 0;
_eventNames = GVAR(events) select 0;
_eventFunctions = [];
_eventIndex = _eventNames find _eventName;
if(_eventIndex != -1) then {
(GVAR(events) select 1) set[_eventIndex, []];
};

View File

@ -0,0 +1,24 @@
/*
* Author: Nou
*
* Remove an event handler.
*
* Argument:
* 0: Event name (string)
* 1: Event code (number)
*
* Return value:
* Nothing
*/
#include "script_component.hpp"
private ["_eventName", "_eventNames", "_eventFunctions", "_eventIndex", "_eventCodeIndex"];
_eventName = _this select 0;
_eventCodeIndex = _this select 1;
_eventNames = GVAR(events) select 0;
_eventFunctions = [];
_eventIndex = _eventNames find _eventName;
if(_eventIndex != -1) then {
_eventFunctions = (GVAR(events) select 1) select _eventIndex;
_eventFunctions set[_eventCodeIndex, nil];
};

View File

@ -1,33 +0,0 @@
/*
* Author: commy2
*
* Remove a unit info type event handler.
*
* Argument:
* 0: Type. Can be "Soldier", "Vehicle", "Aircraft" or "Parachute" (String)
* 1: ID of the event handler (Number)
*
* Return value:
* None.
*/
#include "script_component.hpp"
private ["_type", "_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"];
_type = format ["ACE_onLoadInfo%1", _this select 0];
_id = _this select 1;
_actionsVar = missionNamespace getVariable [_type, [-1, [], []]];
_currentId = _actionsVar select 0;
_actionIDs = _actionsVar select 1;
_actions = _actionsVar select 2;
_id = _actionIDs find _id;
if (_id == -1) exitWith {};
_actionIDs deleteAt _id;
_actions deleteAt _id;
missionNamespace setVariable [_type, [_currentId, _actionIDs, _actions]];

View File

@ -1,31 +0,0 @@
/*
* Author: commy2
*
* Remove an inventory display opened handler.
*
* Argument:
* 0: ID of the event handler (Number)
*
* Return value:
* None.
*/
#include "script_component.hpp"
private ["_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"];
_id = _this select 0;
_actionsVar = missionNamespace getVariable ["ACE_onLoadInventory", [-1, [], []]];
_currentId = _actionsVar select 0;
_actionIDs = _actionsVar select 1;
_actions = _actionsVar select 2;
_id = _actionIDs find _id;
if (_id == -1) exitWith {};
_actionIDs deleteAt _id;
_actions deleteAt _id;
missionNamespace setVariable ["ACE_onLoadInventory", [_currentId, _actionIDs, _actions]];

View File

@ -1,7 +1,7 @@
/*
* Author: commy2
*
* Set all keys from the 'GVAR(Default_Keys)' base class that are missing in the current user profile.
* Set all keys from the 'ACE_Default_Keys' base class that are missing in the current user profile.
*
* Argument:
* 1: Overwrite existing key binds? (Bool)

View File

@ -1 +1,13 @@
#include "\z\ace\addons\common\script_component.hpp"
#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 ERRORDATA(c) private ["_callFrom", "_lineNo"];\
_callFrom = "";\
_lineNo = -1;\
if((count _this) > c) then {\
_callFrom = _this select c;\
_lineNo = _this select c+1;\
};

View File

@ -7,8 +7,8 @@
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_ENABLED_COMMON
#define DEBUG_SETTINGS DEBUG_ENABLED_COMMON
#ifdef DEBUG_SETTINGS_COMMON
#define DEBUG_SETTINGS DEBUG_SETTINGS_COMMON
#endif
#include "\z\ace\addons\main\script_macros.hpp"

View File

@ -13,7 +13,7 @@ if (missionNamespace getVariable ["ACE_Version_CheckAll", false]) then {
} forEach activatedAddons;
} else {
{
if (toLower _x find "ACE_" == 0) then {
if (toLower _x find "ace_" == 0) then {
_files pushBack _x;
};
} forEach activatedAddons;
@ -31,7 +31,7 @@ if (isServer) then {
diag_log text format ["[ACE] Server: ACE_Common is Version %1.", _versionMain];
{
if (toLower _x find "ACE_" == 0) then {//
if (toLower _x find "ace_" == 0) then {//
_version = _versions select _forEachIndex;
if (_version != _versionMain) then {
diag_log text format ["[ACE] Server: %1 is Version %2.", _x, _version];
@ -45,7 +45,7 @@ if (isServer) then {
diag_log text format ["[ACE] Client: ACE_Common is Version %1.", _versionMain];
{
if (toLower _x find "ACE_" == 0) then {//
if (toLower _x find "ace_" == 0) then {//
_version = _versions select _forEachIndex;
if (_version != _versionMain) then {
diag_log text format ["[ACE] Client: %1 is Version %2.", _x, _version];

View File

@ -35,23 +35,25 @@ for "_index1" from 10 to 13 do {(_dlgMenuDialog displayCtrl _index1) ctrlEnable
(_dlgMenuDialog displayCtrl 30) ctrlSetText _displayName;
GVAR(keysetDefault) = compile format [
"_configFile = configFile >> 'GVAR(Default_Keys)' >> '%1';
"_configFile = configFile >> 'ACE_Default_Keys' >> '%1';
_key = getNumber (_configFile >> 'Key');
_shft = getNumber (_configFile >> 'Shift') == 1;
_ctrl = getNumber (_configFile >> 'Control') == 1;
_alt = getNumber (_configFile >> 'Alt') == 1;
_keyCode = [_key, _shft, _ctrl, _alt] call FUNC(convertKeyCode);
_keyCode = [_key, _shft, _ctrl, _alt] call %2;
GVAR(keyNewTemp) = [_key, [_shft, _ctrl, _alt], _keyCode];",
_action
%3 = [_key, [_shft, _ctrl, _alt], _keyCode];",
_action,
QFUNC(convertKeyCode),
QGVAR(keyNewTemp)
];
_description = ctrlText _ctrlMenuDialog;
//_ctrlMenuDialog ctrlSetText "..";
_ehid_keydown = _dlgMenuDialog displayAddEventHandler ["KeyDown", "_this call GVAR(keyInput)"];
_ehid_keyup = _dlgMenuDialog displayAddEventHandler ["KeyUp", "_this call GVAR(keyRelease)"];
_ehid_keydown = _dlgMenuDialog displayAddEventHandler ["KeyDown", QUOTE( _this call GVAR(keyInput) )];
_ehid_keyup = _dlgMenuDialog displayAddEventHandler ["KeyUp", QUOTE( _this call GVAR(keyRelease) )];
waitUntil {
if (count GVAR(keyNewTemp) > 0) then {

View File

@ -7,7 +7,7 @@
#define OFFSET_4 400
#define OFFSET_5 500
_config = configFile >> QGVAR(Default_Keys);
_config = configFile >> "ACE_Default_Keys";
_count = count _config;
_countPages = ceil (_count / 20) + 1;
@ -26,7 +26,7 @@ if (GVAR(MenuPage) == _countPages - 1) then {
for "_index" from OFFSET_1 to (OFFSET_1 + 19) do {(_dlgMenuDialog displayCtrl _index) ctrlShow false};
for "_index" from OFFSET_2 to (OFFSET_2 + 19) do {(_dlgMenuDialog displayCtrl _index) ctrlShow false};
_config = configFile >> QGVAR(Options);
_config = configFile >> "ACE_Options";
_count = count _config;
_offset = 0;

View File

@ -22,7 +22,7 @@ _dlgMenuDialog = uiNamespace getVariable QGVAR(MenuDialog);
_ehid_keydown = _dlgMenuDialog displayAddEventHandler ["KeyDown", "_this select 1 > 1"];
_ehid_keyup = _dlgMenuDialog displayAddEventHandler ["KeyUp", "_this select 1 > 1"];
_config = configFile >> QGVAR(Default_Keys);
_config = configFile >> "ACE_Default_Keys";
_count = count _config;
_countPages = ceil (_count / 20) + 1;

View File

@ -5,9 +5,9 @@
#include "script_component.hpp"
if (isNil QGVAR(UpdateInventoryDisplay_EHID)) then {
GVAR(UpdateInventoryDisplay_EHID) = [{
GVAR(UpdateInventoryDisplay_EHID) = ["inventoryDisplayLoaded",{
_player = ACE_player;
[_player, secondaryWeapon _player] call FUNC(takeLoadedATWeapon);
[_player, (_this select 0)] call FUNC(updateInventoryDisplay);
}] call EFUNC(common,addInventoryDisplayLoadedEventHandler);
}] call EFUNC(common,addEventHandler);
};

View File

@ -10,39 +10,39 @@ class CfgACE_Triggers {
*/
class Command {
displayName = $STR_ACE_Explosives_clacker_displayName;
picture = QUOTE( PATHTOF(Data\UI\Clacker.paa) );
onPlace = QUOTE( _this call FUNC(AddClacker);false );
picture = PATHTOF(Data\UI\Clacker.paa);
onPlace = QUOTE(_this call FUNC(AddClacker);false);
requires[] = {"ACE_Clacker"};
};
class MK16_Transmitter:Command {
displayName = $STR_ACE_Explosives_MK16_displayName;
picture = QUOTE( PATHTOF(Data\UI\MK16_Reciever_ca.paa) );
picture = PATHTOF(Data\UI\MK16_Reciever_ca.paa);
requires[] = {"ACE_M26_Clacker"};
};
class DeadManSwitch:Command {
displayName = $STR_ACE_Explosives_DeadManSwitch_displayName;
picture = QUOTE( PATHTOF(Data\UI\DeadmanSwitch.paa) );
picture = PATHTOF(Data\UI\DeadmanSwitch.paa);
requires[] = {"ACE_DeadManSwitch"};
};
class PressurePlate {
displayName = $STR_ACE_Explosives_PressurePlate;
picture = QUOTE( PATHTOF(Data\UI\PressurePlate.paa) );
picture = PATHTOF(Data\UI\PressurePlate.paa);
onPlace = "_dist=GetNumber(ConfigFile >> 'CfgMagazines' >> (_this select 2) >> 'ACE_Triggers' >> 'PressurePlate' >> 'digDistance');_ex=_this select 1;_ex setPosATL ((getPosATL _ex) vectorDiff ((VectorUp _ex) vectorCrossProduct [0,0,_dist]));false";
};
class IRSensor {
displayName = $STR_ACE_Explosives_IRSensor;
picture = QUOTE( PATHTOF(Data\UI\PressurePlate.paa) );
picture = PATHTOF(Data\UI\PressurePlate.paa);
onPlace = "false";
};
class Timer {
displayName = $STR_ACE_Explosives_timerName;
picture = "ACE_Explosives\data\UI\Timer.paa";
onPlace = QUOTE( [ARR_2(_this select 1,(_this select 3) select 0)] call FUNC(startTimer);false );
onSetup = QUOTE( _this call FUNC(openTimerSetUI);true );
picture = PATHTOF(data\UI\Timer.paa);
onPlace = QUOTE([ARR_2(_this select 1,(_this select 3) select 0)] call FUNC(startTimer);false);
onSetup = QUOTE(_this call FUNC(openTimerSetUI);true);
};
class Tripwire {
displayName = $STR_ACE_Explosives_TripWire;
picture = QUOTE( PATHTOF(Data\UI\Tripwire.paa) );
picture = PATHTOF(Data\UI\Tripwire.paa);
onPlace = "false";
};
};

View File

@ -1,11 +1,11 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE( call COMPILE_FILE(XEH_postInit) );
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};

View File

@ -3,10 +3,10 @@ class ACE_ModuleExplosive: Module_F {
author = "ACE Team";
category = "ACE";
displayName = "Explosive System";
function = QUOTE( FUNC(module) );
function = QUOTE(FUNC(module));
scope = 2;
isGlobal = 1;
icon = QUOTE( PATHTOF(UI\IconExplosives_ca.paa) );
icon = PATHTOF(UI\IconExplosives_ca.paa);
class Arguments {
class RequireSpecialist {
displayName = "Require specialists?";

View File

@ -8,44 +8,44 @@ class CfgVehicles {
class CAManBase: Man {
class ACE_SelfActions {
class GVAR(Explosives) {
class ACE_Explosives {
displayName = $STR_ACE_Explosives_Menu;
condition = QUOTE( !(_player getVariable [ARR_2('ace_explosives_PlantingExplosive',false)]) );
condition = QUOTE(!(_player getVariable [ARR_2('ace_explosives_PlantingExplosive',false)]));
statement = "";
exceptions[] = {"ACE_Interaction_isNotSwimming"};
showDisabled = 1;
priority = 4;
icon = QUOTE( PATHTOF(UI\Explosives_Menu_ca.paa) );
icon = PATHTOF(UI\Explosives_Menu_ca.paa);
subMenu[] = {"ACE_Explosives", 1};
hotkey = "X";
//Sub-menu items
class ACE_Detonate {
displayName = $STR_ACE_Explosives_Detonate;
condition = QUOTE( [_player] call FUNC(canDetonate) );
statement = QUOTE( [_player] call FUNC(openTransmitterUI); );
condition = QUOTE([_player] call FUNC(canDetonate));
statement = QUOTE([_player] call FUNC(openTransmitterUI););
exceptions[] = {"ACE_Interaction_isNotSwimming"};
showDisabled = 1;
icon = QUOTE( PATHTOF(UI\Explosives_Menu_ca.paa) );
icon = PATHTOF(UI\Explosives_Menu_ca.paa);
priority = 2;
hotkey = "T";
};
class ACE_Place {
displayName = $STR_ACE_Explosives_Place;
condition = QUOTE( (vehicle _player == _player) and {[_player] call FUNC(hasExplosives)} );
statement = QUOTE( [_player] call FUNC(openPlaceUI); );
condition = QUOTE((vehicle _player == _player) and {[_player] call FUNC(hasExplosives)});
statement = QUOTE([_player] call FUNC(openPlaceUI););
exceptions[] = {"ACE_Interaction_isNotSwimming"};
showDisabled = 1;
icon = QUOTE( PATHTOF(UI\Place_Explosive_ca.paa) );
icon = PATHTOF(UI\Place_Explosive_ca.paa);
priority = 1;
hotkey = "P";
};
class ACE_Defuse {
displayName = $STR_ACE_Explosives_Defuse;
condition = QUOTE( [_player] call FUNC(canDefuse) );
statement = QUOTE( [ARR_2(_player,EGVAR(Interaction,Target))] call FUNC(startDefuse); );
condition = QUOTE([_player] call FUNC(canDefuse));
statement = QUOTE([ARR_2(_player,EGVAR(Interaction,Target))] call FUNC(startDefuse););
exceptions[] = {"ACE_Interaction_isNotSwimming"};
showDisabled = 0;
icon = QUOTE( PATHTOF(UI\Defuse_ca.paa) );
icon = PATHTOF(UI\Defuse_ca.paa);
priority = 0.8;
hotkey = "F";
};

View File

@ -11,7 +11,7 @@ class CfgWeapons {
scope = 2;
displayName = $STR_ACE_Explosives_clacker_displayName;
descriptionShort = $STR_ACE_Explosives_clacker_description;
picture = QUOTE( PATHTOF(Data\UI\Clacker.paa) );
picture = PATHTOF(Data\UI\Clacker.paa);
model = "\A3\weapons_F\ammo\mag_univ.p3d";
ACE_Range = 250;
ACE_Detonator = 1;
@ -23,14 +23,14 @@ class CfgWeapons {
};
class ACE_M26_Clacker: ACE_Clacker {
displayName = $STR_ACE_Explosives_M26_displayName;
picture = QUOTE( PATHTOF(Data\UI\MK26_Transmitter_ca.paa) );
picture = PATHTOF(Data\UI\MK26_Transmitter_ca.paa);
ACE_Range = 5000;
};
class ACE_DefusalKit: ACE_ItemCore {
scope = 2;
displayName = $STR_ACE_Explosives_DefusalKit_displayName;
descriptionShort = $STR_ACE_Explosives_DefusalKit_description;
picture = QUOTE( PATHTOF(Data\UI\Pliers.paa) );
picture = PATHTOF(Data\UI\Pliers.paa);
model = "\A3\Structures_F\Items\Tools\Pliers_F.p3d";
class ItemInfo: ACE_ExplosiveItem {
@ -42,7 +42,7 @@ class CfgWeapons {
scope = 2;
displayName = $STR_ACE_Explosives_DeadManSwitch_displayName;
descriptionShort = $STR_ACE_Explosives_DeadManSwitch_description;
picture = QUOTE( PATHTOF(Data\UI\DeadmanSwitch.paa) );
picture = PATHTOF(Data\UI\DeadmanSwitch.paa);
model = "\A3\weapons_F\ammo\mag_univ.p3d";
ACE_Range = 100;
ACE_Detonator = 1;

View File

@ -20,7 +20,7 @@ class CfgPatches {
#include "CfgMagazines.hpp"
#include "CfgWeapons.hpp"
#include "CfgVehicles.hpp"
#include "CfgACE_Triggers.hpp"
#include "ExplosivesUI.hpp"
class CfgActions {

View File

@ -31,10 +31,10 @@ _distBase = _unit distance _mineBase;
_distance = 10;
if (_distCore < _distBase) then {
_distance = _distCore;
EGVAR(Interaction,Target) = _timeBombCore;
EGVAR(interaction,Target) = _timeBombCore;
}else{
_distance = _distBase;
EGVAR(Interaction,Target) = _mineBase;
EGVAR(interaction,Target) = _mineBase;
};
if (isNil "_distance") exitWith {false};
_distance < 4

View File

@ -18,14 +18,14 @@
*/
#include "script_component.hpp"
private ["_unit","_result", "_item"];
call EFUNC(Interaction,hideMenu);
call EFUNC(interaction,hideMenu);
_unit = _this select 0;
_detonator = _this select 1;
_range = GetNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "ACE_Range");
_result = [_unit] call FUNC(getPlacedExplosives);
_actions = [localize "STR_ACE_Explosives_DetonateMenu", localize "STR_ACE_Explosives_Detonate"]
call EFUNC(Interaction,prepareSelectMenu);
call EFUNC(interaction,prepareSelectMenu);
_count = 0;
{
if (!isNull(_x select 0)) then {
@ -37,7 +37,7 @@ _count = 0;
_x select 2,
getText(_item >> "picture"),
[_foreachIndex, _range]
] call EFUNC(Interaction,AddSelectableItem);
] call EFUNC(interaction,AddSelectableItem);
_count = _count + 1;
};
};
@ -48,16 +48,16 @@ if (_count > 0) then {
{
[
ACE_player,
[_this select 1] call EFUNC(Core,toNumber),
(ACE_player getVariable [QGVAR(Clackers), []]) select ([_this select 0] call EFUNC(Core,toNumber)),
[_this select 1] call EFUNC(common,toNumber),
(ACE_player getVariable [QGVAR(Clackers), []]) select ([_this select 0] call EFUNC(common,toNumber)),
false
] call FUNC(detonateExplosive);
call EFUNC(Interaction,hideMenu);
call EFUNC(interaction,hideMenu);
},
{[ACE_player] call FUNC(openTransmitterUI);}
] call EFUNC(Interaction,openSelectMenu);
] call EFUNC(interaction,openSelectMenu);
}else{
call EFUNC(Interaction,hideMenu);
call EFUNC(interaction,hideMenu);
[ACE_player] call FUNC(openTransmitterUI);
[localize "STR_ACE_Explosives_NoExplosivesAvailable"] call EFUNC(Core,displayTextStructured);
[localize "STR_ACE_Explosives_NoExplosivesAvailable"] call EFUNC(common,displayTextStructured);
};

View File

@ -36,14 +36,14 @@ _itemCount = [];
};
} forEach _mags;
_actions = [localize "STR_ACE_Explosives_PlaceMenu", localize "STR_ACE_Explosives_Place"]
call EFUNC(Interaction,prepareSelectMenu);
call EFUNC(interaction,prepareSelectMenu);
{
_actions = [
_actions,
format [getText(_x >> "displayName") + " (%1)", _itemCount select _foreachIndex],
getText(_x >> "picture"),
configName _x
] call EFUNC(Interaction,AddSelectableItem);
] call EFUNC(interaction,AddSelectableItem);
} foreach _list;
[
@ -52,9 +52,9 @@ _actions = [localize "STR_ACE_Explosives_PlaceMenu", localize "STR_ACE_Explosive
[_this] call FUNC(openTriggerSelectionUI);
},
{
call EFUNC(Interaction,hideMenu);
if !(profileNamespace getVariable [QUOTE( EGVAR(Interaction,AutoCloseMenu) ), false]) then {
"ACE_Explosives" call EFUNC(Interaction,openMenuSelf);
call EFUNC(interaction,hideMenu);
if !(profileNamespace getVariable [EGVAR(interaction,AutoCloseMenu), false]) then {
"ACE_Explosives" call EFUNC(interaction,openMenuSelf);
};
}
] call EFUNC(Interaction,openSelectMenu);
] call EFUNC(interaction,openSelectMenu);

View File

@ -21,7 +21,7 @@ _unit = _this select 0;
_items = (items _unit);
_actions = [localize "STR_ACE_Explosives_TriggerMenu", localize "STR_ACE_Explosives_SelectTrigger"]
call EFUNC(Interaction,prepareSelectMenu);
call EFUNC(interaction,prepareSelectMenu);
_detonators = [_unit] call FUNC(getDetonators);
{
_config = ConfigFile >> "CfgWeapons" >> _x;
@ -30,12 +30,12 @@ _detonators = [_unit] call FUNC(getDetonators);
getText(_config >> "displayName"),
getText(_config >> "picture"),
_x
] call EFUNC(Interaction,addSelectableItem);
] call EFUNC(interaction,addSelectableItem);
} count _detonators;
if (count _detonators == 0) then {
call EFUNC(Interaction,hideMenu);
"ACE_Explosives" call EFUNC(Interaction,openMenuSelf);
call EFUNC(interaction,hideMenu);
"ACE_Explosives" call EFUNC(interaction,openMenuSelf);
[format[localize "STR_ACE_Explosives_NoTriggersAvailable", "player"]] call EFUNC(Common,displayTextStructured);
}else{
[
@ -44,10 +44,10 @@ if (count _detonators == 0) then {
[ACE_player, _this] call FUNC(openDetonateUI);
},
{
call EFUNC(Interaction,hideMenu);
if !(profileNamespace getVariable [QUOTE( EGVAR(Interaction,AutoCloseMenu) ), false]) then {
"ACE_Explosives" call EFUNC(Interaction,openMenuSelf);
call EFUNC(interaction,hideMenu);
if !(profileNamespace getVariable [QUOTE(EGVAR(interaction,AutoCloseMenu)), false]) then {
"ACE_Explosives" call EFUNC(interaction,openMenuSelf);
};
}
] call EFUNC(Interaction,openSelectMenu);
] call EFUNC(interaction,openSelectMenu);
};

View File

@ -23,7 +23,7 @@ _detonators = [ACE_player] call FUNC(getDetonators);
_triggerTypes = [_magazine] call FUNC(triggerType);
_magTriggers = ConfigFile >> "CfgMagazines" >> _magazine >> "ACE_Triggers";
_actions = [localize "STR_ACE_Explosives_TriggerMenu", localize "STR_ACE_Explosives_SelectTrigger"]
call EFUNC(Interaction,prepareSelectMenu);
call EFUNC(interaction,prepareSelectMenu);
_count = 0;
{
_required = getArray (_x >> "requires");
@ -39,7 +39,7 @@ _count = 0;
if(isText(_magTriggers >> configName _x >> "displayName"))then{getText(_magTriggers >> configName _x >> "displayName")}else{getText(_x >> "displayName")},
if(isText(_magTriggers >> configName _x >> "picture"))then{getText(_magTriggers >> configName _x >> "picture")}else{getText(_x >> "picture")},
[configName _x, _magazine]
] call EFUNC(Interaction,addSelectableItem);
] call EFUNC(interaction,addSelectableItem);
_count = _count + 1;
};
} count _triggerTypes;
@ -55,5 +55,5 @@ if (_count == 0) then {
[_this select 1, _this select 0] call FUNC(selectTrigger);
},
{[ACE_player] call FUNC(openPlaceUI);}
] call EFUNC(Interaction,openSelectMenu);
] call EFUNC(interaction,openSelectMenu);
};

View File

@ -56,7 +56,7 @@ _explosive = createVehicle [_ammo, _pos, [], 0, "NONE"];
if (isText(_triggerConfig >> "onPlace") && {[_unit,_explosive,_magazineClass,_triggerSpecificVars]
call compile (getText (_triggerConfig >> "onPlace"))}) exitWith {_explosive};
if (_setDir) then {
[[_explosive, _dir, getNumber (_magazineTrigger >> "pitch")], QUOTE(FUNC(setPosition))]
call EFUNC(Common,execRemoteFnc);
[[_explosive, _dir, getNumber (_magazineTrigger >> "pitch")], QFUNC(setPosition)]
call EFUNC(common,execRemoteFnc);
};
_explosive

View File

@ -29,7 +29,7 @@ GVAR(placer) = objNull;
_player = ACE_player;
[_player, "DefaultAction", _player getVariable [QGVAR(Place), -1]] call EFUNC(Common,removeActionEventHandler);
[_player, "MenuBack", _player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
call EFUNC(Interaction,hideMouseHint);
call EFUNC(interaction,hideMouseHint);
if ((_setup getVariable [QGVAR(Class), ""]) != "") then {
_dir = (getDir _setup);
if (_dir > 180) then {
@ -73,7 +73,7 @@ if ((_setup getVariable [QGVAR(Class), ""]) != "") then {
if (!isNull (_this select 1)) then {
_explosive attachTo [(_this select 1)];
_dir = _dir - (getDir (_this select 1));
[[_explosive, _dir, 0], QUOTE(FUNC(setPosition))] call EFUNC(Common,execRemoteFnc);
[[_explosive, _dir, 0], QFUNC(setPosition)] call EFUNC(common,execRemoteFnc);
};
};
};

View File

@ -30,6 +30,6 @@ if (isNil {GVAR(placer)}) then {
};
[GVAR(placer), "ACE_Explosives", false] call EFUNC(Common,setForceWalkStatus);
GVAR(placer) = objNull;
call EFUNC(Interaction,hideMouseHint);
call EFUNC(interaction,hideMouseHint);
[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Place), -1]] call EFUNC(Common,removeActionEventHandler);
[ACE_player, "MenuBack", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);

View File

@ -22,7 +22,7 @@ closeDialog 0;
_magazine = _this select 0;
_trigger = _this select 1;
_config = ConfigFile >> "CfgACE_Triggers" >> _trigger;
call EFUNC(Interaction,hideMenu);
call EFUNC(interaction,hideMenu);
// If the onSetup function returns true, it is handled elsewhere
if (isText(_config >> "onSetup") && {[_magazine] call compile getText (_config >> "onSetup")}) exitWith {};

View File

@ -43,7 +43,7 @@ if (!isNil "_timer") then {
GVAR(Setup) setVariable [QGVAR(Timer), _timer];
};
[_unit, "ACE_Explosives", true] call EFUNC(Core,setForceWalkStatus);
[_unit, "ACE_Explosives", true] call EFUNC(common,setForceWalkStatus);
GVAR(TweakedAngle) = 180;
[QGVAR(Placement),"OnEachFrame", {
private "_player";
@ -60,8 +60,8 @@ GVAR(TweakedAngle) = 180;
};
}] call CALLSTACK(BIS_fnc_addStackedEventHandler);
[localize "STR_ACE_Explosives_PlaceAction", localize "STR_ACE_Explosives_CancelAction",
localize "STR_ACE_Explosives_ScrollAction"] call EFUNC(Interaction,showMouseHint);
localize "STR_ACE_Explosives_ScrollAction"] call EFUNC(interaction,showMouseHint);
_unit setVariable [QGVAR(Place), [_unit, "DefaultAction",
{GVAR(pfeh_running) AND !isNull (GVAR(Setup))}, {call FUNC(place_Approve);}] call EFUNC(Core,AddActionEventHandler)];
{GVAR(pfeh_running) AND !isNull (GVAR(Setup))}, {call FUNC(place_Approve);}] call EFUNC(common,AddActionEventHandler)];
_unit setVariable [QGVAR(Cancel), [_unit, "MenuBack",
{GVAR(pfeh_running) AND !isNull (GVAR(Setup))}, {call FUNC(place_Cancel);}] call EFUNC(Core,AddActionEventHandler)];
{GVAR(pfeh_running) AND !isNull (GVAR(Setup))}, {call FUNC(place_Cancel);}] call EFUNC(common,AddActionEventHandler)];

View File

@ -41,7 +41,7 @@ if (STANCE _unit == "Prone") then {
if (ACE_player != _unit) then {
// If the unit is a player, call the function on the player.
if (isPlayer _unit) then {
[[_unit, _target], QUOTE(FUNC(startDefuse)), _unit] call EFUNC(Common,execRemoteFnc);
[[_unit, _target], QFUNC(startDefuse), _unit] call EFUNC(common,execRemoteFnc);
} else {
// TODO: use scheduled delay execution
[_unit, _target, [[_unit] call EFUNC(Common,isEOD), _target] call _fnc_DefuseTime] spawn {
@ -59,10 +59,10 @@ if (ACE_player != _unit) then {
if (GVAR(RequireSpecialist)) then {
if ([_unit] call EFUNC(Common,isEOD)) then {
[[true, _target] call _fnc_DefuseTime, [_unit,_target],
QFUNC(defuseExplosive), localize "STR_ACE_Explosives_DefusingExplosive"] call EFUNC(Common,progressBar);
QFUNC(defuseExplosive), localize "STR_ACE_Explosives_DefusingExplosive"] call EFUNC(common,progressBar);
};
} else {
[[([_unit] call EFUNC(Common,isEOD)), _target] call _fnc_DefuseTime, [_unit,_target],
QFUNC(defuseExplosive), localize "STR_ACE_Explosives_DefusingExplosive"] call EFUNC(Common,progressBar);
QFUNC(defuseExplosive), localize "STR_ACE_Explosives_DefusingExplosive"] call EFUNC(common,progressBar);
};
};

View File

@ -1,27 +1,37 @@
/*
Name: ACE_Explosives_fnc_startTimer
Author(s):
Garth de Wet (LH)
Author(s):
Garth de Wet (LH)
Description:
Starts a timer for an explosive.
Description:
Starts a timer for an explosive.
Parameters:
0: OBJECT - Explosive
1: NUMBER - time till detonation
Parameters:
0: OBJECT - Explosive
1: NUMBER - time till detonation
Returns:
Nothing
Returns:
Nothing
Example:
[_explosive, 10] call ACE_Explosives_fnc_startTimer;
Example:
[_explosive, 10] call ACE_Explosives_fnc_startTimer;
*/
#include "script_component.hpp"
[{
private ["_explosive"];
_explosive = _this select 0;
if (!isNull _explosive) then {
[_explosive, -1, [_explosive, 0], true] call FUNC(detonateExplosive);
};
},_this select 1, _this] call CALLSTACK(CBA_fnc_addPerFrameHandler);
private ["_explosive", "_params", "_pfhId", "_placeTime", "_fuseTime"];
_params = _this select 0;
_pfhId = _this select 1;
_placeTime = _params select 1;
_fuseTime = _params select 0 select 1;
// Skip first execution
if (diag_tickTime < _placeTime + _fuseTime / 2) exitWith {};
_explosive = (_params select 0) select 0;
if (!isNull _explosive) then {
[_explosive, -1, [_explosive, 0], true] call FUNC(detonateExplosive);
};
// Remove the PFH
[_pfhId] call cba_fnc_removePerFrameHandler;
},_this select 1, [_this, diag_tickTime]] call CBA_fnc_addPerFrameHandler;

View File

@ -1,19 +1,19 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit) );
};
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit) );
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit) );
};
class ADDON {
clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit) );
};
};
class Extended_Init_EventHandlers {
class AllVehicles {
class ADDON {
clientInit = QUOTE(_this call FUNC(vehicleInit));
class AllVehicles {
class ADDON {
clientInit = QUOTE(_this call FUNC(vehicleInit));
};
};
};
};

View File

@ -1,254 +1,254 @@
#define MACRO_RANGEFINDER \
class CA_Distance; \
class ACE_CA_Distance: CA_Distance { \
idc = 1713151; \
text = "----"; \
}; \
class ACE_Rangehelper: RscMapControl { \
onDraw = "((ctrlParent (_this select 0)) displayCtrl 1713151) ctrlShow (cameraView == 'GUNNER');"; \
w = 0; \
h = 0; \
};
class CA_Distance; \
class ACE_CA_Distance: CA_Distance { \
idc = 1713151; \
text = "----"; \
}; \
class ACE_Rangehelper: RscMapControl { \
onDraw = "((ctrlParent (_this select 0)) displayCtrl 1713151) ctrlShow (cameraView == 'GUNNER');"; \
w = 0; \
h = 0; \
};
class RscControlsGroup;
class RscMapControl;
class RscInGameUI {
class RscUnitInfo;
class RscUnitInfo_AH64D_gunner {
onLoad = "";
controls[] = {"CA_Distance", "ACE_CA_Distance"};
MACRO_RANGEFINDER
};
class RscWeaponRangeFinder {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance", "ACE_CA_Distance"};
MACRO_RANGEFINDER
};
class RscUnitInfo;
class RscUnitInfo_AH64D_gunner {
onLoad = "";
controls[] = {"CA_Distance", "ACE_CA_Distance"};
MACRO_RANGEFINDER
};
class RscWeaponRangeFinder {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance", "ACE_CA_Distance"};
MACRO_RANGEFINDER
};
class RscWeaponRangeFinderPAS13 {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
MACRO_RANGEFINDER
};
class RscOptics_Rangefinder: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
class RscWeaponRangeFinderPAS13 {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
MACRO_RANGEFINDER
};
};
};
class RscOptics_LaserDesignator {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
class RscOptics_Rangefinder: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_LaserDesignator {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscWeaponRangeFinderMAAWS {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscWeaponRangeFinderAbramsCom {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance", "ACE_CA_Distance"};
MACRO_RANGEFINDER
};
};
};
class RscWeaponRangeFinderMAAWS {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
class RscWeaponRangeFinderAbramsGun {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance", "ACE_CA_Distance"};
MACRO_RANGEFINDER
};
};
};
class RscWeaponRangeFinderAbramsCom {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance", "ACE_CA_Distance"};
MACRO_RANGEFINDER
};
class RscWeaponRangeFinderAbramsGun {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance", "ACE_CA_Distance"};
MACRO_RANGEFINDER
};
class RscWeaponRangeFinderStrykerMGSGun {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance", "ACE_CA_Distance"};
MACRO_RANGEFINDER
};
class RscOptics_crows: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
class RscWeaponRangeFinderStrykerMGSGun {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance", "ACE_CA_Distance"};
MACRO_RANGEFINDER
};
};
};
class RscOptics_strider_commander {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_crows: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_strider_commander {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscWeaponRangeZeroing: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
controls[] = {"CA_Zeroing", "CA_DistanceText", "CA_Distance", "ACE_CA_Distance", "ACE_Rangehelper"};
MACRO_RANGEFINDER
};
class RscOptics_sos: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
class RscWeaponRangeZeroing: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
controls[] = {"CA_Zeroing", "CA_DistanceText", "CA_Distance", "ACE_CA_Distance", "ACE_Rangehelper"};
MACRO_RANGEFINDER
};
};
};
class RscOptics_nightstalker: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_sos: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_tws: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_nightstalker: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_punisher {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_tws: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_tws_sniper: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_punisher {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_SDV_periscope {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_tws_sniper: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_Heli_Attack_02_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_SDV_periscope {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_Heli_Attack_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_Heli_Attack_02_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_UAV_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_Heli_Attack_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_UGV_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_UAV_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_APC_Tracked_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_UGV_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_APC_Tracked_03_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_APC_Tracked_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_APC_Wheeled_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_APC_Tracked_03_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_APC_Wheeled_03_commander: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_APC_Wheeled_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_APC_Wheeled_03_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_APC_Wheeled_03_commander: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_MBT_01_commander: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_APC_Wheeled_03_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_MBT_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_MBT_01_commander: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_MBT_02_commander: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_MBT_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_MBT_02_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_MBT_02_commander: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
class RscOptics_MBT_03_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
class RscOptics_MBT_02_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
class RscOptics_MBT_03_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
};
};

View File

@ -1,373 +1,373 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {ace_common, ace_interaction};
version = QUOTE(VERSION);
versionStr = QUOTE(VERSION);
versionAr[] = {VERSION_AR};
author[] = {"KoffeinFlummi","BadGuy (simon84)"};
authorUrl = "https://github.com/KoffeinFlummi/";
};
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {ace_common, ace_interaction};
version = QUOTE(VERSION);
versionStr = QUOTE(VERSION);
versionAr[] = {VERSION_AR};
author[] = {"KoffeinFlummi","BadGuy (simon84)"};
authorUrl = "https://github.com/KoffeinFlummi/";
};
};
#include "CfgEventHandlers.hpp"
class ACE_Default_Keys {
class laseTarget {
displayName = $STR_ACE_FCS_LaseTarget;
condition = QUOTE(call FUNC(canUseRangefinder) || FUNC(canUseFCS));
statement = QUOTE([_vehicle] call FUNC(keyDown));
conditionUp = QUOTE(GVAR(enabled) && FUNC(canUseFCS));
statementUp = QUOTE([_vehicle] call FUNC(keyUp));
key = 15;
shift = 0;
control = 0;
alt = 0;
};
class adjustRangeUp {
displayName = $STR_ACE_FCS_AdjustRangeUp;
condition = QUOTE(call FUNC(canUseRangefinder) || FUNC(canUseFCS));
statement = QUOTE([_vehicle, 50] call FUNC(adjustRange));
key = 201;
shift = 0;
control = 0;
alt = 0;
allowHolding = 1;
};
class adjustRangeDown: adjustRangeUp {
displayName = $STR_ACE_FCS_AdjustRangeDown;
statement = QUOTE([_vehicle, -50] call FUNC(adjustRange));
key = 209;
};
class laseTarget {
displayName = $STR_ACE_FCS_LaseTarget;
condition = QUOTE(call FUNC(canUseRangefinder) || FUNC(canUseFCS));
statement = QUOTE([_vehicle] call FUNC(keyDown));
conditionUp = QUOTE(GVAR(enabled) && FUNC(canUseFCS));
statementUp = QUOTE([_vehicle] call FUNC(keyUp));
key = 15;
shift = 0;
control = 0;
alt = 0;
};
class adjustRangeUp {
displayName = $STR_ACE_FCS_AdjustRangeUp;
condition = QUOTE(call FUNC(canUseRangefinder) || FUNC(canUseFCS));
statement = QUOTE([_vehicle, 50] call FUNC(adjustRange));
key = 201;
shift = 0;
control = 0;
alt = 0;
allowHolding = 1;
};
class adjustRangeDown: adjustRangeUp {
displayName = $STR_ACE_FCS_AdjustRangeDown;
statement = QUOTE([_vehicle, -50] call FUNC(adjustRange));
key = 209;
};
};
class CfgVehicles {
class All {
class Turrets;
};
class AllVehicles: All {
GVAR(Enabled) = 0;
GVAR(MinDistance) = 200;
GVAR(MaxDistance) = 9990;
GVAR(DistanceInterval) = 5;
class NewTurret {
class Turrets;
class All {
class Turrets;
};
class CargoTurret;
};
class Land: AllVehicles {};
class LandVehicle: Land {
class CommanderOptics;
};
// WHEELED
class Car: LandVehicle {
class ACE_SelfActions {
class ResetFCS {
displayName = $STR_ACE_FCS_ResetFCS;
enableInside = 1;
condition = QUOTE(call FUNC(canResetFCS));
statement = QUOTE([vehicle _player] call FUNC(reset););
showDisabled = 0;
priority = 1;
icon = "";
};
};
};
class Car_F: Car {
class Turrets {
class MainTurret;
};
};
class Wheeled_APC_F: Car_F {
class Turrets {
class MainTurret: NewTurret {
class Turrets {
class CommanderOptics;
class AllVehicles: All {
GVAR(Enabled) = 0;
GVAR(MinDistance) = 200;
GVAR(MaxDistance) = 9990;
GVAR(DistanceInterval) = 5;
class NewTurret {
class Turrets;
};
};
class CargoTurret;
};
};
class APC_Wheeled_01_base_F: Wheeled_APC_F {};
class B_APC_Wheeled_01_base_F: APC_Wheeled_01_base_F {};
class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F {
GVAR(Enabled) = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
class Land: AllVehicles {};
class APC_Wheeled_03_base_F: Wheeled_APC_F {
GVAR(Enabled) = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
class LandVehicle: Land {
class CommanderOptics;
};
};
// TRACKED
class Tank: LandVehicle {
GVAR(Enabled) = 1; // all tracked vehicles get one by default
class ACE_SelfActions {
class ResetFCS {
displayName = $STR_ACE_FCS_ResetFCS;
enableInside = 1;
condition = QUOTE(call FUNC(canResetFCS));
statement = QUOTE([vehicle _player] call FUNC(reset););
showDisabled = 0;
priority = 1;
icon = "";
};
};
class Turrets {
class MainTurret: NewTurret {
class Turrets {
class CommanderOptics;
// WHEELED
class Car: LandVehicle {
class ACE_SelfActions {
class ResetFCS {
displayName = $STR_ACE_FCS_ResetFCS;
enableInside = 1;
condition = QUOTE(call FUNC(canResetFCS));
statement = QUOTE([vehicle _player] call FUNC(reset););
showDisabled = 0;
priority = 1;
icon = "";
};
};
};
};
};
class Tank_F: Tank {
class Turrets {
class MainTurret: NewTurret {
class Car_F: Car {
class Turrets {
class CommanderOptics;
class MainTurret;
};
};
};
};
class MBT_01_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
class Wheeled_APC_F: Car_F {
class Turrets {
class MainTurret: NewTurret {
class Turrets {
class CommanderOptics;
};
};
};
};
};
class B_MBT_01_base_F: MBT_01_base_F {};
class B_MBT_01_cannon_F: B_MBT_01_base_F {};
class B_MBT_01_TUSK_F: B_MBT_01_cannon_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
class APC_Wheeled_01_base_F: Wheeled_APC_F {};
class B_APC_Wheeled_01_base_F: APC_Wheeled_01_base_F {};
class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F {
GVAR(Enabled) = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
};
class MBT_01_arty_base_F: MBT_01_base_F {
GVAR(Enabled) = 0;
};
class MBT_01_mlrs_base_F: MBT_01_base_F {
GVAR(Enabled) = 0;
};
class MBT_02_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
class APC_Wheeled_03_base_F: Wheeled_APC_F {
GVAR(Enabled) = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
};
class MBT_02_arty_base_F: MBT_02_base_F {
GVAR(Enabled) = 0;
};
class MBT_03_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
// TRACKED
class Tank: LandVehicle {
GVAR(Enabled) = 1; // all tracked vehicles get one by default
class ACE_SelfActions {
class ResetFCS {
displayName = $STR_ACE_FCS_ResetFCS;
enableInside = 1;
condition = QUOTE(call FUNC(canResetFCS));
statement = QUOTE([vehicle _player] call FUNC(reset););
showDisabled = 0;
priority = 1;
icon = "";
};
};
class Turrets {
class MainTurret: NewTurret {
class Turrets {
class CommanderOptics;
};
};
};
};
};
class APC_Tracked_01_base_F: Tank_F {};
class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F {};
class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F {
GVAR(Enabled) = 0;
};
class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F {
GVAR(Enabled) = 0;
};
class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
magazines[] += {"ACE_120Rnd_35mm_ABM_shells_Tracer_Red"};
};
class Tank_F: Tank {
class Turrets {
class MainTurret: NewTurret {
class Turrets {
class CommanderOptics;
};
};
};
};
};
class APC_Tracked_02_base_F: Tank_F {};
class O_APC_Tracked_02_base_F: APC_Tracked_02_base_F {};
class O_APC_Tracked_02_AA_F: O_APC_Tracked_02_base_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
magazines[] += {"ACE_120Rnd_35mm_ABM_shells_Tracer_Green"};
};
class MBT_01_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
};
class APC_Tracked_03_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
class B_MBT_01_base_F: MBT_01_base_F {};
class B_MBT_01_cannon_F: B_MBT_01_base_F {};
class B_MBT_01_TUSK_F: B_MBT_01_cannon_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
class MBT_01_arty_base_F: MBT_01_base_F {
GVAR(Enabled) = 0;
};
class MBT_01_mlrs_base_F: MBT_01_base_F {
GVAR(Enabled) = 0;
};
};
// HELICOPTERS
class Air: AllVehicles {};
class MBT_02_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
class MBT_02_arty_base_F: MBT_02_base_F {
GVAR(Enabled) = 0;
};
class Helicopter: Air {
class ACE_SelfActions {
class ResetFCS {
displayName = $STR_ACE_FCS_ResetFCS;
enableInside = 1;
condition = QUOTE(call FUNC(canResetFCS));
statement = QUOTE([vehicle _player] call FUNC(reset););
showDisabled = 0;
priority = 1;
icon = "";
};
class MBT_03_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
class Turrets {
class MainTurret;
};
};
class Helicopter_Base_F: Helicopter {
class Turrets: Turrets {
class CopilotTurret;
class APC_Tracked_01_base_F: Tank_F {};
class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F {};
class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F {
GVAR(Enabled) = 0;
};
class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F {
GVAR(Enabled) = 0;
};
class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
magazines[] += {"ACE_120Rnd_35mm_ABM_shells_Tracer_Red"};
};
};
};
};
class Heli_Attack_01_base_F: Helicopter_Base_F {
GVAR(Enabled) = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
class APC_Tracked_02_base_F: Tank_F {};
class O_APC_Tracked_02_base_F: APC_Tracked_02_base_F {};
class O_APC_Tracked_02_AA_F: O_APC_Tracked_02_base_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
magazines[] += {"ACE_120Rnd_35mm_ABM_shells_Tracer_Green"};
};
};
};
};
class Heli_Attack_02_base_F: Helicopter_Base_F {
GVAR(Enabled) = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
class APC_Tracked_03_base_F: Tank_F {
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
// HELICOPTERS
class Air: AllVehicles {};
class Helicopter: Air {
class ACE_SelfActions {
class ResetFCS {
displayName = $STR_ACE_FCS_ResetFCS;
enableInside = 1;
condition = QUOTE(call FUNC(canResetFCS));
statement = QUOTE([vehicle _player] call FUNC(reset););
showDisabled = 0;
priority = 1;
icon = "";
};
};
class Turrets {
class MainTurret;
};
};
class Helicopter_Base_F: Helicopter {
class Turrets: Turrets {
class CopilotTurret;
};
};
class Heli_Attack_01_base_F: Helicopter_Base_F {
GVAR(Enabled) = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
class Heli_Attack_02_base_F: Helicopter_Base_F {
GVAR(Enabled) = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
};
};
class CfgWeapons {
// disable locking, so it doesn't interfere with our system
class CannonCore;
class cannon_120mm: CannonCore {
canLock = 0;
ballisticsComputer = 0;
};
class autocannon_Base_F: CannonCore {
canLock = 0;
ballisticsComputer = 0;
};
class autocannon_35mm: CannonCore {
canLock = 0;
ballisticsComputer = 0;
magazines[] += {"ACE_120Rnd_35mm_ABM_shells","ACE_120Rnd_35mm_ABM_shells_Tracer_Red","ACE_120Rnd_35mm_ABM_shells_Tracer_Green","ACE_120Rnd_35mm_ABM_shells_Tracer_Yellow"};
};
// disable locking, so it doesn't interfere with our system
class CannonCore;
class cannon_120mm: CannonCore {
canLock = 0;
ballisticsComputer = 0;
};
class autocannon_Base_F: CannonCore {
canLock = 0;
ballisticsComputer = 0;
};
class autocannon_35mm: CannonCore {
canLock = 0;
ballisticsComputer = 0;
magazines[] += {"ACE_120Rnd_35mm_ABM_shells","ACE_120Rnd_35mm_ABM_shells_Tracer_Red","ACE_120Rnd_35mm_ABM_shells_Tracer_Green","ACE_120Rnd_35mm_ABM_shells_Tracer_Yellow"};
};
// fix mrco having an invisible rangefinder
class ItemCore;
class optic_MRCO: ItemCore {
weaponInfoType = "RscWeaponZeroing";
};
// fix mrco having an invisible rangefinder
class ItemCore;
class optic_MRCO: ItemCore {
weaponInfoType = "RscWeaponZeroing";
};
};
class CfgMagazines {
class 680Rnd_35mm_AA_shells;
class 680Rnd_35mm_AA_shells_Tracer_Red;
class 680Rnd_35mm_AA_shells_Tracer_Green;
class 680Rnd_35mm_AA_shells_Tracer_Yellow;
class 680Rnd_35mm_AA_shells;
class 680Rnd_35mm_AA_shells_Tracer_Red;
class 680Rnd_35mm_AA_shells_Tracer_Green;
class 680Rnd_35mm_AA_shells_Tracer_Yellow;
class ACE_120Rnd_35mm_ABM_shells: 680Rnd_35mm_AA_shells {
ammo = "ACE_B_35mm_ABM";
count = 120;
displayName = "35mm ABM Shells";
displayNameShort = "35mm ABM";
};
class ACE_120Rnd_35mm_ABM_shells_Tracer_Red: 680Rnd_35mm_AA_shells_Tracer_Red {
ammo = "ACE_B_35mm_ABM_Tracer_Red";
count = 120;
displayName = "35mm ABM Shells";
displayNameShort = "35mm ABM-T";
};
class ACE_120Rnd_35mm_ABM_shells_Tracer_Green: 680Rnd_35mm_AA_shells_Tracer_Green {
ammo = "ACE_B_35mm_ABM_Tracer_Green";
count = 120;
displayName = "35mm ABM Shells";
displayNameShort = "35mm ABM-T";
};
class ACE_120Rnd_35mm_ABM_shells_Tracer_Yellow: 680Rnd_35mm_AA_shells_Tracer_Yellow {
ammo = "ACE_B_35mm_ABM_Tracer_Yellow";
count = 120;
displayName = "35mm ABM Shells";
displayNameShort = "35mm ABM-T";
};
class ACE_120Rnd_35mm_ABM_shells: 680Rnd_35mm_AA_shells {
ammo = "ACE_B_35mm_ABM";
count = 120;
displayName = "35mm ABM Shells";
displayNameShort = "35mm ABM";
};
class ACE_120Rnd_35mm_ABM_shells_Tracer_Red: 680Rnd_35mm_AA_shells_Tracer_Red {
ammo = "ACE_B_35mm_ABM_Tracer_Red";
count = 120;
displayName = "35mm ABM Shells";
displayNameShort = "35mm ABM-T";
};
class ACE_120Rnd_35mm_ABM_shells_Tracer_Green: 680Rnd_35mm_AA_shells_Tracer_Green {
ammo = "ACE_B_35mm_ABM_Tracer_Green";
count = 120;
displayName = "35mm ABM Shells";
displayNameShort = "35mm ABM-T";
};
class ACE_120Rnd_35mm_ABM_shells_Tracer_Yellow: 680Rnd_35mm_AA_shells_Tracer_Yellow {
ammo = "ACE_B_35mm_ABM_Tracer_Yellow";
count = 120;
displayName = "35mm ABM Shells";
displayNameShort = "35mm ABM-T";
};
};
class CfgAmmo {
class B_35mm_AA;
class B_35mm_AA_Tracer_Red;
class B_35mm_AA_Tracer_Green;
class B_35mm_AA_Tracer_Yellow;
class B_35mm_AA;
class B_35mm_AA_Tracer_Red;
class B_35mm_AA_Tracer_Green;
class B_35mm_AA_Tracer_Yellow;
class ACE_B_35mm_ABM: B_35mm_AA {
GVAR(Airburst) = 1;
deflecting = 0;
};
class ACE_B_35mm_ABM_Tracer_Red: B_35mm_AA_Tracer_Red {
GVAR(Airburst) = 1;
deflecting = 0;
};
class ACE_B_35mm_ABM_Tracer_Green: B_35mm_AA_Tracer_Green {
GVAR(Airburst) = 1;
deflecting = 0;
};
class ACE_B_35mm_ABM_Tracer_Yellow: B_35mm_AA_Tracer_Yellow {
GVAR(Airburst) = 1;
deflecting = 0;
};
class ACE_B_35mm_ABM: B_35mm_AA {
GVAR(Airburst) = 1;
deflecting = 0;
};
class ACE_B_35mm_ABM_Tracer_Red: B_35mm_AA_Tracer_Red {
GVAR(Airburst) = 1;
deflecting = 0;
};
class ACE_B_35mm_ABM_Tracer_Green: B_35mm_AA_Tracer_Green {
GVAR(Airburst) = 1;
deflecting = 0;
};
class ACE_B_35mm_ABM_Tracer_Yellow: B_35mm_AA_Tracer_Yellow {
GVAR(Airburst) = 1;
deflecting = 0;
};
class ACE_B_35mm_ABM_Helper: B_35mm_AA {
indirectHitRange = 6;
simulation = "shotRocket";
timeToLive = 0;
};
class ACE_B_35mm_ABM_Helper: B_35mm_AA {
indirectHitRange = 6;
simulation = "shotRocket";
timeToLive = 0;
};
};
#include <CfgOptics.hpp>

View File

@ -29,9 +29,9 @@ if !(_magazineType in _FCSMagazines) exitWith {};
// GET ELEVATION OFFSET OF CURRENT MAGAZINE
_offset = 0;
{
if (_x == _magazineType) exitWith {
_offset = _FCSElevation select _forEachIndex;
};
if (_x == _magazineType) exitWith {
_offset = _FCSElevation select _forEachIndex;
};
} forEach _FCSMagazines;
[_round, (_unit getVariable QGVAR(Azimuth)), _offset, 0] call EFUNC(common,changeProjectileDirection);
@ -39,24 +39,24 @@ _offset = 0;
// Air burst missile
// may need to get rewritten
if (getNumber (configFile >> "CfgAmmo" >> _ammoType >> "ACE_Airburst") == 1) then {
_this spawn {
_vehicle = _this select 0;
_projectile = _this select 6;
_this spawn {
_vehicle = _this select 0;
_projectile = _this select 6;
_distance = _vehicle getVariable [QGVAR(Distance), currentZeroing _vehicle];
_distance = _vehicle getVariable [QGVAR(Distance), currentZeroing _vehicle];
if (_distance < 50) exitWith {};
if (_distance > 1500) exitWith {};
if (_distance < 50) exitWith {};
if (_distance > 1500) exitWith {};
waitUntil {_projectile distance _vehicle > _distance || {!alive _projectile}};
if (!alive _projectile) exitWith {};
waitUntil {_projectile distance _vehicle > _distance || {!alive _projectile}};
if (!alive _projectile) exitWith {};
_position = getPosATL _projectile;
_position = getPosATL _projectile;
_subMunition = createVehicle ["ACE_B_35mm_ABM_Helper", _position, [], 0, "FLY"];
_subMunition setPosATL _position;
_subMunition setVelocity [0, 0, -10];
_subMunition = createVehicle ["ACE_B_35mm_ABM_Helper", _position, [], 0, "FLY"];
_subMunition setPosATL _position;
_subMunition setVelocity [0, 0, -10];
deleteVehicle _projectile;
};
deleteVehicle _projectile;
};
};

View File

@ -32,40 +32,40 @@ _simulationStep = _this select 6;
if (_simulationStep == 0) exitWith {_angleTarget};
FUNC(traceBullet) = {
private ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_angle", "_posTargetX", "_posTargetY", "_posX", "_posY", "_velocityX", "_velocityY", "_velocityMagnitude"];
private ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_angle", "_posTargetX", "_posTargetY", "_posX", "_posY", "_velocityX", "_velocityY", "_velocityMagnitude"];
_distance = _this select 0;
_angleTarget = _this select 1;
_maxElev = _this select 2;
_initSpeed = _this select 3;
_airFriction = _this select 4;
_timeToLive = _this select 5;
_simulationStep = _this select 6;
_angle = _this select 7;
_distance = _this select 0;
_angleTarget = _this select 1;
_maxElev = _this select 2;
_initSpeed = _this select 3;
_airFriction = _this select 4;
_timeToLive = _this select 5;
_simulationStep = _this select 6;
_angle = _this select 7;
_angle = _angle - _angleTarget;
_angleTarget = 0;
_angle = _angle - _angleTarget;
_angleTarget = 0;
_posTargetX = (cos _angleTarget) * _distance;
_posTargetY = (sin _angleTarget) * _distance;
_posTargetX = (cos _angleTarget) * _distance;
_posTargetY = (sin _angleTarget) * _distance;
_posX = 0;
_posY = 0;
_posX = 0;
_posY = 0;
_velocityX = (cos _angle) * _initSpeed;
_velocityY = (sin _angle) * _initSpeed;
_velocityX = (cos _angle) * _initSpeed;
_velocityY = (sin _angle) * _initSpeed;
// trace the path of the bullet
for "_i" from 1 to ((floor (_timeToLive / _simulationStep)) + 1) do {
_velocityMagnitude = sqrt (_velocityX^2 + _velocityY^2);
_velocityX = _velocityX + _simulationStep * (_velocityX * _velocityMagnitude * _airFriction);
_velocityY = _velocityY + _simulationStep * (_velocityY * _velocityMagnitude * _airFriction - 9.81);
_posX = _posX + _velocityX * _simulationStep;
_posY = _posY + _velocityY * _simulationStep;
if (_posX >= _posTargetX) exitWith {}; // bullet passed the target
};
// trace the path of the bullet
for "_i" from 1 to ((floor (_timeToLive / _simulationStep)) + 1) do {
_velocityMagnitude = sqrt (_velocityX^2 + _velocityY^2);
_velocityX = _velocityX + _simulationStep * (_velocityX * _velocityMagnitude * _airFriction);
_velocityY = _velocityY + _simulationStep * (_velocityY * _velocityMagnitude * _airFriction - 9.81);
_posX = _posX + _velocityX * _simulationStep;
_posY = _posY + _velocityY * _simulationStep;
if (_posX >= _posTargetX) exitWith {}; // bullet passed the target
};
_posY - _posTargetY
_posY - _posTargetY
};
if ((_this + [_maxElev]) call FUNC(traceBullet) < 0) exitWith {_maxElev - _angleTarget};
@ -78,12 +78,12 @@ _f1 = (_this + [_angle1]) call FUNC(traceBullet);
if ((abs _f1) <= PRECISION) exitWith {0};
while {(abs _f1) > PRECISION} do {
_f2 = (_this + [_angle2]) call FUNC(traceBullet);
_temp = _angle2-_f2*(_angle2-_angle1)/(_f2-_f1);
_angle1 = _angle2;
_angle2 = _temp;
_f1 = _f2;
_it2 = _it2+1;
_f2 = (_this + [_angle2]) call FUNC(traceBullet);
_temp = _angle2-_f2*(_angle2-_angle1)/(_f2-_f1);
_angle1 = _angle2;
_angle2 = _temp;
_f1 = _f2;
_it2 = _it2+1;
};
//player globalChat format ["it1: %1 | _angle1: %2 | it2: %3 | _angle2: %4",_it1, _angle-_angleTarget, _it2, _angle2-_angleTarget];

View File

@ -23,13 +23,13 @@ GVAR(Enabled) = true;
GVAR(Time) = time;
if (_distance == 0) then {
_distance = [5, 5000, 0] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision
_distance = [5, 5000, 0] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision
};
_weaponDirection = _vehicle weaponDirection currentWeapon _vehicle;
GVAR(Position) = [
(getPos _vehicle select 0) + _distance * (_weaponDirection select 0),
(getPos _vehicle select 1) + _distance * (_weaponDirection select 1),
(getPos _vehicle select 2) + _distance * (_weaponDirection select 2)
(getPos _vehicle select 0) + _distance * (_weaponDirection select 0),
(getPos _vehicle select 1) + _distance * (_weaponDirection select 1),
(getPos _vehicle select 2) + _distance * (_weaponDirection select 2)
];

View File

@ -22,78 +22,78 @@ if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {};
_magazines = magazines _vehicle;
if (_distance == 0) then {
_distance = [
getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(DistanceInterval)),
getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(MaxDistance)),
getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(MinDistance))
] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision
_distance = [
getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(DistanceInterval)),
getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(MaxDistance)),
getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(MinDistance))
] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision
};
_weaponDirection = _vehicle weaponDirection currentWeapon _vehicle;
_angleTarget = asin (_weaponDirection select 2);
if (count _this > 2) then {
_distance = _this select 2;
_distance = _this select 2;
};
if (!(isNil QGVAR(backgroundCalculation)) and {!(scriptDone GVAR(backgroundCalculation))}) then {
terminate GVAR(backgroundCalculation);
terminate GVAR(backgroundCalculation);
};
// MOVING TARGETS
_movingAzimuth = 0;
if (time - GVAR(time) > 1 and GVAR(time) != -1 and count _this < 3) then {
// calculate speed of target
_posTarget = [
(getPos _vehicle select 0) + _distance * (_weaponDirection select 0),
(getPos _vehicle select 1) + _distance * (_weaponDirection select 1),
(getPos _vehicle select 2) + _distance * (_weaponDirection select 2)
];
_velocityTarget = [
((_posTarget select 0) - (GVAR(position) select 0)) / (time - GVAR(time)),
((_posTarget select 1) - (GVAR(position) select 1)) / (time - GVAR(time)),
((_posTarget select 2) - (GVAR(position) select 2)) / (time - GVAR(time))
];
// calculate speed of target
_posTarget = [
(getPos _vehicle select 0) + _distance * (_weaponDirection select 0),
(getPos _vehicle select 1) + _distance * (_weaponDirection select 1),
(getPos _vehicle select 2) + _distance * (_weaponDirection select 2)
];
_velocityTarget = [
((_posTarget select 0) - (GVAR(position) select 0)) / (time - GVAR(time)),
((_posTarget select 1) - (GVAR(position) select 1)) / (time - GVAR(time)),
((_posTarget select 2) - (GVAR(position) select 2)) / (time - GVAR(time))
];
// estimate time to target
_magazineType = currentMagazine _vehicle;
_ammoType = getText (configFile >> "CfgMagazines" >> _magazineType >> "ammo");
_initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazineType >> "initSpeed");
_airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction");
_timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "timeToLive");
_simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "simulationStep");
// estimate time to target
_magazineType = currentMagazine _vehicle;
_ammoType = getText (configFile >> "CfgMagazines" >> _magazineType >> "ammo");
_initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazineType >> "initSpeed");
_airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction");
_timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "timeToLive");
_simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "simulationStep");
if (_simulationStep != 0) then {
_posX = 0;
_velocityX = _initSpeed;
_velocityY = 0;
_timeToTarget = 0;
for "_i" from 1 to ((floor (_timeToLive / _simulationStep)) + 1) do {
_posX = _posX + _velocityX * _simulationStep;
if (_posX >= _distance) exitWith { // bullet passed the target
_timeToTarget = _i * _simulationStep;
};
_velocityMagnitude = sqrt (_velocityX^2 + _velocityY^2);
_velocityX = _velocityX + _velocityX * _velocityMagnitude * _airFriction * _simulationStep;
_velocityY = _velocityY + _velocityY * _velocityMagnitude * _airFriction * _simulationStep - 9.81 * _simulationStep;
if (_simulationStep != 0) then {
_posX = 0;
_velocityX = _initSpeed;
_velocityY = 0;
_timeToTarget = 0;
for "_i" from 1 to ((floor (_timeToLive / _simulationStep)) + 1) do {
_posX = _posX + _velocityX * _simulationStep;
if (_posX >= _distance) exitWith { // bullet passed the target
_timeToTarget = _i * _simulationStep;
};
_velocityMagnitude = sqrt (_velocityX^2 + _velocityY^2);
_velocityX = _velocityX + _velocityX * _velocityMagnitude * _airFriction * _simulationStep;
_velocityY = _velocityY + _velocityY * _velocityMagnitude * _airFriction * _simulationStep - 9.81 * _simulationStep;
};
// calculate offsets
_posArrival = [
(_posTarget select 0) + (_velocityTarget select 0) * _timeToTarget,
(_posTarget select 1) + (_velocityTarget select 1) * _timeToTarget,
(_posTarget select 2) + (_velocityTarget select 2) * _timeToTarget
];
_dirArrival = [
((_posArrival select 0) - (getPos _vehicle select 0)) / (_posArrival distance (getPos _vehicle)),
((_posArrival select 1) - (getPos _vehicle select 1)) / (_posArrival distance (getPos _vehicle)),
((_posArrival select 2) - (getPos _vehicle select 2)) / (_posArrival distance (getPos _vehicle))
];
_movingAzimuth = ((_dirArrival select 0) atan2 (_dirArrival select 1)) - ((_weaponDirection select 0) atan2 (_weaponDirection select 1));
_angleTarget = asin (_dirArrival select 2);
_distance = floor (_posArrival distance (getPos _vehicle));
};
// calculate offsets
_posArrival = [
(_posTarget select 0) + (_velocityTarget select 0) * _timeToTarget,
(_posTarget select 1) + (_velocityTarget select 1) * _timeToTarget,
(_posTarget select 2) + (_velocityTarget select 2) * _timeToTarget
];
_dirArrival = [
((_posArrival select 0) - (getPos _vehicle select 0)) / (_posArrival distance (getPos _vehicle)),
((_posArrival select 1) - (getPos _vehicle select 1)) / (_posArrival distance (getPos _vehicle)),
((_posArrival select 2) - (getPos _vehicle select 2)) / (_posArrival distance (getPos _vehicle))
];
_movingAzimuth = ((_dirArrival select 0) atan2 (_dirArrival select 1)) - ((_weaponDirection select 0) atan2 (_weaponDirection select 1));
_angleTarget = asin (_dirArrival select 2);
_distance = floor (_posArrival distance (getPos _vehicle));
};
};
GVAR(enabled) = false;
GVAR(time) = -1;
@ -102,7 +102,7 @@ GVAR(time) = -1;
_viewDiff = _vehicle getVariable QGVAR(ViewDiff);
_FCSAzimuth = _movingAzimuth;
if (_viewDiff != 0) then {
_FCSAzimuth = (atan (_distance / _viewDiff) - (abs _viewDiff / _viewDiff) * 90) + _movingAzimuth;
_FCSAzimuth = (atan (_distance / _viewDiff) - (abs _viewDiff / _viewDiff) * 90) + _movingAzimuth;
};
// CALCULATE OFFSET FOR CURRENT WEAPON
@ -112,16 +112,16 @@ _FCSElevation = [];
_magazineType = currentMagazine _vehicle;
_ammoType = getText (configFile >> "CfgMagazines" >> _magazineType >> "ammo");
if !(getText (configFile >> "CfgAmmo" >> _ammoType >> "simulation") == "shotMissile") then {
_maxElev = getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "Turrets" >> "MainTurret" >> "maxElev");
_initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazineType >> "initSpeed");
_airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction");
_timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "timeToLive");
_simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "simulationStep");
_maxElev = getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "Turrets" >> "MainTurret" >> "maxElev");
_initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazineType >> "initSpeed");
_airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction");
_timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "timeToLive");
_simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "simulationStep");
_offset = [_distance, _angleTarget, _maxElev, _initSpeed, _airFriction, _timeToLive, _simulationStep] call FUNC(getAngle);
_offset = [_distance, _angleTarget, _maxElev, _initSpeed, _airFriction, _timeToLive, _simulationStep] call FUNC(getAngle);
_FCSMagazines = _FCSMagazines + [_magazineType];
_FCSElevation = _FCSElevation + [_offset];
_FCSMagazines = _FCSMagazines + [_magazineType];
_FCSElevation = _FCSElevation + [_offset];
};
_vehicle setVariable [QGVAR(Distance), _distance, true];
@ -131,33 +131,33 @@ _vehicle setVariable [QGVAR(Azimuth), _FCSAzimuth, true];
// CALCULATE OFFSETS FOR OTHER WEAPONS IN THE BACKGROUND
GVAR(backgroundCalculation) = [_vehicle, _magazines, _distance, _angleTarget, _FCSMagazines, _FCSElevation] spawn {
_vehicle = _this select 0;
_magazines = _this select 1;
_distance = _this select 2;
_angleTarget = _this select 3;
_FCSMagazines = _this select 4;
_FCSElevation = _this select 5;
_vehicle = _this select 0;
_magazines = _this select 1;
_distance = _this select 2;
_angleTarget = _this select 3;
_FCSMagazines = _this select 4;
_FCSElevation = _this select 5;
{
if !(_x in _FCSMagazines) then {
_ammoType = getText (configFile >> "CfgMagazines" >> _x >> "ammo");
if !(getText (configFile >> "CfgAmmo" >> _ammoType >> "simulation") == "shotMissile") then {
_maxElev = getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "Turrets" >> "MainTurret" >> "maxElev");
_initSpeed = getNumber (configFile >> "CfgMagazines" >> _x >> "initSpeed");
_airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction");
_timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "timeToLive");
_simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "simulationStep");
{
if !(_x in _FCSMagazines) then {
_ammoType = getText (configFile >> "CfgMagazines" >> _x >> "ammo");
if !(getText (configFile >> "CfgAmmo" >> _ammoType >> "simulation") == "shotMissile") then {
_maxElev = getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "Turrets" >> "MainTurret" >> "maxElev");
_initSpeed = getNumber (configFile >> "CfgMagazines" >> _x >> "initSpeed");
_airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction");
_timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "timeToLive");
_simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "simulationStep");
_offset = [_distance, _angleTarget, _maxElev, _initSpeed, _airFriction, _timeToLive, _simulationStep] call FUNC(getAngle);
_offset = [_distance, _angleTarget, _maxElev, _initSpeed, _airFriction, _timeToLive, _simulationStep] call FUNC(getAngle);
_FCSMagazines = _FCSMagazines + [_x];
_FCSElevation = _FCSElevation + [_offset];
};
};
} forEach _magazines;
_FCSMagazines = _FCSMagazines + [_x];
_FCSElevation = _FCSElevation + [_offset];
};
};
} forEach _magazines;
_vehicle setVariable [QGVAR(Magazines), _FCSMagazines, true];
_vehicle setVariable [QGVAR(Elevation), _FCSElevation, true];
_vehicle setVariable [QGVAR(Magazines), _FCSMagazines, true];
_vehicle setVariable [QGVAR(Elevation), _FCSElevation, true];
};
[format ["%1: %2", localize "STR_ACE_FCS_ZeroedTo", _distance]] call EFUNC(common,displayTextStructured);

View File

@ -15,22 +15,22 @@
private ["_gunBeg", "_gunnerView", "_gunBegPos", "_gunnerViewPos", "_viewDiff"];
if (getNumber (configFile >> "CfgVehicles" >> (typeOf (_this select 0)) >> QGVAR(Enabled)) == 1) then {
(_this select 0) addEventHandler ["Fired", {_this call FUNC(firedEH)}];
(_this select 0) addEventHandler ["Fired", {_this call FUNC(firedEH)}];
(_this select 0) setVariable [QGVAR(Distance), 0, true];
(_this select 0) setVariable [QGVAR(Magazines), [], true];
(_this select 0) setVariable [QGVAR(Elevation), [], true];
(_this select 0) setVariable [QGVAR(Azimuth), 0, true];
(_this select 0) setVariable [QGVAR(Distance), 0, true];
(_this select 0) setVariable [QGVAR(Magazines), [], true];
(_this select 0) setVariable [QGVAR(Elevation), [], true];
(_this select 0) setVariable [QGVAR(Azimuth), 0, true];
// calculate offset between gunner camera and muzzle position
if !((_this select 0) isKindOf "Air") then {
_gunBeg = getText (configFile >> "CfgVehicles" >> (typeOf (_this select 0)) >> "Turrets" >> "MainTurret" >> "gunBeg");
_gunnerView = getText (configFile >> "CfgVehicles" >> (typeOf (_this select 0)) >> "Turrets" >> "MainTurret" >> "memoryPointGunnerOptics");
_gunBegPos = ((_this select 0) selectionPosition _gunBeg) select 0;
_gunnerViewPos = ((_this select 0) selectionPosition _gunnerView) select 0;
_viewDiff = _gunBegPos - _gunnerViewPos;
(_this select 0) setVariable [QGVAR(ViewDiff), _viewDiff, true];
} else {
(_this select 0) setVariable [QGVAR(ViewDiff), 0, true];
};
// calculate offset between gunner camera and muzzle position
if !((_this select 0) isKindOf "Air") then {
_gunBeg = getText (configFile >> "CfgVehicles" >> (typeOf (_this select 0)) >> "Turrets" >> "MainTurret" >> "gunBeg");
_gunnerView = getText (configFile >> "CfgVehicles" >> (typeOf (_this select 0)) >> "Turrets" >> "MainTurret" >> "memoryPointGunnerOptics");
_gunBegPos = ((_this select 0) selectionPosition _gunBeg) select 0;
_gunnerViewPos = ((_this select 0) selectionPosition _gunnerView) select 0;
_viewDiff = _gunBegPos - _gunnerViewPos;
(_this select 0) setVariable [QGVAR(ViewDiff), _viewDiff, true];
} else {
(_this select 0) setVariable [QGVAR(ViewDiff), 0, true];
};
};

View File

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

View File

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

View File

@ -1,81 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-19 -->
<Project name="ACE">
<Package name="FCS">
<Key ID="STR_ACE_FCS_LaseTarget">
<English>Lase Target / Measure Distance</English>
<German>Ziel anlasern / Entfernung Messen</German>
<French>Télémétrer la cible</French>
<Polish>Naświetl cel / Zmierz odległość</Polish>
<Czech>Označit cíl / Změřit vzdálenost</Czech>
<Spanish>Iluminar objetivo / Medir distancia</Spanish>
<!-- Outdated
<Russian>Установить зероинг</Russian>
<Hungarian>Lézeres célmegjelölés</Hungarian>
<Portuguese>Marcar Alvo</Portuguese>
<Italian>Designatore Laser</Italian>
-->
<Russian>Подсветить цель / Измерить расстояние</Russian>
</Key>
<Key ID="STR_ACE_FCS_ZeroedTo">
<English>Zeroed To</English>
<German>Haltepunkt</German>
<Spanish>Fijado a</Spanish>
<Polish>Wyzerowany na</Polish>
<Czech>Nastaveno na</Czech>
<French>Zéroté à</French>
<Russian>Зероинг</Russian>
<Hungarian>Nullázás</Hungarian>
<Portuguese>Fixado em</Portuguese>
<Italian>Azzeramento a</Italian>
</Key>
<Key ID="STR_ACE_FCS_AdjustRangeUp">
<English>Adjust FCS Range (Up)</English>
<German>Entfernung des FLS erhöhen</German>
<Polish>Zwiększ zasięg FCS</Polish>
<Spanish>Ajustar distancia del FCS (arriba)</Spanish>
<Czech>Nastavit FCS Náměr (nahoru)</Czech>
<French>Augmenter la distance du SCT</French>
<Hungarian>FCS tartomány állítása (Fel)</Hungarian>
<Portuguese>Ajustar distância do FCS (Acima)</Portuguese>
<Italian>Aumentare la distanza dell'FCS</Italian>
<Russian>Диапазон СУО (Выше)</Russian>
</Key>
<Key ID="STR_ACE_FCS_AdjustRangeDown">
<English>Adjust FCS Range (Down)</English>
<German>Entfernung des FLS verringern</German>
<Polish>Zmniejsz zasięg FCS</Polish>
<Spanish>Ajustar distancia del FCS (abajo)</Spanish>
<Czech>Nastavit FCS Náměr (dolů)</Czech>
<French>Réduire la distance du SCT</French>
<Hungarian>FCS tartomány állítása (Le)</Hungarian>
<Portuguese>Ajustar distância do FCS (Abaixo)</Portuguese>
<Italian>Ridurre la distanza dell'FCS</Italian>
<Russian>Диапазон СУО (Ниже)</Russian>
</Key>
<Key ID="STR_ACE_FCS_ResetFCS">
<English>Reset FCS</English>
<German>FLS zurücksetzen</German>
<Spanish>Reiniciar FCS</Spanish>
<French>Réinitialiser le SCT</French>
<Polish>Resetuj FCS</Polish>
<Czech>Resetovat FCS</Czech>
<Hungarian>FCS visszaállítása</Hungarian>
<Portuguese>Reiniciar FCS</Portuguese>
<Italian>Azzeramento dell'FCS</Italian>
<Russian>Обнулить СУО</Russian>
</Key>
<Key ID="STR_ACE_FCS_HasBeenReset">
<English>FCS has been reset.</English>
<German>FLS wurde zurückgesetzt.</German>
<Spanish>FCS reiniciado</Spanish>
<French>SCT réinitialisé.</French>
<Polish>FCS został zresetowany.</Polish>
<Czech>FCS byl resetován.</Czech>
<Hungarian>Az FCS visszaállítva</Hungarian>
<Portuguese>FCS reiniciado.</Portuguese>
<Italian>L'FCS è stato azzerato</Italian>
<Russian>СУО обнулен</Russian>
</Key>
</Package>
<Package name="FCS">
<Key ID="STR_ACE_FCS_LaseTarget">
<English>Lase Target / Measure Distance</English>
<German>Ziel anlasern / Entfernung Messen</German>
<French>Télémétrer la cible</French>
<Polish>Naświetl cel / Zmierz odległość</Polish>
<Czech>Označit cíl / Změřit vzdálenost</Czech>
<Spanish>Iluminar objetivo / Medir distancia</Spanish>
<!-- Outdated
<Russian>Установить зероинг</Russian>
<Hungarian>Lézeres célmegjelölés</Hungarian>
<Portuguese>Marcar Alvo</Portuguese>
<Italian>Designatore Laser</Italian>
-->
<Russian>Подсветить цель / Измерить расстояние</Russian>
</Key>
<Key ID="STR_ACE_FCS_ZeroedTo">
<English>Zeroed To</English>
<German>Haltepunkt</German>
<Spanish>Fijado a</Spanish>
<Polish>Wyzerowany na</Polish>
<Czech>Nastaveno na</Czech>
<French>Zéroté à</French>
<Russian>Зероинг</Russian>
<Hungarian>Nullázás</Hungarian>
<Portuguese>Fixado em</Portuguese>
<Italian>Azzeramento a</Italian>
</Key>
<Key ID="STR_ACE_FCS_AdjustRangeUp">
<English>Adjust FCS Range (Up)</English>
<German>Entfernung des FLS erhöhen</German>
<Polish>Zwiększ zasięg FCS</Polish>
<Spanish>Ajustar distancia del FCS (arriba)</Spanish>
<Czech>Nastavit FCS Náměr (nahoru)</Czech>
<French>Augmenter la distance du SCT</French>
<Hungarian>FCS tartomány állítása (Fel)</Hungarian>
<Portuguese>Ajustar distância do FCS (Acima)</Portuguese>
<Italian>Aumentare la distanza dell'FCS</Italian>
<Russian>Диапазон СУО (Выше)</Russian>
</Key>
<Key ID="STR_ACE_FCS_AdjustRangeDown">
<English>Adjust FCS Range (Down)</English>
<German>Entfernung des FLS verringern</German>
<Polish>Zmniejsz zasięg FCS</Polish>
<Spanish>Ajustar distancia del FCS (abajo)</Spanish>
<Czech>Nastavit FCS Náměr (dolů)</Czech>
<French>Réduire la distance du SCT</French>
<Hungarian>FCS tartomány állítása (Le)</Hungarian>
<Portuguese>Ajustar distância do FCS (Abaixo)</Portuguese>
<Italian>Ridurre la distanza dell'FCS</Italian>
<Russian>Диапазон СУО (Ниже)</Russian>
</Key>
<Key ID="STR_ACE_FCS_ResetFCS">
<English>Reset FCS</English>
<German>FLS zurücksetzen</German>
<Spanish>Reiniciar FCS</Spanish>
<French>Réinitialiser le SCT</French>
<Polish>Resetuj FCS</Polish>
<Czech>Resetovat FCS</Czech>
<Hungarian>FCS visszaállítása</Hungarian>
<Portuguese>Reiniciar FCS</Portuguese>
<Italian>Azzeramento dell'FCS</Italian>
<Russian>Обнулить СУО</Russian>
</Key>
<Key ID="STR_ACE_FCS_HasBeenReset">
<English>FCS has been reset.</English>
<German>FLS wurde zurückgesetzt.</German>
<Spanish>FCS reiniciado</Spanish>
<French>SCT réinitialisé.</French>
<Polish>FCS został zresetowany.</Polish>
<Czech>FCS byl resetován.</Czech>
<Hungarian>Az FCS visszaállítva</Hungarian>
<Portuguese>FCS reiniciado.</Portuguese>
<Italian>L'FCS è stato azzerato</Italian>
<Russian>СУО обнулен</Russian>
</Key>
</Package>
</Project>

View File

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

View File

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

View File

@ -0,0 +1,19 @@
class CfgVehicles {
class Man;
class CAManBase: Man {
AGM_GForceCoef = 1;
};
class B_Soldier_05_f;
class B_Pilot_F: B_Soldier_05_f {
AGM_GForceCoef = 0.55;
};
class I_Soldier_04_F;
class I_pilot_F: I_Soldier_04_F {
AGM_GForceCoef = 0.55;
};
class O_helipilot_F;
class O_Pilot_F: O_helipilot_F {
AGM_GForceCoef = 0.55;
};
};

View File

@ -0,0 +1,16 @@
class CfgWeapons {
class ItemCore;
class Uniform_Base: ItemCore {
AGM_GForceCoef = 1;
};
class U_B_PilotCoveralls: Uniform_Base {
AGM_GForceCoef = 0.8;
};
class U_I_pilotCoveralls: Uniform_Base {
AGM_GForceCoef = 0.8;
};
class U_O_PilotCoveralls: Uniform_Base {
AGM_GForceCoef = 0.8;
};
};

View File

@ -0,0 +1,15 @@
#include "script_component.hpp"
if !(hasInterface) exitWith {};
// Setup ppEffect
GVAR(GForces_CC) = ppEffectCreate ["ColorCorrections", 4215];
GVAR(GForces_CC) ppEffectEnable true;
GVAR(GForces_CC) ppEffectForceInNVG true;
GVAR(GForces_CC) ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]];
GVAR(GForces_CC) ppEffectCommit 0.4;
GVAR(lastUpdateTime) = 0;
GVAR(oldVel) = [0,0,0];
[FUNC(pfhUpdateGForces), 0, []] call CBA_fnc_addPerFrameHandler;

View File

@ -0,0 +1,6 @@
#include "script_component.hpp"
PREP(pfhUpdateGForces);
GVAR(GForces) = [];
GVAR(GForces_Index) = 0;

19
addons/gforces/config.cpp Normal file
View File

@ -0,0 +1,19 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"KoffeinFlummi", "CAA-Picard"};
authorUrl = "https://github.com/KoffeinFlummi/";
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
#include "CfgWeapons.hpp"
#include "CfgVehicles.hpp"

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