mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' into agmMapPort
This commit is contained in:
commit
2483e8f8d8
55
README.md
55
README.md
@ -1,4 +1,53 @@
|
||||
ACE3
|
||||
====
|
||||
<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>
|
||||
|
||||
Placeholder.
|
||||
**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).
|
||||
|
@ -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;
|
||||
};
|
@ -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;
|
@ -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;
|
@ -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;
|
@ -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";
|
@ -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;
|
||||
};
|
||||
};
|
@ -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";
|
||||
};
|
@ -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";
|
||||
};
|
@ -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
|
||||
};
|
||||
};
|
@ -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;
|
@ -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'";
|
||||
};
|
||||
};
|
@ -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];
|
||||
}];
|
@ -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
@ -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}
|
@ -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;
|
||||
};
|
||||
};
|
||||
};
|
@ -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;
|
||||
};
|
||||
};
|
@ -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;
|
||||
};
|
@ -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
|
||||
};
|
||||
};
|
||||
};
|
@ -63,13 +63,15 @@ 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)
|
||||
["playerChanged", {
|
||||
EXPLODE_2_PVT(_this,_newPlayer,_oldPlayer);
|
||||
|
||||
if (alive _newPlayer) then {
|
||||
[_newPlayer] call FUNC(setName)
|
||||
};
|
||||
if (alive (_this select 1)) then {
|
||||
[_this select 1] call FUNC(setName)
|
||||
if (alive _oldPlayer) then {
|
||||
[_oldPlayer] call FUNC(setName)
|
||||
};
|
||||
}] call FUNC(addCustomEventhandler);
|
||||
}] call FUNC(addEventhandler);
|
||||
|
||||
|
||||
|
@ -162,19 +162,24 @@ 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;
|
||||
};
|
||||
|
||||
|
||||
|
@ -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
|
||||
};
|
||||
};
|
||||
|
@ -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)
|
||||
|
@ -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];
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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";
|
||||
};
|
||||
};
|
||||
|
@ -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));
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -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?";
|
||||
|
@ -10,42 +10,42 @@ class CfgVehicles {
|
||||
class ACE_SelfActions {
|
||||
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";
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -20,7 +20,7 @@ class CfgPatches {
|
||||
#include "CfgMagazines.hpp"
|
||||
#include "CfgWeapons.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
|
||||
#include "CfgACE_Triggers.hpp"
|
||||
#include "ExplosivesUI.hpp"
|
||||
|
||||
class CfgActions {
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
};
|
||||
};
|
||||
@ -52,12 +52,12 @@ if (_count > 0) then {
|
||||
(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(common,displayTextStructured);
|
||||
};
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
};
|
||||
|
@ -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);
|
||||
};
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
|
@ -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 {};
|
||||
|
@ -60,7 +60,7 @@ 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(common,AddActionEventHandler)];
|
||||
_unit setVariable [QGVAR(Cancel), [_unit, "MenuBack",
|
||||
|
@ -1,6 +1,4 @@
|
||||
/*
|
||||
Name: ACE_Explosives_fnc_startTimer
|
||||
|
||||
Author(s):
|
||||
Garth de Wet (LH)
|
||||
|
||||
@ -19,9 +17,21 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
[{
|
||||
private ["_explosive"];
|
||||
_explosive = _this select 0;
|
||||
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);
|
||||
};
|
||||
},_this select 1, _this] call CALLSTACK(CBA_fnc_addPerFrameHandler);
|
||||
|
||||
// Remove the PFH
|
||||
[_pfhId] call cba_fnc_removePerFrameHandler;
|
||||
},_this select 1, [_this, diag_tickTime]] call CBA_fnc_addPerFrameHandler;
|
||||
|
@ -15,7 +15,7 @@ class CfgVehicles {
|
||||
statement = QUOTE( [_player] call FUNC(putInEarPlugs) );
|
||||
showDisabled = 0;
|
||||
priority = 2.5;
|
||||
icon = QUOTE(PATHTOF(UI\ACE_earplugs_x_ca.paa));
|
||||
icon = PATHTOF(UI\ACE_earplugs_x_ca.paa);
|
||||
hotkey = "E";
|
||||
enableInside = 1;
|
||||
};
|
||||
@ -25,7 +25,7 @@ class CfgVehicles {
|
||||
statement = QUOTE( [_player] call FUNC(removeEarPlugs) );
|
||||
showDisabled = 0;
|
||||
priority = 2.5;
|
||||
icon = QUOTE(PATHTOF(UI\ACE_earplugs_x_ca.paa));
|
||||
icon = PATHTOF(UI\ACE_earplugs_x_ca.paa);
|
||||
hotkey = "E";
|
||||
enableInside = 1;
|
||||
};
|
||||
|
@ -5,8 +5,8 @@ class CfgWeapons {
|
||||
class ACE_EarBuds: ACE_ItemCore {
|
||||
displayName = "$STR_ACE_Hearing_Earbuds_Name";
|
||||
descriptionShort = "$STR_ACE_Hearing_Earbuds_Description";
|
||||
model = QUOTE(PATHTOF(ACE_earplugs.p3d));
|
||||
picture = QUOTE(PATHTOF(UI\ACE_earplugs_x_ca.paa));
|
||||
model = PATHTOF(ACE_earplugs.p3d);
|
||||
picture = PATHTOF(UI\ACE_earplugs_x_ca.paa);
|
||||
scope = 2;
|
||||
class ItemInfo: InventoryItem_Base_F {
|
||||
mass = 1;
|
||||
|
@ -530,7 +530,7 @@ class RscTitles {
|
||||
class controls {
|
||||
class RearIcon: RscInteractionIcon{
|
||||
idc = 999;
|
||||
text = PATHTOF(\UI\CenterIcon_ca.paa);
|
||||
text = PATHTOF(UI\CenterIcon_ca.paa);
|
||||
x = 17.9 * GUI_GRID_W;
|
||||
y = 10 * GUI_GRID_H;
|
||||
w = 3.7 * GUI_GRID_H;
|
||||
@ -570,7 +570,7 @@ class RscTitles {
|
||||
};
|
||||
class BackIcon: RscInteractionIcon{
|
||||
idc = 1210;
|
||||
text = PATHTOF(\UI\backArrow_ca.paa);
|
||||
text = PATHTOF(UI\backArrow_ca.paa);
|
||||
x = 18.25 * GUI_GRID_W;
|
||||
y = 12.69 * GUI_GRID_H;
|
||||
w = 0.5 * GUI_GRID_W;
|
||||
@ -599,7 +599,7 @@ class RscTitles {
|
||||
class controls {
|
||||
class SelectIcon: RscInteractionHelperIcon{
|
||||
idc = 1200;
|
||||
text = PATHTOF(\UI\mouse_left_ca.paa);
|
||||
text = PATHTOF(UI\mouse_left_ca.paa);
|
||||
y = 17.5 * GUI_GRID_H;
|
||||
};
|
||||
class SelectText: RscInteractionText{
|
||||
@ -609,7 +609,7 @@ class RscTitles {
|
||||
};
|
||||
class GoBackIcon: RscInteractionHelperIcon{
|
||||
idc = 1201;
|
||||
text = PATHTOF(\UI\mouse_right_ca.paa);
|
||||
text = PATHTOF(UI\mouse_right_ca.paa);
|
||||
y = 19.5 * GUI_GRID_H;
|
||||
};
|
||||
class GoBackText: RscInteractionText{
|
||||
@ -619,7 +619,7 @@ class RscTitles {
|
||||
};
|
||||
class ScrollIcon: RscInteractionHelperIcon{
|
||||
idc = 1202;
|
||||
text = PATHTOF(\UI\mouse_scroll_ca.paa);
|
||||
text = PATHTOF(UI\mouse_scroll_ca.paa);
|
||||
y = 18.5 * GUI_GRID_H;
|
||||
};
|
||||
class ScrollText: RscInteractionText{
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
ACE_Modifier = 0;
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
GVAR(isOpeningDoor) = false;
|
||||
|
@ -68,9 +68,9 @@ class ACE_Default_Keys {
|
||||
class modifierKey {
|
||||
displayName = "$STR_ACE_Interaction_ModifierKey";
|
||||
condition = "";
|
||||
statement = QUOTE(GVAR(Modifier) = 1;);
|
||||
statement = QUOTE(ACE_Modifier = 1;);
|
||||
conditionUp = "";
|
||||
statementUp = QUOTE(GVAR(Modifier) = 0;);
|
||||
statementUp = QUOTE(ACE_Modifier = 0;);
|
||||
exceptions[] = {"ACE_Drag_isNotDragging"};
|
||||
key = 29;
|
||||
shift = 0;
|
||||
@ -94,9 +94,6 @@ class ACE_Options {
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_Parameters {
|
||||
ACE_Modifier = 0;
|
||||
};
|
||||
class ACE_Parameters_Boolean {
|
||||
ACE_Interaction_EnableTeamManagement = 1;
|
||||
};
|
||||
|
@ -12,4 +12,7 @@ if (isNull (findDisplay 1713999)) then {
|
||||
(findDisplay 1713999) closeDisplay 1;
|
||||
};
|
||||
|
||||
// Raise custom event. @todo: remove
|
||||
[_player, "interactionMenuOpened", [_player, GVAR(Target), 0]] call EFUNC(common,callCustomEventHandlers);
|
||||
// Raise ACE localEvent
|
||||
["interactionMenuOpened", [_player, GVAR(Target), 0]] call EFUNC(common,localEvent);
|
||||
|
@ -12,4 +12,7 @@ if (isNull (findDisplay 1713999)) then {
|
||||
(findDisplay 1713999) closeDisplay 1;
|
||||
};
|
||||
|
||||
// Raise custom event. @todo: remove
|
||||
[_player, "interactionMenuOpened", [_player, GVAR(Target), 1]] call EFUNC(common,callCustomEventHandlers);
|
||||
// Raise ACE localEvent
|
||||
["interactionMenuOpened", [_player, GVAR(Target), 1]] call EFUNC(common,localEvent);
|
||||
|
1
addons/magazinerepack/$PBOPREFIX$
Normal file
1
addons/magazinerepack/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\magazinerepack
|
6
addons/magazinerepack/CfgEventHandlers.hpp
Normal file
6
addons/magazinerepack/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
18
addons/magazinerepack/CfgVehicles.hpp
Normal file
18
addons/magazinerepack/CfgVehicles.hpp
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
class CfgVehicles {
|
||||
class Man;
|
||||
class CAManBase: Man {
|
||||
class ACE_SelfActions {
|
||||
class ACE_RepackMagazines {
|
||||
displayName = "$STR_ACE_MagazineRepack_RepackMagazines";
|
||||
condition = QUOTE(true);
|
||||
statement = QUOTE([_player] call FUNC(magazineRepack));
|
||||
showDisabled = 0;
|
||||
priority = -2;
|
||||
icon = PATHTOF(UI\repack_ca.paa);
|
||||
hotkey = "R";
|
||||
enableInside = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
5
addons/magazinerepack/XEH_preInit.sqf
Normal file
5
addons/magazinerepack/XEH_preInit.sqf
Normal file
@ -0,0 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
PREP(magazineRepack);
|
||||
PREP(magazineRepackCallback);
|
||||
PREP(openSelectMagazineUI);
|
21
addons/magazinerepack/config.cpp
Normal file
21
addons/magazinerepack/config.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common","ace_interaction"};
|
||||
author[] = {"commy2","CAA-Picard"};
|
||||
authorUrl = "https://github.com/commy2/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
|
||||
class ACE_Parameters_Numeric {
|
||||
GVAR(TimePerAmmo) = 1.5;
|
||||
GVAR(TimePerMagazine) = 2.0;
|
||||
};
|
77
addons/magazinerepack/functions/fnc_magazineRepack.sqf
Normal file
77
addons/magazinerepack/functions/fnc_magazineRepack.sqf
Normal file
@ -0,0 +1,77 @@
|
||||
// by commy2, esteldunedain
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_magazines", "_ammos", "_repackTime", "_magazine", "_ammo", "_count", "_index", "_i", "_j", "_ammoToTransfer", "_ammoAvailable", "_ammoNeeded"];
|
||||
|
||||
_unit = _this select 0;
|
||||
|
||||
_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 _unit;
|
||||
|
||||
// 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 EFUNC(common,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 * GVAR(TimePerAmmo) + (count _x) * GVAR(TimePerMagazine)];
|
||||
} forEach _ammos;
|
||||
|
||||
["MagazineRepack", [_magazines, _repackTime]] call EFUNC(common,log);
|
||||
|
||||
[_unit, _magazines, _repackTime] call FUNC(openSelectMagazineUI);
|
106
addons/magazinerepack/functions/fnc_magazineRepackCallback.sqf
Normal file
106
addons/magazinerepack/functions/fnc_magazineRepackCallback.sqf
Normal file
@ -0,0 +1,106 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_magazine", "_ammo", "_ammoCount", "_fullMagazinesCount", "_restAmmo", "_isLoaded", "_weapon", "_reloadAction", "_text", "_picture"];
|
||||
|
||||
_unit = ACE_player; //_this select 0;
|
||||
_magazine = _this select 1;
|
||||
|
||||
// exit if the last magazine of this type was taken out of the backpack
|
||||
if !(_magazine in magazines _unit) exitWith {};
|
||||
|
||||
// get current ammo count
|
||||
_ammo = 0;
|
||||
{
|
||||
if (_x select 0 == _magazine) then {
|
||||
_ammo = _ammo + (_x select 1);
|
||||
};
|
||||
} forEach magazinesAmmoFull _unit;
|
||||
|
||||
// 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
|
||||
_unit removeMagazines _magazine;
|
||||
|
||||
_isLoaded = false;
|
||||
// reload rifle
|
||||
if (_magazine in primaryWeaponMagazine _unit) then {
|
||||
_weapon = primaryWeapon _unit;
|
||||
|
||||
if (_fullMagazinesCount > 0) then {
|
||||
_unit setAmmo [_weapon, _ammoCount];
|
||||
_fullMagazinesCount = _fullMagazinesCount - 1;
|
||||
} else {
|
||||
_unit setAmmo [_weapon, _restAmmo];
|
||||
_restAmmo = 0;
|
||||
};
|
||||
|
||||
if (_weapon == currentWeapon _unit) then {
|
||||
_reloadAction = getText (configFile >> "CfgWeapons" >> _weapon >> "reloadAction");
|
||||
_unit playActionNow _reloadAction;
|
||||
};
|
||||
|
||||
_isLoaded = true;
|
||||
};
|
||||
|
||||
// reload pistol
|
||||
if (_magazine in handgunMagazine _unit) then {
|
||||
_weapon = handgunWeapon _unit;
|
||||
|
||||
if (_fullMagazinesCount > 0) then {
|
||||
_unit setAmmo [_weapon, _ammoCount];
|
||||
_fullMagazinesCount = _fullMagazinesCount - 1;
|
||||
} else {
|
||||
_unit setAmmo [_weapon, _restAmmo];
|
||||
_restAmmo = 0;
|
||||
};
|
||||
|
||||
if (_weapon == currentWeapon _unit) then {
|
||||
_reloadAction = getText (configFile >> "CfgWeapons" >> _weapon >> "reloadAction");
|
||||
_unit playActionNow _reloadAction;
|
||||
};
|
||||
|
||||
_isLoaded = true;
|
||||
};
|
||||
|
||||
// reload rocket launcher (just in case ...)
|
||||
if (_magazine in secondaryWeaponMagazine _unit) then {
|
||||
_weapon = secondaryWeapon _unit;
|
||||
|
||||
if (_fullMagazinesCount > 0) then {
|
||||
_unit setAmmo [_weapon, _ammoCount];
|
||||
_fullMagazinesCount = _fullMagazinesCount - 1;
|
||||
} else {
|
||||
_unit setAmmo [_weapon, _restAmmo];
|
||||
_restAmmo = 0;
|
||||
};
|
||||
|
||||
if (_weapon == currentWeapon _unit) then {
|
||||
_reloadAction = getText (configFile >> "CfgWeapons" >> _weapon >> "reloadAction");
|
||||
_unit playActionNow _reloadAction;
|
||||
};
|
||||
|
||||
_isLoaded = true;
|
||||
};
|
||||
|
||||
// add new magazines
|
||||
for "_a" from 1 to _fullMagazinesCount do {
|
||||
_unit addMagazine _magazine;
|
||||
};
|
||||
|
||||
if (_restAmmo > 0) then {
|
||||
_unit addMagazine [_magazine, _restAmmo];
|
||||
};
|
||||
|
||||
// display text if successful
|
||||
_text = format [localize "STR_ACE_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_ACE_MagazineRepack_RepackedMagazines", _text];
|
||||
|
||||
[_text] call EFUNC(common,displayTextStructured);
|
40
addons/magazinerepack/functions/fnc_openSelectMagazineUI.sqf
Normal file
40
addons/magazinerepack/functions/fnc_openSelectMagazineUI.sqf
Normal file
@ -0,0 +1,40 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_magazines", "_repackTime", "_listIDC", "_count", "_index", "_magazine", "_time", "_displayName", "_picture"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_magazines = _this select 1;
|
||||
_repackTime = _this select 2;
|
||||
|
||||
_count = count _magazines;
|
||||
|
||||
_actions = [localize "STR_ACE_MagazineRepack_SelectMagazineMenu", localize "STR_ACE_MagazineRepack_SelectMagazine"] call EFUNC(interaction,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,
|
||||
[str _unit, _magazine, _time]
|
||||
] call EFUNC(interaction,addSelectableItem);
|
||||
};
|
||||
|
||||
[
|
||||
_actions,
|
||||
{
|
||||
_data = _this;
|
||||
call EFUNC(interaction,hideMenu);
|
||||
if (isNil "_data") exitWith {};
|
||||
_data set [2, [_data select 2] call EFUNC(common,toNumber)];
|
||||
[_data select 2, _data, QFUNC(magazineRepackCallback), localize "STR_ACE_MagazineRepack_RepackingMagazine"] call EFUNC(common,progressBar);
|
||||
[ACE_player] call EFUNC(common,goKneeling);
|
||||
},
|
||||
{
|
||||
call EFUNC(interaction,hideMenu);
|
||||
if !(profileNamespace getVariable [QGVAR(AutoCloseMenu), false]) then {"Default" call EFUNC(interaction,openMenuSelf)};
|
||||
}
|
||||
] call EFUNC(interaction,openSelectMenu);
|
1
addons/magazinerepack/functions/script_component.hpp
Normal file
1
addons/magazinerepack/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\magazinerepack\script_component.hpp"
|
12
addons/magazinerepack/script_component.hpp
Normal file
12
addons/magazinerepack/script_component.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
#define COMPONENT magazinerepack
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_MAGAZINEREPACK
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_ENABLED_MAGAZINEREPACK
|
||||
#define DEBUG_SETTINGS DEBUG_ENABLED_MAGAZINEREPACK
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Edited with tabler - 2014-12-17 -->
|
||||
<Project name="AGM">
|
||||
<Project name="ACE">
|
||||
<Package name="MagazineRepack">
|
||||
<Key ID="STR_AGM_MagazineRepack_RepackMagazines">
|
||||
<Key ID="STR_ACE_MagazineRepack_RepackMagazines">
|
||||
<English>Repack Magazines</English>
|
||||
<German>Magazine umpacken</German>
|
||||
<Spanish>Reorganizar cargadores</Spanish>
|
||||
@ -14,7 +14,7 @@
|
||||
<Hungarian>Újratárazás</Hungarian>
|
||||
<Russian>Перепаковать магазины</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_MagazineRepack_SelectMagazineMenu">
|
||||
<Key ID="STR_ACE_MagazineRepack_SelectMagazineMenu">
|
||||
<English>Select Magazine Menu</English>
|
||||
<German>Magazinauswahlmenü</German>
|
||||
<Spanish>Menú de selección de cargador</Spanish>
|
||||
@ -26,7 +26,7 @@
|
||||
<Hungarian>Fegyvertár menü kiválasztás</Hungarian>
|
||||
<Russian>Меню выбора магазинов</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_MagazineRepack_SelectMagazine">
|
||||
<Key ID="STR_ACE_MagazineRepack_SelectMagazine">
|
||||
<English>Select Mag</English>
|
||||
<German>Magazin auswählen</German>
|
||||
<Spanish>Seleccionar cargador</Spanish>
|
||||
@ -38,7 +38,7 @@
|
||||
<Hungarian>Tár kiválasztása</Hungarian>
|
||||
<Russian>Выбрать магазин</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_MagazineRepack_RepackingMagazine">
|
||||
<Key ID="STR_ACE_MagazineRepack_RepackingMagazine">
|
||||
<English>Repacking Magazines ...</English>
|
||||
<German>Magazine umpacken ...</German>
|
||||
<Spanish>Reorganizando cargadores ...</Spanish>
|
||||
@ -50,7 +50,7 @@
|
||||
<Hungarian>Újratárazás ...</Hungarian>
|
||||
<Russian>Перепаковка магазинов ...</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_MagazineRepack_RepackedMagazines">
|
||||
<Key ID="STR_ACE_MagazineRepack_RepackedMagazines">
|
||||
<English>Repacked Magazines</English>
|
||||
<German>Magazine umgepackt</German>
|
||||
<Spanish>Cargadores reorganizados</Spanish>
|
||||
@ -62,7 +62,7 @@
|
||||
<Hungarian>Újratárazott tárak</Hungarian>
|
||||
<Russian>Магазины перепакованы</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_MagazineRepack_RepackedMagazinesDetail">
|
||||
<Key ID="STR_ACE_MagazineRepack_RepackedMagazinesDetail">
|
||||
<English>%1 full mag(s) and %2 extra round(s)</English>
|
||||
<German>%1 volle(s) Magazin(e) und %2 übrig gebliebene Patrone(n)</German>
|
||||
<Spanish>%1 cargador(es) completo(s) y %2 bala(s) extra(s)</Spanish>
|
@ -198,6 +198,9 @@
|
||||
#define SETMVAR(var1,var2) missionNamespace SETVAR_SYS(var1,var2)
|
||||
#define SETUVAR(var1,var2) uiNamespace SETVAR_SYS(var1,var2)
|
||||
|
||||
#define GETGVAR(var1,var2) GETMVAR(GVAR(var1),var2)
|
||||
#define GETEGVAR(var1,var2,var3) GETMVAR(EGVAR(var1,var2),var3)
|
||||
|
||||
|
||||
#ifdef DISABLE_COMPILE_CACHE
|
||||
#define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf))
|
||||
|
@ -17,7 +17,7 @@ class CfgPatches {
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
|
||||
class ACE_Common_Default_Keys {
|
||||
class ACE_Default_Keys {
|
||||
class showNames {
|
||||
displayName = "$STR_ACE_NameTags_ShowNames";
|
||||
condition = "true";
|
||||
@ -30,7 +30,7 @@ class ACE_Common_Default_Keys {
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_Common_Options {
|
||||
class ACE_Options {
|
||||
class showPlayerNames {
|
||||
displayName = "$STR_ACE_NameTags_ShowPlayerNames";
|
||||
default = 1;
|
||||
|
19
addons/nightvision/CfgEventHandlers.hpp
Normal file
19
addons/nightvision/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,19 @@
|
||||
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_postInitClient) );
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_FiredBIS_EventHandlers {
|
||||
class AllVehicles {
|
||||
class ADDON {
|
||||
clientFiredBIS = QUOTE( _this call FUNC(blending) );
|
||||
};
|
||||
};
|
||||
};
|
22
addons/nightvision/CfgVehicles.hpp
Normal file
22
addons/nightvision/CfgVehicles.hpp
Normal file
@ -0,0 +1,22 @@
|
||||
class CfgVehicles {
|
||||
class All {
|
||||
ACE_NightVision_grain = 0.75;
|
||||
ACE_NightVision_blur = 0.055;
|
||||
};
|
||||
|
||||
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
|
||||
name = #ITEM; \
|
||||
count = COUNT; \
|
||||
};
|
||||
|
||||
class Box_NATO_Support_F;
|
||||
class ACE_Box_Misc: Box_NATO_Support_F {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(ACE_NVG_Gen1,6)
|
||||
MACRO_ADDITEM(ACE_NVG_Gen2,6)
|
||||
//MACRO_ADDITEM(ACE_NVG_Gen3,6)
|
||||
MACRO_ADDITEM(ACE_NVG_Gen4,6)
|
||||
MACRO_ADDITEM(ACE_NVG_Wide,6)
|
||||
};
|
||||
};
|
||||
};
|
56
addons/nightvision/CfgWeapons.hpp
Normal file
56
addons/nightvision/CfgWeapons.hpp
Normal file
@ -0,0 +1,56 @@
|
||||
class CfgWeapons {
|
||||
class Binocular;
|
||||
class NVGoggles: Binocular {
|
||||
displayName = "$STR_ACE_NightVision_NVG_Gen3_brown";
|
||||
ACE_NightVision_grain = 0.75;
|
||||
ACE_NightVision_blur = 0.055;
|
||||
ACE_NightVision_radBlur = 0.001;
|
||||
};
|
||||
class NVGoggles_OPFOR: NVGoggles {
|
||||
displayName = "$STR_ACE_NightVision_NVG_Gen3_black";
|
||||
};
|
||||
class NVGoggles_INDEP: NVGoggles {
|
||||
displayName = "$STR_ACE_NightVision_NVG_Gen3_green";
|
||||
};
|
||||
|
||||
class ACE_NVG_Gen1: NVGoggles_OPFOR {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
modelOptics = "\A3\weapons_f\reticle\optics_night";
|
||||
displayName = "$STR_ACE_NightVision_NVG_Gen1";
|
||||
ACE_NightVision_grain = 2.25;
|
||||
ACE_NightVision_blur = 0.22;
|
||||
ACE_NightVision_radBlur = 0.004;
|
||||
};
|
||||
class ACE_NVG_Gen2: NVGoggles_INDEP {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
modelOptics = "\A3\weapons_f\reticle\optics_night";
|
||||
displayName = "$STR_ACE_NightVision_NVG_Gen2";
|
||||
ACE_NightVision_grain = 1.5;
|
||||
ACE_NightVision_blur = 0.11;
|
||||
ACE_NightVision_radBlur = 0.002;
|
||||
};
|
||||
/*class ACE_NVG_Gen3: NVGoggles {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
modelOptics = "\A3\weapons_f\reticle\optics_night";
|
||||
displayName = "$STR_ACE_NightVision_NVG_Gen3";
|
||||
ACE_NightVision_grain = 0.75;
|
||||
ACE_NightVision_blur = 0.055;
|
||||
ACE_NightVision_radBlur = 0.001;
|
||||
};*/
|
||||
class ACE_NVG_Gen4: NVGoggles {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
modelOptics = "\A3\weapons_f\reticle\optics_night";
|
||||
displayName = "$STR_ACE_NightVision_NVG_Gen4";
|
||||
ACE_NightVision_grain = 0.0;
|
||||
ACE_NightVision_blur = 0.0;
|
||||
ACE_NightVision_radBlur = 0.0;
|
||||
};
|
||||
class ACE_NVG_Wide: NVGoggles {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
modelOptics = QUOTE(PATHTOF(ACE_nvg_wide_optics));
|
||||
displayName = "$STR_ACE_NightVision_NVG_FullScreen";
|
||||
ACE_NightVision_grain = 0.75;
|
||||
ACE_NightVision_blur = 0.055;
|
||||
ACE_NightVision_radBlur = 0.001;
|
||||
};
|
||||
};
|
38
addons/nightvision/XEH_postInitClient.sqf
Normal file
38
addons/nightvision/XEH_postInitClient.sqf
Normal file
@ -0,0 +1,38 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
GVAR(ppEffectBlur) = ppEffectCreate ["dynamicBlur", 1234];
|
||||
GVAR(ppEffectBlur) ppEffectForceInNVG true;
|
||||
GVAR(ppEffectBlur) ppEffectAdjust [0];
|
||||
GVAR(ppEffectBlur) ppEffectCommit 0;
|
||||
|
||||
GVAR(ppEffectRadialBlur) = ppEffectCreate ["radialBlur", 1238];
|
||||
GVAR(ppEffectRadialBlur) ppEffectForceInNVG true;
|
||||
GVAR(ppEffectRadialBlur) ppEffectAdjust [0, 0, 0, 0];
|
||||
GVAR(ppEffectRadialBlur) ppEffectCommit 0;
|
||||
|
||||
GVAR(ppEffectFilmGrain) = ppEffectCreate ["FilmGrain", 1235];
|
||||
GVAR(ppEffectFilmGrain) ppEffectAdjust [0.25, 2.5, 2.5, 2.5*0.3, 2.5*0.3, false];
|
||||
GVAR(ppEffectFilmGrain) ppEffectCommit 0;
|
||||
|
||||
GVAR(ppEffectNVGBrightness) = ppEffectCreate ["ColorCorrections", 1236];
|
||||
GVAR(ppEffectNVGBrightness) ppEffectForceInNVG true;
|
||||
GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
|
||||
GVAR(ppEffectNVGBrightness) ppEffectCommit 0;
|
||||
|
||||
GVAR(ppEffectMuzzleFlash) = ppEffectCreate ["ColorCorrections", 1237];
|
||||
GVAR(ppEffectMuzzleFlash) ppEffectEnable true;
|
||||
GVAR(ppEffectMuzzleFlash) ppEffectForceInNVG true;
|
||||
GVAR(ppEffectMuzzleFlash) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
|
||||
GVAR(ppEffectMuzzleFlash) ppEffectCommit 0;
|
||||
|
||||
//Setup global variables for the ppEffectUpdater
|
||||
GVAR(lastFrameView) = "";
|
||||
GVAR(lastFrameVehicle) = objNull;
|
||||
GVAR(lastFrameTurret) = [-1];
|
||||
GVAR(lastFrameHMD) = "";
|
||||
GVAR(currentMode) = 0;
|
||||
|
||||
[FUNC(updatePPEffectsEachFrame), 0, []] call CBA_fnc_addPerFrameHandler;
|
6
addons/nightvision/XEH_preInit.sqf
Normal file
6
addons/nightvision/XEH_preInit.sqf
Normal file
@ -0,0 +1,6 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
PREP(blending);
|
||||
PREP(decreaseNVGBrightness);
|
||||
PREP(increaseNVGBrightness);
|
||||
PREP(updatePPEffectsEachFrame);
|
42
addons/nightvision/config.cpp
Normal file
42
addons/nightvision/config.cpp
Normal file
@ -0,0 +1,42 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {"ACE_NVG_Gen1", "ACE_NVG_Gen2", /*"ACE_NVG_Gen3",*/ "ACE_NVG_Gen4", "ACE_NVG_Wide"};
|
||||
requiredVersion = 0.60;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"commy2", "KoffeinFlummi", "PabstMirror"};
|
||||
authorUrl = "https://github.com/commy2/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "CfgWeapons.hpp"
|
||||
|
||||
|
||||
// class EGVAR(common,Default_Keys) { //???
|
||||
class ACE_common_Default_Keys {
|
||||
class increaseNVGBrightness {
|
||||
displayName = "$STR_ACE_NightVision_IncreaseNVGBrightness";
|
||||
condition = QUOTE( currentVisionMode _player == 1 );
|
||||
statement = QUOTE( [_player, _vehicle] call FUNC(increaseNVGBrightness) );
|
||||
key = 201;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 1;
|
||||
allowHolding = 1;
|
||||
};
|
||||
class decreaseNVGBrightness {
|
||||
displayName = "$STR_ACE_NightVision_DecreaseNVGBrightness";
|
||||
condition = QUOTE( currentVisionMode _player == 1 );
|
||||
statement = QUOTE( [_player, _vehicle] call FUNC(decreaseNVGBrightness) );
|
||||
key = 209;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 1;
|
||||
allowHolding = 1;
|
||||
};
|
||||
};
|
@ -1,4 +1,5 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_weapon", "_ammo", "_magazine", "_player"];
|
||||
|
||||
@ -7,9 +8,11 @@ _weapon = _this select 1;
|
||||
_ammo = _this select 4;
|
||||
_magazine = _this select 5;
|
||||
|
||||
_player = AGM_player;
|
||||
if ((_vehicle != (vehicle ACE_player)) || {(currentVisionMode _vehicle) != 1}) exitWith {};
|
||||
|
||||
if (_player != _vehicle && {!(_weapon in (_vehicle weaponsTurret ([_player] call AGM_Core_fnc_getTurretIndex)))}) exitWith {};
|
||||
_player = ACE_player;
|
||||
|
||||
if (_player != _vehicle && {!(_weapon in (_vehicle weaponsTurret ([_player] call EFUNC(common,getTurretIndex))))}) exitWith {};
|
||||
|
||||
private ["_silencer", "_visibleFireCoef", "_visibleFireTimeCoef", "_visibleFire", "_visibleFireTime", "_nvgBrightnessCoef", "_fnc_isTracer", "_darkness"];
|
||||
|
||||
@ -30,7 +33,7 @@ if (_silencer != "") then {
|
||||
_visibleFire = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFire");
|
||||
_visibleFireTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFireTime");
|
||||
|
||||
_nvgBrightnessCoef = 1 + (_player getVariable ["AGM_NVGBrightness", 0]) / 4;
|
||||
_nvgBrightnessCoef = 1 + (_player getVariable [QGVAR(NVGBrightness), 0]) / 4;
|
||||
|
||||
_fnc_isTracer = {
|
||||
private ["_indexShot", "_lastRoundsTracer", "_tracersEvery"];
|
||||
@ -53,15 +56,15 @@ if (call _fnc_isTracer) then {
|
||||
_visibleFireTime = _visibleFireTime + 2;
|
||||
};
|
||||
|
||||
_darkness = 1 - (call AGM_Core_fnc_ambientBrightness);
|
||||
_darkness = 1 - (call EFUNC(common,ambientBrightness));
|
||||
|
||||
_visibleFire = _darkness * _visibleFireCoef * _visibleFire * _nvgBrightnessCoef / 10 min 1;
|
||||
_visibleFireTime = _darkness * _visibleFireTimeCoef * _visibleFireTime * _nvgBrightnessCoef / 10 min 0.5;
|
||||
|
||||
["NightVision", [_visibleFire, _visibleFireTime], {format ["visibleFire: %1 - visibleFireTime: %2", _this select 0, _this select 1]}] call AGM_Debug_fnc_log;
|
||||
// ["NightVision", [_visibleFire, _visibleFireTime], {format ["visibleFire: %1 - visibleFireTime: %2", _this select 0, _this select 1]}] call AGM_Debug_fnc_log; //todo
|
||||
|
||||
AGM_NightVision_ppEffectMuzzleFlash ppEffectAdjust [1, 1, _visibleFire, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
|
||||
AGM_NightVision_ppEffectMuzzleFlash ppEffectCommit 0;
|
||||
GVAR(ppEffectMuzzleFlash) ppEffectAdjust [1, 1, _visibleFire, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
|
||||
GVAR(ppEffectMuzzleFlash) ppEffectCommit 0;
|
||||
|
||||
AGM_NightVision_ppEffectMuzzleFlash ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
|
||||
AGM_NightVision_ppEffectMuzzleFlash ppEffectCommit _visibleFireTime;
|
||||
GVAR(ppEffectMuzzleFlash) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
|
||||
GVAR(ppEffectMuzzleFlash) ppEffectCommit _visibleFireTime;
|
21
addons/nightvision/functions/fnc_decreaseNVGBrightness.sqf
Normal file
21
addons/nightvision/functions/fnc_decreaseNVGBrightness.sqf
Normal file
@ -0,0 +1,21 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_player", "_vehicle", "_brightness"];
|
||||
|
||||
_player = _this select 0;
|
||||
_vehicle = _this select 1;
|
||||
|
||||
_brightness = _player getVariable [QGVAR(NVGBrightness), 0];
|
||||
|
||||
if (_brightness > -1) then {
|
||||
_brightness = round (10 * _brightness - 1) / 10;
|
||||
|
||||
_player setVariable [QGVAR(NVGBrightness), _brightness, false];
|
||||
|
||||
GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, 1, _brightness / 4, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
|
||||
GVAR(ppEffectNVGBrightness) ppEffectCommit 0;
|
||||
|
||||
[format [localize "STR_ACE_NightVision_NVGBrightness", format ["%1%", _brightness * 100]]] call EFUNC(common,displayTextStructured);
|
||||
playSound "ACE_Sound_Click";
|
||||
};
|
21
addons/nightvision/functions/fnc_increaseNVGBrightness.sqf
Normal file
21
addons/nightvision/functions/fnc_increaseNVGBrightness.sqf
Normal file
@ -0,0 +1,21 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_player", "_vehicle", "_brightness"];
|
||||
|
||||
_player = _this select 0;
|
||||
_vehicle = _this select 1;
|
||||
|
||||
_brightness = _player getVariable [QGVAR(NVGBrightness), 0];
|
||||
|
||||
if (_brightness < 1) then {
|
||||
_brightness = round (10 * _brightness + 1) / 10;
|
||||
|
||||
_player setVariable [QGVAR(NVGBrightness), _brightness, false];
|
||||
|
||||
GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, 1, _brightness / 4, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
|
||||
GVAR(ppEffectNVGBrightness) ppEffectCommit 0;
|
||||
|
||||
[format [localize "STR_ACE_NightVision_NVGBrightness", format ["%1%", _brightness * 100]]] call EFUNC(common,displayTextStructured);
|
||||
playSound "ACE_Sound_Click";
|
||||
};
|
104
addons/nightvision/functions/fnc_updatePPEffectsEachFrame.sqf
Normal file
104
addons/nightvision/functions/fnc_updatePPEffectsEachFrame.sqf
Normal file
@ -0,0 +1,104 @@
|
||||
//by commy2, PabstMirror
|
||||
|
||||
#include "script_component.hpp"
|
||||
#define MODE_NVG_OFF 0
|
||||
#define MODE_NVG_ON 1
|
||||
#define MODE_NVG_ONZEUS 2
|
||||
|
||||
_fnc_isUsingHMD = {
|
||||
if (GVAR(lastFrameView) != "GUNNER") exitWith {true}; // asume hmd usage outside of gunner view
|
||||
|
||||
if (ACE_player == (driver _currentVehicle)) exitWith {
|
||||
!("NVG" in getArray (_config >> "ViewOptics" >> "visionMode"));
|
||||
};
|
||||
|
||||
private ["_result", "_turretConfig", "_turretConfigOpticsIn"];
|
||||
_result = true;
|
||||
_turretConfig = [_config, GVAR(lastFrameTurret)] call EFUNC(common,getTurretConfigPath);
|
||||
_turretConfigOpticsIn = _turretConfig >> "OpticsIn";
|
||||
|
||||
if (isClass _turretConfigOpticsIn) then {
|
||||
for "_index" from 0 to (count _turretConfig - 1) do {
|
||||
if ("NVG" in getArray (_turretConfig select _index >> "visionMode")) exitWith {_result = false};
|
||||
};
|
||||
} else {
|
||||
//No OpticsIn usualy means RCWS, still need to test on more vehicles
|
||||
_result = false;
|
||||
};
|
||||
_result
|
||||
};
|
||||
|
||||
private ["_currentVehicle", "_grainSetting", "_blurSetting", "_radBlurSetting", "_config"];
|
||||
_currentVehicle = vehicle ACE_player;
|
||||
|
||||
switch (GVAR(currentMode)) do {
|
||||
case (MODE_NVG_OFF): {
|
||||
if ((currentVisionMode ACE_player) == 1) then {
|
||||
GVAR(currentMode) = MODE_NVG_ON;
|
||||
GVAR(ppEffectFilmGrain) ppEffectEnable true;
|
||||
GVAR(ppEffectBlur) ppEffectEnable true;
|
||||
GVAR(ppEffectRadialBlur) ppEffectEnable true;
|
||||
GVAR(ppEffectNVGBrightness) ppEffectEnable true;
|
||||
};
|
||||
};
|
||||
case (MODE_NVG_ON): {
|
||||
if ((currentVisionMode ACE_player) == 0) then {
|
||||
GVAR(currentMode) = MODE_NVG_OFF;
|
||||
GVAR(ppEffectFilmGrain) ppEffectEnable false;
|
||||
GVAR(ppEffectBlur) ppEffectEnable false;
|
||||
GVAR(ppEffectRadialBlur) ppEffectEnable false;
|
||||
GVAR(ppEffectNVGBrightness) ppEffectEnable false;
|
||||
};
|
||||
if (!isNull findDisplay 312) then {
|
||||
GVAR(currentMode) = MODE_NVG_ONZEUS;
|
||||
GVAR(ppEffectFilmGrain) ppEffectEnable false;
|
||||
GVAR(ppEffectBlur) ppEffectEnable false;
|
||||
GVAR(ppEffectRadialBlur) ppEffectEnable false;
|
||||
GVAR(ppEffectNVGBrightness) ppEffectEnable false;
|
||||
} else {
|
||||
if (((hmd ACE_player) != GVAR(lastFrameHMD)) ||
|
||||
{cameraView != GVAR(lastFrameView)} ||
|
||||
{_currentVehicle != GVAR(lastFrameVehicle)} ||
|
||||
{!(([ACE_player] call EFUNC(common,getTurretIndex)) isEqualTo GVAR(lastFrameTurret))}) then {
|
||||
|
||||
GVAR(lastFrameHMD) = hmd ACE_player;
|
||||
GVAR(lastFrameView) = cameraView;
|
||||
GVAR(lastFrameVehicle) = _currentVehicle;
|
||||
GVAR(lastFrameTurret) = [ACE_player] call EFUNC(common,getTurretIndex);
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _currentVehicle;
|
||||
|
||||
if ((_currentVehicle == ACE_player) || _fnc_isUsingHMD) then {
|
||||
_grainSetting = getNumber (configFile >> "CfgWeapons" >> GVAR(lastFrameHMD) >> "ACE_NightVision_grain");
|
||||
_blurSetting = getNumber (configFile >> "CfgWeapons" >> GVAR(lastFrameHMD) >> "ACE_NightVision_blur");
|
||||
_radBlurSetting = getNumber (configFile >> "CfgWeapons" >> GVAR(lastFrameHMD) >> "ACE_NightVision_radBlur");
|
||||
TRACE_3("New NVG Settings From Player NVG",_grainSetting,_blurSetting,_radBlurSetting)
|
||||
} else {
|
||||
_grainSetting = _currentVehicle getVariable ["ACE_NightVision_grain", getNumber (_config >> "ACE_NightVision_grain")];
|
||||
_blurSetting = _currentVehicle getVariable ["ACE_NightVision_blur", getNumber (_config >> "ACE_NightVision_blur")];
|
||||
_radBlurSetting = _currentVehicle getVariable ["ACE_NightVision_radBlur", getNumber (_config >> "ACE_NightVision_radBlur")];
|
||||
TRACE_3("New NVG Settings From Vehicle",_grainSetting,_blurSetting,_radBlurSetting)
|
||||
};
|
||||
|
||||
GVAR(ppEffectFilmGrain) ppEffectAdjust [0.25, 2.5, 2.5, _grainSetting, _grainSetting, false];
|
||||
GVAR(ppEffectFilmGrain) ppEffectCommit 0;
|
||||
GVAR(ppEffectBlur) ppEffectAdjust [_blurSetting];
|
||||
GVAR(ppEffectBlur) ppEffectCommit 0;
|
||||
GVAR(ppEffectRadialBlur) ppEffectAdjust [_radBlurSetting, _radBlurSetting, 0.2, 0.2];
|
||||
GVAR(ppEffectRadialBlur) ppEffectCommit 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
case (MODE_NVG_ONZEUS): {
|
||||
if (isNull findDisplay 312) then {
|
||||
if ((currentVisionMode ACE_player) == 0) then {
|
||||
GVAR(currentMode) = MODE_NVG_OFF;
|
||||
} else {
|
||||
GVAR(currentMode) = MODE_NVG_ON;
|
||||
GVAR(ppEffectFilmGrain) ppEffectEnable true;
|
||||
GVAR(ppEffectBlur) ppEffectEnable true;
|
||||
GVAR(ppEffectRadialBlur) ppEffectEnable true;
|
||||
GVAR(ppEffectNVGBrightness) ppEffectEnable true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
1
addons/nightvision/functions/script_component.hpp
Normal file
1
addons/nightvision/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\nightvision\script_component.hpp"
|
12
addons/nightvision/script_component.hpp
Normal file
12
addons/nightvision/script_component.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
#define COMPONENT nightvision
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_NIGHTVISION
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_NIGHTVISION
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_NIGHTVISION
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Edited with tabler - 2014-12-17 -->
|
||||
<Project name="AGM">
|
||||
<Project name="ACE">
|
||||
<Package name="NightVision">
|
||||
<Key ID="STR_AGM_NightVision_NVG_Gen1">
|
||||
<Key ID="STR_ACE_NightVision_NVG_Gen1">
|
||||
<English>NV Goggles (Gen1)</English>
|
||||
<Czech>Noktovizor (Gen1)</Czech>
|
||||
<French>JVN (Gen1)</French>
|
||||
@ -13,7 +13,7 @@
|
||||
<Russian>ПНВ (Gen1)</Russian>
|
||||
<Spanish>Sistema de visión nocturna (Gen1)</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_NightVision_NVG_Gen2">
|
||||
<Key ID="STR_ACE_NightVision_NVG_Gen2">
|
||||
<English>NV Goggles (Gen2)</English>
|
||||
<Czech>Noktovizor (Gen2)</Czech>
|
||||
<French>JVN (Gen2)</French>
|
||||
@ -24,7 +24,7 @@
|
||||
<Russian>ПНВ (Gen2)</Russian>
|
||||
<Spanish>Sistema de visión nocturna (Gen2)</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_NightVision_NVG_Gen3">
|
||||
<Key ID="STR_ACE_NightVision_NVG_Gen3">
|
||||
<English>NV Goggles (Gen3)</English>
|
||||
<Czech>Noktovizor (Gen3)</Czech>
|
||||
<French>JVN (Gen3)</French>
|
||||
@ -35,7 +35,7 @@
|
||||
<Russian>ПНВ (Gen3)</Russian>
|
||||
<Spanish>Sistema de visión nocturna (Gen3)</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_NightVision_NVG_Gen3_brown">
|
||||
<Key ID="STR_ACE_NightVision_NVG_Gen3_brown">
|
||||
<English>NV Goggles (Gen3, Brown)</English>
|
||||
<Czech>Noktovizor (Gen3, hnědý)</Czech>
|
||||
<French>JVN (Gen3, marron)</French>
|
||||
@ -46,7 +46,7 @@
|
||||
<Russian>ПНВ (Gen3, коричневый)</Russian>
|
||||
<Spanish>Sistema de visión nocturna (Gen3, marrón)</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_NightVision_NVG_Gen3_green">
|
||||
<Key ID="STR_ACE_NightVision_NVG_Gen3_green">
|
||||
<English>NV Goggles (Gen3, Green)</English>
|
||||
<Czech>Noktovizor (Gen3, zelený)</Czech>
|
||||
<French>JVN (Gen3, vertes)</French>
|
||||
@ -57,7 +57,7 @@
|
||||
<Russian>ПНВ (Gen3, зеленый)</Russian>
|
||||
<Spanish>Sistema de visión nocturna (Gen3, verde)</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_NightVision_NVG_Gen3_black">
|
||||
<Key ID="STR_ACE_NightVision_NVG_Gen3_black">
|
||||
<English>NV Goggles (Gen3, Black)</English>
|
||||
<Czech>Noktovizor (Gen3, černý)</Czech>
|
||||
<French>JVN (Gen3, noires)</French>
|
||||
@ -68,7 +68,7 @@
|
||||
<Russian>ПНВ (Gen3, черный)</Russian>
|
||||
<Spanish>Sistema de visión nocturna (Gen3, negro)</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_NightVision_NVG_Gen4">
|
||||
<Key ID="STR_ACE_NightVision_NVG_Gen4">
|
||||
<English>NV Goggles (Gen4)</English>
|
||||
<Czech>Noktovizor (Gen4)</Czech>
|
||||
<French>JVN (Gen4)</French>
|
||||
@ -79,7 +79,7 @@
|
||||
<Russian>ПНВ (Gen4)</Russian>
|
||||
<Spanish>Sistema de visión nocturna (Gen4)</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_NightVision_NVG_FullScreen">
|
||||
<Key ID="STR_ACE_NightVision_NVG_FullScreen">
|
||||
<English>NV Goggles (Wide)</English>
|
||||
<German>NS-Brille (Weitwinkel)</German>
|
||||
<Spanish>Sistema de visión nocturna (Panorámicas)</Spanish>
|
||||
@ -87,7 +87,7 @@
|
||||
<Czech>Noktovizor (Široký)</Czech>
|
||||
<Russian>ПНВ (Широкий)</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_NightVision_NVGBrightness">
|
||||
<Key ID="STR_ACE_NightVision_NVGBrightness">
|
||||
<English>Brightness: %1</English>
|
||||
<German>Helligkeit: %1</German>
|
||||
<Spanish>Brillo: %1</Spanish>
|
||||
@ -99,7 +99,7 @@
|
||||
<Portuguese>Luminosidade: %1</Portuguese>
|
||||
<Italian>Luminosità: %1</Italian>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_NightVision_IncreaseNVGBrightness">
|
||||
<Key ID="STR_ACE_NightVision_IncreaseNVGBrightness">
|
||||
<English>Increase NVG Brightness</English>
|
||||
<German>Nachtsichtgerätshelligkeit erhöhen</German>
|
||||
<Spanish>Aumentar el brillo de las NVG</Spanish>
|
||||
@ -111,7 +111,7 @@
|
||||
<Portuguese>Aumentar Luminosidade do EVN</Portuguese>
|
||||
<Italian>Aumenta la luminosità dell'NVG</Italian>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_NightVision_DecreaseNVGBrightness">
|
||||
<Key ID="STR_ACE_NightVision_DecreaseNVGBrightness">
|
||||
<English>Decrease NVG Brightness</English>
|
||||
<German>Nachtsichtgerätshelligkeit verringern</German>
|
||||
<Spanish>Disminuir el brillo de las NVG</Spanish>
|
1
addons/noradio/$PBOPREFIX$
Normal file
1
addons/noradio/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\noradio
|
6
addons/noradio/CfgEventhandlers.hpp
Normal file
6
addons/noradio/CfgEventhandlers.hpp
Normal file
@ -0,0 +1,6 @@
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
clientInit = QUOTE(call COMPILE_FILE(XEH_post_initClient));
|
||||
serverInit = QUOTE(call COMPILE_FILE(XEH_post_initServer));
|
||||
};
|
||||
};
|
31
addons/noradio/XEH_post_initClient.sqf
Normal file
31
addons/noradio/XEH_post_initClient.sqf
Normal file
@ -0,0 +1,31 @@
|
||||
// by commy2
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
_setupPlayer = {
|
||||
if (!isNull ACE_player) then {
|
||||
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
[ACE_player] call EFUNC(common,muteUnit);
|
||||
ACE_player setVariable [QGVAR(isMuted), true, true];
|
||||
};
|
||||
};
|
||||
|
||||
[_setupPlayer, 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
// Mutes/unmutes units when the player changes
|
||||
["playerChanged", {
|
||||
EXPLODE_2_PVT(_this,_newPlayer,_oldPlayer);
|
||||
|
||||
// On player change mute the new player
|
||||
[_newPlayer] call EFUNC(common,muteUnit);
|
||||
_newPlayer setVariable [QGVAR(isMuted), true, true];
|
||||
|
||||
// Unmute the old player
|
||||
//@todo: sort interaction with medical system
|
||||
if (!(_oldPlayer getVariable ["ACE_isUnconscious", false]) && {alive _oldPlayer}) then {
|
||||
[_oldPlayer] call EFUNC(common,unMuteUnit);
|
||||
};
|
||||
_oldPlayer setVariable [QGVAR(isMuted), false, true];
|
||||
|
||||
}] call EFUNC(common,addEventhandler);
|
10
addons/noradio/XEH_post_initServer.sqf
Normal file
10
addons/noradio/XEH_post_initServer.sqf
Normal file
@ -0,0 +1,10 @@
|
||||
// by commy2
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
addMissionEventHandler ["HandleDisconnect", {
|
||||
if !((_this select 0) getVariable ["ACE_isUnconscious", false]) then { //@ToDo: ai waking up will be silent?
|
||||
_this call EFUNC(common,unMuteUnit);
|
||||
};
|
||||
(_this select 0) setVariable [QGVAR(isMuted), false, true];
|
||||
}];
|
15
addons/noradio/config.cpp
Normal file
15
addons/noradio/config.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"commy2"};
|
||||
authorUrl = "https://github.com/commy2/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventhandlers.hpp"
|
14
addons/noradio/script_component.hpp
Normal file
14
addons/noradio/script_component.hpp
Normal file
@ -0,0 +1,14 @@
|
||||
#define COMPONENT noradio
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
|
||||
#ifdef DEBUG_ENABLED_NORADIO
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_NORADIO
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_NORADIO
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
@ -5,5 +5,6 @@ PREP(clearJam);
|
||||
PREP(cooldown);
|
||||
PREP(jamWeapon);
|
||||
PREP(overheat);
|
||||
PREP(pfhDisplayTemperature);
|
||||
PREP(swapBarrel);
|
||||
PREP(swapBarrelCallback);
|
||||
|
@ -1,64 +1,28 @@
|
||||
// by commy2 and CAA-Picard
|
||||
/*
|
||||
* Author: Commy2 and CAA-Picard
|
||||
*
|
||||
* Make the player check the temperature of his weapon
|
||||
*
|
||||
* Arguments:
|
||||
* 0: _player
|
||||
* 1: _weapon
|
||||
*
|
||||
* Return Values:
|
||||
* None
|
||||
*
|
||||
*/
|
||||
#include "\z\ace\addons\overheating\script_component.hpp"
|
||||
|
||||
_this spawn {
|
||||
_player = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
EXPLODE_2_PVT(_this,_player,_weapon);
|
||||
|
||||
// Calculate cool down of weapon since last shot
|
||||
_string = format [QGVAR(%1), _weapon];
|
||||
_overheat = _player getVariable [_string, [0, 0]];
|
||||
_temperature = _overheat select 0;
|
||||
_time = _overheat select 1;
|
||||
// Play animation and report temperature
|
||||
_action = getText (configFile >> "CfgWeapons" >> _weapon >> "ACE_checkTemperatureAction");
|
||||
|
||||
// Get physical parameters
|
||||
_barrelMass = 0.50 * (getNumber (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "mass") / 22.0) max 1.0;
|
||||
|
||||
// Calculate cooling
|
||||
_temperature = [_temperature, _barrelMass, time - _time] call FUNC(cooldown);
|
||||
|
||||
["Overheating", _temperature, {format ["Temperature: %1 °C", _this]}] call EFUNC(common,log);
|
||||
|
||||
// Store new temperature
|
||||
_time = time;
|
||||
_player setVariable [_string, [_temperature, _time], false];
|
||||
_scaledTemperature = (_temperature / 1000) min 1;
|
||||
|
||||
// Play animation and report temperature
|
||||
_action = getText (configFile >> "CfgWeapons" >> _weapon >> "ACE_checkTemperatureAction");
|
||||
|
||||
if (_action == "") then {
|
||||
if (_action == "") then {
|
||||
_action = "Gear";
|
||||
};
|
||||
|
||||
_player playActionNow _action;
|
||||
|
||||
sleep 1;
|
||||
|
||||
_color = [
|
||||
2 * _scaledTemperature min 1,
|
||||
2 * (1 - _scaledTemperature) min 1,
|
||||
00
|
||||
];
|
||||
|
||||
_count = 2 + round (10 * _scaledTemperature);
|
||||
_string = "";
|
||||
for "_a" from 1 to _count do {
|
||||
_string = _string + "|";
|
||||
};
|
||||
_text = [_string, _color] call EFUNC(common,stringToColoredText);
|
||||
|
||||
_string = "";
|
||||
for "_a" from (_count + 1) to 12 do {
|
||||
_string = _string + "|";
|
||||
};
|
||||
|
||||
_text = composeText [
|
||||
_text,
|
||||
[_string, [0.5, 0.5, 0.5]] call EFUNC(common,stringToColoredTex)t
|
||||
];
|
||||
|
||||
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
|
||||
[_text, _picture] call EFUNC(common,displayTextPicture);
|
||||
};
|
||||
|
||||
_player playActionNow _action;
|
||||
|
||||
// Launch a PFH that waits a sec before displaying the temperature
|
||||
[FUNC(pfhDisplayTemperature), 1.0, [_player, _weapon, diag_tickTime]] call CBA_fnc_addPerFrameHandler;
|
||||
|
@ -1,12 +1,21 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: Commy2
|
||||
*
|
||||
* Clears the jam from a weapon
|
||||
*
|
||||
* Argument:
|
||||
* 0: Last temperature (number)
|
||||
* 1: Barrel mass (number)
|
||||
* 2: Time (number)
|
||||
*
|
||||
* Return value:
|
||||
* New temperature (number)
|
||||
*/
|
||||
#include "\z\ace\addons\overheating\script_component.hpp"
|
||||
|
||||
private ["_unit", "_weapon", "_skipAnim", "_jammedWeapons"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
_skipAnim = _this select 2;
|
||||
EXPLODE_3_PVT(_this,_unit,_weapon,_skipAnim);
|
||||
|
||||
private ["_jammedWeapons"];
|
||||
_jammedWeapons = _unit getVariable [QGVAR(jammedWeapons), []];
|
||||
|
||||
if (_weapon in _jammedWeapons) then {
|
||||
|
@ -13,15 +13,12 @@
|
||||
*/
|
||||
#include "\z\ace\addons\overheating\script_component.hpp"
|
||||
|
||||
private ["_temperature", "_barrelMass", "_totalTime", "_barrelSurface", "_time", "_deltaTime"];
|
||||
|
||||
_temperature = _this select 0;
|
||||
_barrelMass = _this select 1;
|
||||
_totalTime = _this select 2;
|
||||
EXPLODE_3_PVT(_this,_temperature,_barrelMass,_totalTime);
|
||||
|
||||
// If a long time passed since the last shot, there's no need to calculate anything; the weapon should be cool
|
||||
if (_totalTime > 1800) exitWith {0};
|
||||
|
||||
private ["_barrelSurface", "_time", "_deltaTime"];
|
||||
_barrelSurface = _barrelMass / 7850 / 0.003;
|
||||
|
||||
_time = 0;
|
||||
|
@ -1,36 +1,48 @@
|
||||
// based on KK_fnc_playerWeaponMulfunction from KillzoneKid
|
||||
/*
|
||||
* Author: Commy2, based on KK_fnc_playerWeaponMulfunction from KillzoneKid
|
||||
*
|
||||
* Jam the weapon
|
||||
*
|
||||
* Argument:
|
||||
* 0: unit
|
||||
* 1: weapon
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
#include "\z\ace\addons\overheating\script_component.hpp"
|
||||
|
||||
private ["_unit", "_weapon", "_jammedWeapons"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
EXPLODE_2_PVT(_this,_unit,_weapon);
|
||||
|
||||
// don't jam a weapon with no rounds left
|
||||
if (_unit ammo _weapon == 0) exitWith {};
|
||||
|
||||
private ["_jammedWeapons"];
|
||||
_jammedWeapons = _unit getVariable [QGVAR(jammedWeapons), []];
|
||||
_jammedWeapons pushBack _weapon;
|
||||
|
||||
_unit setVariable [QGVAR(jammedWeapons), _jammedWeapons];
|
||||
|
||||
|
||||
// this is to re-activate the 'DefaultAction', so you can jam a weapon while full auto shooting
|
||||
[_unit, _weapon] spawn {
|
||||
_unit = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
_fnc_stopCurrentBurst = {
|
||||
EXPLODE_2_PVT(_this,_params,_pfhId);
|
||||
EXPLODE_4_PVT(_params,_unit,_weapon,_ammo,_startFrame);
|
||||
|
||||
_ammo = _unit ammo _weapon;
|
||||
// Skip the first execution of the PFH
|
||||
if (diag_frameno == _startFrame) exitWith {};
|
||||
|
||||
_frame = diag_frameno;
|
||||
|
||||
if (_ammo > 0) then {
|
||||
_unit setAmmo [_weapon, 0];
|
||||
|
||||
waitUntil {_frame < diag_frameno};
|
||||
// Remove the PFH on the second execution
|
||||
[_pfhId] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
_unit setAmmo [_weapon, _ammo];
|
||||
//[localize "STR_ACE_Overheating_WeaponJammed"] call EFUNC(common,displayTextStructured);
|
||||
};
|
||||
};
|
||||
|
||||
// Stop current burst
|
||||
_ammo = _unit ammo _weapon;
|
||||
if (_ammo > 0) then {
|
||||
_unit setAmmo [_weapon, 0];
|
||||
[_fnc_stopCurrentBurst, 0, [_unit, _weapon, _ammo, diag_frameno]] call cba_fnc_addPerFrameHandler;
|
||||
};
|
||||
|
||||
// only display the hint once, after you try to shoot an already jammed weapon
|
||||
|
@ -1,14 +1,30 @@
|
||||
// by commy2 and CAA-Picard
|
||||
/*
|
||||
* Author: Commy2 and CAA-Picard
|
||||
*
|
||||
* Heat up the weapon
|
||||
*
|
||||
* Argument:
|
||||
* 0: unit
|
||||
* 1: weapon
|
||||
* 2: ammo
|
||||
* 3: projectile
|
||||
* 4: velocity
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
#include "\z\ace\addons\overheating\script_component.hpp"
|
||||
|
||||
private ["_unit", "_weapon", "_ammo", "_projectile", "_velocity", "_variableName", "_overheat", "_temperature", "_time", "_energyIncrement", "_barrelMass", "_scaledTemperature"];
|
||||
|
||||
private ["_unit", "_weapon", "_ammo", "_projectile"];
|
||||
_unit = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
_ammo = _this select 4;
|
||||
_projectile = _this select 6;
|
||||
|
||||
_velocity = velocity _projectile;
|
||||
|
||||
private ["_variableName", "_overheat", "_temperature", "_time", "_energyIncrement", "_barrelMass", "_scaledTemperature"];
|
||||
|
||||
// each weapon has it's own variable. Can't store the temperature in the weapon since they are not objects unfortunately.
|
||||
_variableName = format [QGVAR(%1), _weapon];
|
||||
|
||||
|
74
addons/overheating/functions/fnc_pfhDisplayTemperature.sqf
Normal file
74
addons/overheating/functions/fnc_pfhDisplayTemperature.sqf
Normal file
@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Author: Commy2 and CAA-Picard
|
||||
*
|
||||
* PFH that displays the weapon temperature after a slight delay
|
||||
*
|
||||
* Arguments:
|
||||
* 0: _player
|
||||
* 1: _weapon
|
||||
*
|
||||
* Return Values:
|
||||
* None
|
||||
*
|
||||
*/
|
||||
#include "\z\ace\addons\overheating\script_component.hpp"
|
||||
|
||||
EXPLODE_2_PVT(_this,_params,_pfhId);
|
||||
EXPLODE_3_PVT(_params,_player,_weapon,_startTime);
|
||||
|
||||
// Skip the first execution of the PFH
|
||||
if (diag_tickTime < _startTime + 0.5) exitWith {};
|
||||
|
||||
// Remove the PFH on the second execution
|
||||
[_pfhId] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
// Calculate cool down of weapon since last shot
|
||||
private ["_string", "_overheat", "_temperature", "_time", "_barrelMass"];
|
||||
_string = format [QGVAR(%1), _weapon];
|
||||
_overheat = _player getVariable [_string, [0, 0]];
|
||||
_temperature = _overheat select 0;
|
||||
_time = _overheat select 1;
|
||||
|
||||
// Get physical parameters
|
||||
_barrelMass = 0.50 * (getNumber (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "mass") / 22.0) max 1.0;
|
||||
|
||||
// Calculate cooling
|
||||
_temperature = [_temperature, _barrelMass, time - _time] call FUNC(cooldown);
|
||||
|
||||
//["Overheating", _temperature, {format ["Temperature: %1 °C", _this]}] call EFUNC(common,log);
|
||||
|
||||
// Store new temperature
|
||||
_time = time;
|
||||
_player setVariable [_string, [_temperature, _time], false];
|
||||
|
||||
|
||||
|
||||
private ["_scaledTemperature", "_action", "_color", "_count", "_string", "_text", "_picture"];
|
||||
_scaledTemperature = (_temperature / 1000) min 1;
|
||||
|
||||
_color = [
|
||||
2 * _scaledTemperature min 1,
|
||||
2 * (1 - _scaledTemperature) min 1,
|
||||
00
|
||||
];
|
||||
|
||||
_count = 2 + round (10 * _scaledTemperature);
|
||||
_string = "";
|
||||
for "_a" from 1 to _count do {
|
||||
_string = _string + "|";
|
||||
};
|
||||
_text = [_string, _color] call EFUNC(common,stringToColoredText);
|
||||
|
||||
_string = "";
|
||||
for "_a" from (_count + 1) to 12 do {
|
||||
_string = _string + "|";
|
||||
};
|
||||
|
||||
_text = composeText [
|
||||
_text,
|
||||
[_string, [0.5, 0.5, 0.5]] call EFUNC(common,stringToColoredTex)t
|
||||
];
|
||||
|
||||
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
|
||||
[_text, _picture] call EFUNC(common,displayTextPicture);
|
@ -1,10 +1,18 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: Commy2
|
||||
*
|
||||
* Make a unit start swapping it's barrel
|
||||
*
|
||||
* Argument:
|
||||
* 0: unit
|
||||
* 1: weapon
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
#include "\z\ace\addons\overheating\script_component.hpp"
|
||||
|
||||
private ["_player", "_weapon"];
|
||||
|
||||
_player = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
EXPLODE_2_PVT(_this,_player,_weapon);
|
||||
|
||||
if (stance _player != "PRONE") then {
|
||||
[_player, "amovpknlmstpsraswrfldnon", 1] call EFUNC(common,doAnimation);
|
||||
|
@ -1,10 +1,18 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: Commy2
|
||||
*
|
||||
* Swap barrel callback
|
||||
*
|
||||
* Argument:
|
||||
* 0: unit
|
||||
* 1: weapon
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
#include "\z\ace\addons\overheating\script_component.hpp"
|
||||
|
||||
private ["_player", "_weapon"];
|
||||
|
||||
_player = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
EXPLODE_2_PVT(_this,_player,_weapon);
|
||||
|
||||
// don't consume the barrel, but rotate through them.
|
||||
[localize "STR_ACE_Overheating_SwappedBarrel", QUOTE(PATHTOF(UI\spare_barrel_ca.paa))] call EFUNC(common,displayTextPicture);
|
||||
|
1
addons/reload/$PBOPREFIX$
Normal file
1
addons/reload/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\reload
|
8
addons/reload/CfgActions.hpp
Normal file
8
addons/reload/CfgActions.hpp
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
class CfgActions {
|
||||
class LoadMagazine;
|
||||
class LoadEmptyMagazine : LoadMagazine {
|
||||
showWindow = 0;
|
||||
textDefault = "";
|
||||
};
|
||||
};
|
14
addons/reload/CfgEventHandlers.hpp
Normal file
14
addons/reload/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Take_EventHandlers {
|
||||
class CAManBase {
|
||||
class ACE_AmmoIndicatorReload {
|
||||
clientTake = QUOTE(if (_this select 0 == ACE_player && {(_this select 1) in [ARR_3(uniformContainer (_this select 0), vestContainer (_this select 0), backpackContainer (_this select 0))]} && {_this select 2 == currentMagazine (_this select 0)}) then {[ARR_3(_this select 0, vehicle (_this select 0), true)] call FUNC(checkAmmo)};);
|
||||
};
|
||||
};
|
||||
};
|
24
addons/reload/RscInGameUI.hpp
Normal file
24
addons/reload/RscInGameUI.hpp
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
class RscControlsGroup;
|
||||
class RscText;
|
||||
|
||||
class RscInGameUI {
|
||||
class RscUnitInfo {
|
||||
// Soldiers
|
||||
class WeaponInfoControlsGroupLeft: RscControlsGroup {
|
||||
class controls {
|
||||
class CA_AmmoCount: RscText {
|
||||
sizeEx = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
// Vehicles
|
||||
/*class WeaponInfoControlsGroupRight: RscControlsGroup {
|
||||
class controls {
|
||||
class CA_AmmoCount: RscText {
|
||||
sizeEx = 0;
|
||||
};
|
||||
};
|
||||
};*/
|
||||
};
|
||||
};
|
3
addons/reload/XEH_preInit.sqf
Normal file
3
addons/reload/XEH_preInit.sqf
Normal file
@ -0,0 +1,3 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
PREP(checkAmmo);
|
30
addons/reload/config.cpp
Normal file
30
addons/reload/config.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"commy2","KoffeinFlummi"};
|
||||
authorUrl = "https://github.com/commy2/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgActions.hpp"
|
||||
|
||||
class ACE_Default_Keys {
|
||||
class checkAmmo {
|
||||
displayName = "$STR_ACE_Reload_checkAmmo";
|
||||
condition = QUOTE([_player] call EFUNC(common,canUseWeapon) || {_vehicle isKindOf 'StaticWeapon'});
|
||||
statement = QUOTE([ARR_3(_player, _vehicle, false)] call FUNC(checkAmmo););
|
||||
key = 19;
|
||||
shift = 0;
|
||||
control = 1;
|
||||
alt = 0;
|
||||
};
|
||||
};
|
||||
|
||||
#include "RscInGameUI.hpp"
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user