mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge remote-tracking branch 'origin' into agmScopesPort
This commit is contained in:
commit
79695f00e9
@ -1,94 +0,0 @@
|
||||
#define AVERAGEDURATION 6
|
||||
#define INTERVAL 0.25
|
||||
#define MAXVIRTUALG 5.4
|
||||
|
||||
if !(hasInterface) exitWith {};
|
||||
|
||||
AGM_GForces = [];
|
||||
AGM_GForces_Index = 0;
|
||||
|
||||
AGM_GForces_CC = ppEffectCreate ["ColorCorrections", 4215];
|
||||
AGM_GForces_CC ppEffectEnable true;
|
||||
AGM_GForces_CC ppEffectForceInNVG true;
|
||||
AGM_GForces_CC ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]];
|
||||
AGM_GForces_CC ppEffectCommit 0.4;
|
||||
|
||||
0 spawn {
|
||||
while {True} do {
|
||||
_player = AGM_player;
|
||||
|
||||
if !((vehicle _player isKindOf "Air") or ((getPos _player select 2) > 5)) then {
|
||||
AGM_GForces = [];
|
||||
AGM_GForces_Index = 0;
|
||||
waitUntil {sleep 5; (vehicle _player isKindOf "Air") or ((getPos _player select 2) > 5)};
|
||||
};
|
||||
|
||||
_oldVel = velocity (vehicle _player);
|
||||
sleep INTERVAL;
|
||||
_newVel = velocity (vehicle _player);
|
||||
|
||||
_accel = ((_newVel vectorDiff _oldVel) vectorMultiply (1 / INTERVAL)) vectorAdd [0, 0, 9.8];
|
||||
AGM_GForce_Current = (_accel vectorDotProduct vectorUp (vehicle _player)) / 9.8;
|
||||
|
||||
// Cap maximum G's to +- 10 to avoid g-effects when the update is low fps.
|
||||
AGM_GForce_Current = (AGM_GForce_Current max -10) min 10;
|
||||
|
||||
AGM_GForces set [AGM_GForces_Index, AGM_GForce_Current];
|
||||
AGM_GForces_Index = (AGM_GForces_Index + 1) % round (AVERAGEDURATION / INTERVAL);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* source: http://en.wikipedia.org/wiki/G-LOC
|
||||
* untrained persons without gsuit will fall unconscious between 4 and 6G
|
||||
* pilots in gsuits will sustain up to 9G
|
||||
* a person is for average 12 seconds unconscious
|
||||
* after being unconscious, a person is unable to do simple tasks for average 15 seconds
|
||||
*
|
||||
* _upTolerance converts the effective 9G of a pilot to virtual 5.4G (= 0.8*0.75*9G)
|
||||
* pilots with gsuit will get unconscious at an _average of 9G
|
||||
* normal men without gsuit will get unconscious at an _average of 5.4G
|
||||
*/
|
||||
|
||||
0 spawn {
|
||||
while {True} do {
|
||||
sleep INTERVAL;
|
||||
_player = AGM_player;
|
||||
|
||||
_average = 0;
|
||||
if (count AGM_GForces > 0) then {
|
||||
_sum = 0;
|
||||
{
|
||||
_sum = _sum + _x;
|
||||
} forEach AGM_GForces;
|
||||
_average = _sum / (count AGM_GForces);
|
||||
};
|
||||
|
||||
_downTolerance = _player getVariable ["AGM_GForceCoef",
|
||||
getNumber (configFile >> "CfgVehicles" >> (typeOf _player) >> "AGM_GForceCoef")];
|
||||
_upTolerance = _downTolerance * getNumber (configFile >> "CfgWeapons" >> (uniform _player) >> "AGM_GForceCoef");
|
||||
|
||||
["GForces", [_average, _upTolerance], {format ["_g _avgG _avgG*_upTol: %1, %2, %3", AGM_GForce_Current, _this select 0, (_this select 0) * (_this select 1)]}] call AGM_Debug_fnc_log;
|
||||
|
||||
if (((_average * _upTolerance) > MAXVIRTUALG) and {isClass (configFile >> "CfgPatches" >> "AGM_Medical") and {!(_player getVariable ["AGM_isUnconscious", false])}}) then {
|
||||
[_player, (10 + floor(random 5))] call AGM_Medical_fnc_knockOut;
|
||||
};
|
||||
|
||||
if ((abs _average > 2) and !(_player getVariable ["AGM_isUnconscious", false])) then {
|
||||
if (_average > 0) then {
|
||||
_strength = 1.2 - (((_average - 2) * _upTolerance) / (MAXVIRTUALG - 2));
|
||||
AGM_GForces_CC ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[_strength,_strength,0,0,0,0.1,0.5]];
|
||||
addCamShake [((abs _average) - 2) / 3, 1, 15];
|
||||
} else {
|
||||
_strength = 1.2 - ((((-1 * _average) - 2) * _downTolerance) / (MAXVIRTUALG - 2));
|
||||
AGM_GForces_CC ppEffectAdjust [1,1,0,[1,0.2,0.2,1],[0,0,0,0],[1,1,1,1],[_strength,_strength,0,0,0,0.1,0.5]];
|
||||
addCamShake [((abs _average) - 2) / 5, 1, 15];
|
||||
};
|
||||
} else {
|
||||
AGM_GForces_CC ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]];
|
||||
};
|
||||
|
||||
AGM_GForces_CC ppEffectCommit INTERVAL;
|
||||
};
|
||||
};
|
@ -1,56 +0,0 @@
|
||||
class CfgPatches {
|
||||
class AGM_GForces {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = 0.60;
|
||||
requiredAddons[] = {AGM_Core};
|
||||
version = "0.95";
|
||||
versionStr = "0.95";
|
||||
versionAr[] = {0,95,0};
|
||||
author[] = {"KoffeinFlummi"};
|
||||
authorUrl = "https://github.com/KoffeinFlummi/";
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class AGM_GForces {
|
||||
clientInit = "call compile preprocessFileLineNumbers '\AGM_GForces\clientInit.sqf'";
|
||||
};
|
||||
};
|
||||
|
||||
class CfgWeapons {
|
||||
class ItemCore;
|
||||
class Uniform_Base: ItemCore {
|
||||
AGM_GForceCoef = 1;
|
||||
};
|
||||
|
||||
class U_B_PilotCoveralls: Uniform_Base {
|
||||
AGM_GForceCoef = 0.8;
|
||||
};
|
||||
class U_I_pilotCoveralls: Uniform_Base {
|
||||
AGM_GForceCoef = 0.8;
|
||||
};
|
||||
class U_O_PilotCoveralls: Uniform_Base {
|
||||
AGM_GForceCoef = 0.8;
|
||||
};
|
||||
};
|
||||
|
||||
class CfgVehicles {
|
||||
class Man;
|
||||
class CAManBase: Man {
|
||||
AGM_GForceCoef = 1;
|
||||
};
|
||||
|
||||
class B_Soldier_05_f;
|
||||
class B_Pilot_F: B_Soldier_05_f {
|
||||
AGM_GForceCoef = 0.75;
|
||||
};
|
||||
class I_Soldier_04_F;
|
||||
class I_pilot_F: I_Soldier_04_F {
|
||||
AGM_GForceCoef = 0.75;
|
||||
};
|
||||
class O_helipilot_F;
|
||||
class O_Pilot_F: O_helipilot_F {
|
||||
AGM_GForceCoef = 0.75;
|
||||
};
|
||||
};
|
@ -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];
|
||||
}];
|
@ -29,5 +29,5 @@
|
||||
};
|
||||
|
||||
// don't show speed and height when in expert mode
|
||||
["Parachute", {if (!cadetMode) then {_dlg = _this select 0; {(_dlg displayCtrl _x) ctrlShow false} forEach [121, 122, 1004, 1005, 1006, 1014];};}] call AGM_Core_fnc_addInfoDisplayEventHandler;
|
||||
["Soldier", {if (!cadetMode) then {_dlg = _this select 0; {_ctrl = (_dlg displayCtrl _x); _ctrl ctrlSetPosition [0,0,0,0]; _ctrl ctrlCommit 0;} forEach [380, 382]};}] call AGM_Core_fnc_addInfoDisplayEventHandler;
|
||||
["Parachute", {if (!cadetMode) then {_dlg = _this select 0; {(_dlg displayCtrl _x) ctrlShow false} forEach [121, 122, 1004, 1005, 1006, 1014];};}] call AGM_Core_fnc_addInfoDisplayEventHandler; //@todo addEventHandler infoDisplayChanged with select 1 == "Parachute"
|
||||
["Soldier", {if (!cadetMode) then {_dlg = _this select 0; {_ctrl = (_dlg displayCtrl _x); _ctrl ctrlSetPosition [0,0,0,0]; _ctrl ctrlCommit 0;} forEach [380, 382]};}] call AGM_Core_fnc_addInfoDisplayEventHandler; //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"
|
||||
|
@ -2,3 +2,4 @@
|
||||
// by commy2
|
||||
|
||||
//["Soldier", {_player = AGM_player; if (currentWeapon _player in (_player getVariable ["AGM_SafeMode_safedWeapons", []])) then {[false] call AGM_SafeMode_setSafeModeVisual}] call AGM_Core_fnc_addInfoDisplayEventHandler;
|
||||
//@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"
|
@ -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
|
||||
};
|
||||
};
|
||||
};
|
@ -46,4 +46,4 @@ AGM_WeaponSelect_AllMagazines = uiNamespace getVariable "AGM_WeaponSelect_Al
|
||||
|
||||
// hide grenade count if none is selected
|
||||
[uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
|
||||
["Soldier", {[_this select 0, call AGM_WeaponSelect_fnc_getSelectedGrenade != ""] call AGM_WeaponSelect_fnc_toggleGrenadeCount}] call AGM_Core_fnc_addInfoDisplayEventHandler;
|
||||
["Soldier", {[_this select 0, call AGM_WeaponSelect_fnc_getSelectedGrenade != ""] call AGM_WeaponSelect_fnc_toggleGrenadeCount}] call AGM_Core_fnc_addInfoDisplayEventHandler; //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"
|
||||
|
@ -2,24 +2,27 @@
|
||||
class RscInGameUI {
|
||||
class RscUnitInfo;
|
||||
class RscUnitInfoSoldier: RscUnitInfo {
|
||||
onLoad = "uiNamespace setVariable ['ACE_dlgSoldier', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoSoldier', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
|
||||
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgSoldier', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Soldier')])] call FUNC(localEvent););
|
||||
};
|
||||
class RscUnitInfoTank: RscUnitInfo {
|
||||
onLoad = "uiNamespace setVariable ['ACE_dlgVehicle', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoVehicle', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
|
||||
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgVehicle', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Vehicle')])] call FUNC(localEvent););
|
||||
};
|
||||
class RscUnitInfoAir: RscUnitInfo {
|
||||
onLoad = "uiNamespace setVariable ['ACE_dlgAircraft', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAircraft', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
|
||||
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent););
|
||||
};
|
||||
class RscUnitInfoSubmarine: RscUnitInfo {
|
||||
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgSubmarine', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Submarine')])] call FUNC(localEvent););
|
||||
};
|
||||
class RscUnitInfoShip: RscUnitInfo {
|
||||
onLoad = "uiNamespace setVariable ['ACE_dlgShip', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoShip', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
|
||||
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgShip', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Ship')])] call FUNC(localEvent););
|
||||
};
|
||||
class RscUnitInfoParachute: RscUnitInfo {
|
||||
onLoad = "uiNamespace setVariable ['ACE_dlgParachute', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoParachute', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
|
||||
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgParachute', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Parachute')])] call FUNC(localEvent););
|
||||
};
|
||||
};
|
||||
|
||||
class RscDisplayInventory {
|
||||
onLoad = "[""onLoad"",_this,""RscDisplayInventory"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInventory', [-1, [], []]]) select 2);";
|
||||
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDisplayInventory"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; [ARR_2('inventoryDisplayLoaded', _this)] call FUNC(localEvent););
|
||||
};
|
||||
|
||||
class RscDisplayChannel {
|
||||
|
@ -19,9 +19,8 @@ if (_currentVersion != _previousVersion) then {
|
||||
|
||||
0 spawn COMPILE_FILE(scripts\Version\checkVersionNumber);
|
||||
|
||||
//add network event handlers
|
||||
"ACEg" addPublicVariableEventHandler { _this call FUNC(_handletNetEvent); };
|
||||
"ACEc" addPublicVariableEventHandler { _this call FUNC(_handletNetEvent); };
|
||||
"ACEg" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); };
|
||||
"ACEc" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); };
|
||||
|
||||
// everything that only player controlled machines need, goes below this
|
||||
if (!hasInterface) exitWith {};
|
||||
@ -63,13 +62,73 @@ call COMPILE_FILE(scripts\KeyInput\initScrollWheel);
|
||||
enableCamShake true;
|
||||
|
||||
// Set the name for the current player
|
||||
[missionNamespace, "playerChanged", {
|
||||
if (alive (_this select 0)) then {
|
||||
[_this select 0] call FUNC(setName)
|
||||
};
|
||||
if (alive (_this select 1)) then {
|
||||
[_this select 1] call FUNC(setName)
|
||||
};
|
||||
}] call FUNC(addCustomEventhandler);
|
||||
["playerChanged", {
|
||||
EXPLODE_2_PVT(_this,_newPlayer,_oldPlayer);
|
||||
|
||||
if (alive _newPlayer) then {
|
||||
[_newPlayer] call FUNC(setName)
|
||||
};
|
||||
if (alive _oldPlayer) then {
|
||||
[_oldPlayer] call FUNC(setName)
|
||||
};
|
||||
}] call FUNC(addEventhandler);
|
||||
|
||||
GVAR(OldPlayerInventory) = ACE_player call FUNC(getAllGear);
|
||||
GVAR(OldPlayerVisionMode) = currentVisionMode ACE_player;
|
||||
GVAR(OldZeusDisplayIsOpen) = !(isNull findDisplay 312);
|
||||
GVAR(OldCameraView) = cameraView;
|
||||
GVAR(OldPlayerVehicle) = vehicle ACE_player;
|
||||
GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex);
|
||||
|
||||
// PFH to raise varios events
|
||||
[{
|
||||
|
||||
// "playerInventoryChanged" event
|
||||
_newPlayerInventory = ACE_player call FUNC(getAllGear);
|
||||
if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then {
|
||||
// Raise ACE event locally
|
||||
GVAR(OldPlayerInventory) = _newPlayerInventory;
|
||||
["playerInventoryChanged", [ACE_player, _newPlayerInventory]] call FUNC(localEvent);
|
||||
};
|
||||
|
||||
// "playerVisionModeChanged" event
|
||||
_newPlayerVisionMode = currentVisionMode ACE_player;
|
||||
if !(_newPlayerVisionMode isEqualTo GVAR(OldPlayerVisionMode)) then {
|
||||
// Raise ACE event locally
|
||||
GVAR(OldPlayerVisionMode) = _newPlayerVisionMode;
|
||||
["playerVisionModeChanged", [ACE_player, _newPlayerVisionMode]] call FUNC(localEvent);
|
||||
};
|
||||
|
||||
// "zeusDisplayChanged" event
|
||||
_newZeusDisplayIsOpen = !(isNull findDisplay 312);
|
||||
if !(_newZeusDisplayIsOpen isEqualTo GVAR(OldZeusDisplayIsOpen)) then {
|
||||
// Raise ACE event locally
|
||||
GVAR(OldZeusDisplayIsOpen) = _newZeusDisplayIsOpen;
|
||||
["zeusDisplayChanged", [ACE_player, _newZeusDisplayIsOpen]] call FUNC(localEvent);
|
||||
};
|
||||
|
||||
// "cameraViewChanged" event
|
||||
_newCameraView = cameraView;
|
||||
if !(_newCameraView isEqualTo GVAR(OldCameraView)) then {
|
||||
// Raise ACE event locally
|
||||
GVAR(OldCameraView) = _newCameraView;
|
||||
["cameraViewChanged", [ACE_player, _newCameraView]] call FUNC(localEvent);
|
||||
};
|
||||
|
||||
// "playerVehicleChanged" event
|
||||
_newPlayerVehicle = vehicle ACE_player;
|
||||
if !(_newPlayerVehicle isEqualTo GVAR(OldPlayerVehicle)) then {
|
||||
// Raise ACE event locally
|
||||
GVAR(OldPlayerVehicle) = _newPlayerVehicle;
|
||||
["playerVehicleChanged", [ACE_player, _newPlayerVehicle]] call FUNC(localEvent);
|
||||
};
|
||||
|
||||
// "playerTurretChanged" event
|
||||
[ACE_player] call FUNC(getTurretIndex);
|
||||
if !(_newPlayerTurret isEqualTo GVAR(OldPlayerTurret)) then {
|
||||
// Raise ACE event locally
|
||||
GVAR(OldPlayerTurret) = _newPlayerTurret;
|
||||
["playerTurretChanged", [ACE_player, _newPlayerTurret]] call FUNC(localEvent);
|
||||
};
|
||||
|
||||
}, 0, []] call cba_fnc_addPerFrameHandler;
|
||||
|
@ -6,9 +6,7 @@ PREP(addActionEventHandler);
|
||||
PREP(addActionMenuEventHandler);
|
||||
PREP(addCameraEventHandler);
|
||||
PREP(addCustomEventHandler);
|
||||
PREP(addInfoDisplayEventHandler);
|
||||
PREP(addMapMarkerCreatedEventHandler);
|
||||
PREP(addInventoryDisplayLoadedEventHandler);
|
||||
PREP(addScrollWheelEventHandler);
|
||||
PREP(adminKick);
|
||||
PREP(ambientBrightness);
|
||||
@ -38,6 +36,7 @@ PREP(execRemoteFnc);
|
||||
PREP(executePersistent);
|
||||
PREP(filter);
|
||||
PREP(fixLoweredRifleAnimation);
|
||||
PREP(getAllGear);
|
||||
PREP(getCaptivityStatus);
|
||||
PREP(getConfigCommander);
|
||||
PREP(getConfigGunner);
|
||||
@ -100,8 +99,6 @@ PREP(removeActionEventHandler);
|
||||
PREP(removeActionMenuEventHandler);
|
||||
PREP(removeCameraEventHandler);
|
||||
PREP(removeCustomEventHandler);
|
||||
PREP(removeInfoDisplayEventHandler);
|
||||
PREP(removeInventoryDisplayLoadedEventHandler);
|
||||
PREP(removeMapMarkerCreatedEventHandler);
|
||||
PREP(removeScrollWheelEventHandler);
|
||||
PREP(restoreVariablesJIP);
|
||||
@ -162,19 +159,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;
|
||||
};
|
||||
|
||||
|
||||
|
@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Add a unit info type handler.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Type. Can be "Soldier", "Vehicle", "Aircraft", "Ship", "Parachute" or "Any". "Any" will execute for any compatible display (String)
|
||||
* 1: Code to execute (Code or String)
|
||||
*
|
||||
* Return value:
|
||||
* ID of the event script (used to remove it later).
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_type", "_statement", "_actionsVar", "_id", "_actionIDs", "_actions"];
|
||||
|
||||
_type = format ["ACE_onLoadInfo%1", _this select 0];
|
||||
_statement = _this select 1;
|
||||
|
||||
if (typeName _statement == "STRING") then {
|
||||
_statement = compile _statement;
|
||||
};
|
||||
|
||||
_actionsVar = missionNamespace getVariable [_type, [-1, [], []]];
|
||||
|
||||
_id = (_actionsVar select 0) + 1;
|
||||
_actionIDs = _actionsVar select 1;
|
||||
_actions = _actionsVar select 2;
|
||||
|
||||
_actionIDs pushBack _id;
|
||||
_actions pushBack _statement;
|
||||
|
||||
missionNamespace setVariable [_type, [_id, _actionIDs, _actions]];
|
||||
|
||||
_id
|
@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Add an inventory display opened handler.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Code to execute (Code or String)
|
||||
*
|
||||
* Return value:
|
||||
* ID of the event script (used to remove it later).
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"];
|
||||
|
||||
_statement = _this select 0;
|
||||
|
||||
if (typeName _statement == "STRING") then {
|
||||
_statement = compile _statement;
|
||||
};
|
||||
|
||||
_actionsVar = missionNamespace getVariable ["ACE_onLoadInventory", [-1, [], []]];
|
||||
|
||||
_id = (_actionsVar select 0) + 1;
|
||||
_actionIDs = _actionsVar select 1;
|
||||
_actions = _actionsVar select 2;
|
||||
|
||||
_actionIDs pushBack _id;
|
||||
_actions pushBack _statement;
|
||||
|
||||
missionNamespace setVariable ["ACE_onLoadInventory", [_id, _actionIDs, _actions]];
|
||||
|
||||
_id
|
@ -1,26 +1,21 @@
|
||||
/*
|
||||
Name: ACE_Respawn_fnc_getAllGear
|
||||
|
||||
Author(s):
|
||||
bux578
|
||||
|
||||
Description:
|
||||
returns an array containing all items of a given unit
|
||||
|
||||
Parameters:
|
||||
0: OBJECT - unit
|
||||
|
||||
Returns:
|
||||
ARRAY
|
||||
*/
|
||||
|
||||
* Author: bux578
|
||||
*
|
||||
* Returns an array containing all items of a given unit
|
||||
*
|
||||
* Argument:
|
||||
* 0: Unit (Object)
|
||||
*
|
||||
* Return value:
|
||||
* Array with all the gear
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_allGear"];
|
||||
EXPLODE_1_PVT(_this,_unit);
|
||||
|
||||
_unit = _this select 0;
|
||||
if (isNull _unit) exitWith {[]};
|
||||
|
||||
_allGear = [
|
||||
[
|
||||
(headgear _unit),
|
||||
(goggles _unit),
|
||||
(uniform _unit),
|
||||
@ -40,6 +35,4 @@ _allGear = [
|
||||
(handgunMagazine _unit),
|
||||
(assignedItems _unit),
|
||||
(binocular _unit)
|
||||
];
|
||||
|
||||
_allGear
|
||||
]
|
@ -16,6 +16,8 @@ private ["_unit", "_vehicle", "_turrets", "_units", "_index"];
|
||||
_unit = _this select 0;
|
||||
_vehicle = vehicle _unit;
|
||||
|
||||
if (_unit == _vehicle) exitWith {[]};
|
||||
|
||||
//_turrets = [typeOf _vehicle] call FUNC(getTurrets);
|
||||
_turrets = allTurrets [_vehicle, true];
|
||||
|
||||
|
@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Remove a unit info type event handler.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Type. Can be "Soldier", "Vehicle", "Aircraft" or "Parachute" (String)
|
||||
* 1: ID of the event handler (Number)
|
||||
*
|
||||
* Return value:
|
||||
* None.
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_type", "_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"];
|
||||
|
||||
_type = format ["ACE_onLoadInfo%1", _this select 0];
|
||||
_id = _this select 1;
|
||||
|
||||
_actionsVar = missionNamespace getVariable [_type, [-1, [], []]];
|
||||
|
||||
_currentId = _actionsVar select 0;
|
||||
_actionIDs = _actionsVar select 1;
|
||||
_actions = _actionsVar select 2;
|
||||
|
||||
_id = _actionIDs find _id;
|
||||
|
||||
if (_id == -1) exitWith {};
|
||||
|
||||
_actionIDs deleteAt _id;
|
||||
_actions deleteAt _id;
|
||||
|
||||
missionNamespace setVariable [_type, [_currentId, _actionIDs, _actions]];
|
@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Remove an inventory display opened handler.
|
||||
*
|
||||
* Argument:
|
||||
* 0: ID of the event handler (Number)
|
||||
*
|
||||
* Return value:
|
||||
* None.
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"];
|
||||
|
||||
_id = _this select 0;
|
||||
|
||||
_actionsVar = missionNamespace getVariable ["ACE_onLoadInventory", [-1, [], []]];
|
||||
|
||||
_currentId = _actionsVar select 0;
|
||||
_actionIDs = _actionsVar select 1;
|
||||
_actions = _actionsVar select 2;
|
||||
|
||||
_id = _actionIDs find _id;
|
||||
|
||||
if (_id == -1) exitWith {};
|
||||
|
||||
_actionIDs deleteAt _id;
|
||||
_actions deleteAt _id;
|
||||
|
||||
missionNamespace setVariable ["ACE_onLoadInventory", [_currentId, _actionIDs, _actions]];
|
@ -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;
|
||||
|
@ -5,9 +5,9 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (isNil QGVAR(UpdateInventoryDisplay_EHID)) then {
|
||||
GVAR(UpdateInventoryDisplay_EHID) = [{
|
||||
GVAR(UpdateInventoryDisplay_EHID) = ["inventoryDisplayLoaded",{
|
||||
_player = ACE_player;
|
||||
[_player, secondaryWeapon _player] call FUNC(takeLoadedATWeapon);
|
||||
[_player, (_this select 0)] call FUNC(updateInventoryDisplay);
|
||||
}] call EFUNC(common,addInventoryDisplayLoadedEventHandler);
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
};
|
||||
|
@ -17,21 +17,21 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
[{
|
||||
private ["_explosive", "_params", "_pfhId", "_placeTime", "_fuseTime"];
|
||||
_params = _this select 0;
|
||||
_pfhId = _this select 1;
|
||||
EXPLODE_2_PVT(_this,_params,_pfhId);
|
||||
|
||||
private ["_placeTime", "_fuseTime", "_explosive"];
|
||||
_placeTime = _params select 1;
|
||||
_fuseTime = _params select 0 select 1;
|
||||
|
||||
// Skip first execution
|
||||
if (diag_tickTime < _placeTime + _fuseTime / 2) exitWith {};
|
||||
// Exit if it's not time to detonate yet
|
||||
if (time < _placeTime + _fuseTime) exitWith {};
|
||||
|
||||
// Remove the PFH
|
||||
[_pfhId] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
_explosive = (_params select 0) select 0;
|
||||
if (!isNull _explosive) then {
|
||||
[_explosive, -1, [_explosive, 0], true] call FUNC(detonateExplosive);
|
||||
};
|
||||
|
||||
// Remove the PFH
|
||||
[_pfhId] call cba_fnc_removePerFrameHandler;
|
||||
},_this select 1, [_this, diag_tickTime]] call CBA_fnc_addPerFrameHandler;
|
||||
},0, [_this, time]] call CBA_fnc_addPerFrameHandler;
|
||||
|
1
addons/gforces/$PBOPREFIX$
Normal file
1
addons/gforces/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\hearing
|
12
addons/gforces/CfgEventHandlers.hpp
Normal file
12
addons/gforces/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit) );
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
clientInit = QUOTE( call COMPILE_FILE(XEH_postInit) );
|
||||
};
|
||||
};
|
19
addons/gforces/CfgVehicles.hpp
Normal file
19
addons/gforces/CfgVehicles.hpp
Normal file
@ -0,0 +1,19 @@
|
||||
class CfgVehicles {
|
||||
class Man;
|
||||
class CAManBase: Man {
|
||||
AGM_GForceCoef = 1;
|
||||
};
|
||||
|
||||
class B_Soldier_05_f;
|
||||
class B_Pilot_F: B_Soldier_05_f {
|
||||
AGM_GForceCoef = 0.55;
|
||||
};
|
||||
class I_Soldier_04_F;
|
||||
class I_pilot_F: I_Soldier_04_F {
|
||||
AGM_GForceCoef = 0.55;
|
||||
};
|
||||
class O_helipilot_F;
|
||||
class O_Pilot_F: O_helipilot_F {
|
||||
AGM_GForceCoef = 0.55;
|
||||
};
|
||||
};
|
16
addons/gforces/CfgWeapons.hpp
Normal file
16
addons/gforces/CfgWeapons.hpp
Normal file
@ -0,0 +1,16 @@
|
||||
class CfgWeapons {
|
||||
class ItemCore;
|
||||
class Uniform_Base: ItemCore {
|
||||
AGM_GForceCoef = 1;
|
||||
};
|
||||
|
||||
class U_B_PilotCoveralls: Uniform_Base {
|
||||
AGM_GForceCoef = 0.8;
|
||||
};
|
||||
class U_I_pilotCoveralls: Uniform_Base {
|
||||
AGM_GForceCoef = 0.8;
|
||||
};
|
||||
class U_O_PilotCoveralls: Uniform_Base {
|
||||
AGM_GForceCoef = 0.8;
|
||||
};
|
||||
};
|
15
addons/gforces/XEH_postInit.sqf
Normal file
15
addons/gforces/XEH_postInit.sqf
Normal file
@ -0,0 +1,15 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
if !(hasInterface) exitWith {};
|
||||
|
||||
// Setup ppEffect
|
||||
GVAR(GForces_CC) = ppEffectCreate ["ColorCorrections", 4215];
|
||||
GVAR(GForces_CC) ppEffectEnable true;
|
||||
GVAR(GForces_CC) ppEffectForceInNVG true;
|
||||
GVAR(GForces_CC) ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]];
|
||||
GVAR(GForces_CC) ppEffectCommit 0.4;
|
||||
|
||||
GVAR(lastUpdateTime) = 0;
|
||||
GVAR(oldVel) = [0,0,0];
|
||||
|
||||
[FUNC(pfhUpdateGForces), 0, []] call CBA_fnc_addPerFrameHandler;
|
6
addons/gforces/XEH_preInit.sqf
Normal file
6
addons/gforces/XEH_preInit.sqf
Normal file
@ -0,0 +1,6 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
PREP(pfhUpdateGForces);
|
||||
|
||||
GVAR(GForces) = [];
|
||||
GVAR(GForces_Index) = 0;
|
19
addons/gforces/config.cpp
Normal file
19
addons/gforces/config.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"KoffeinFlummi", "CAA-Picard"};
|
||||
authorUrl = "https://github.com/KoffeinFlummi/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
|
||||
#include "CfgWeapons.hpp"
|
||||
|
||||
#include "CfgVehicles.hpp"
|
86
addons/gforces/functions/fnc_pfhUpdateGForces.sqf
Normal file
86
addons/gforces/functions/fnc_pfhUpdateGForces.sqf
Normal file
@ -0,0 +1,86 @@
|
||||
// by KoffeinFlummi and CAA-Picard
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_2_PVT(_this,_params,_pfhId);
|
||||
|
||||
_interval = time - GVAR(lastUpdateTime);
|
||||
|
||||
// Update the g-forces at constant game time intervals
|
||||
if (_interval < INTERVAL) exitWith {};
|
||||
GVAR(lastUpdateTime) = time;
|
||||
|
||||
/*if !(vehicle ACE_player isKindOf "Air") exitWith {
|
||||
GVAR(GForces) = [];
|
||||
GVAR(GForces_Index) = 0;
|
||||
waitUntil {sleep 5; (vehicle _player isKindOf "Air") or ((getPos _player select 2) > 5)};
|
||||
};*/
|
||||
|
||||
_newVel = velocity (vehicle ACE_player);
|
||||
|
||||
_accel = ((_newVel vectorDiff GVAR(oldVel)) vectorMultiply (1 / INTERVAL)) vectorAdd [0, 0, 9.8];
|
||||
_currentGForce = (_accel vectorDotProduct vectorUp (vehicle ACE_player)) / 9.8;
|
||||
|
||||
// Cap maximum G's to +- 10 to avoid g-effects when the update is low fps.
|
||||
_currentGForce = (_currentGForce max -10) min 10;
|
||||
|
||||
GVAR(GForces) set [GVAR(GForces_Index), _currentGForce];
|
||||
GVAR(GForces_Index) = (GVAR(GForces_Index) + 1) % round (AVERAGEDURATION / INTERVAL);
|
||||
GVAR(oldVel) = _newVel;
|
||||
|
||||
/* Source: https://github.com/KoffeinFlummi/AGM/issues/1774#issuecomment-70341573
|
||||
*
|
||||
* For untrained people without g-suits:
|
||||
* GLOC: 5G for 6 s
|
||||
* RedOut: 2.5G for 6 s
|
||||
*
|
||||
* For trained jet pilots without g-suits:
|
||||
* GLOC: 9G for 6 s
|
||||
* RedOut: 4.5G
|
||||
*
|
||||
* For trained jet pilots with g-suits:
|
||||
* GLOC: 10.5G for 6 s
|
||||
* RedOut: 4.5G
|
||||
*
|
||||
* Effects and camera shake start 30% the limit value, and build gradually
|
||||
*/
|
||||
|
||||
_average = 0;
|
||||
if (count GVAR(GForces) > 0) then {
|
||||
_sum = 0;
|
||||
{
|
||||
_sum = _sum + _x;
|
||||
} forEach GVAR(GForces);
|
||||
_average = _sum / (count GVAR(GForces));
|
||||
};
|
||||
|
||||
_classCoef = ACE_player getVariable ["ACE_GForceCoef",
|
||||
getNumber (configFile >> "CfgVehicles" >> (typeOf ACE_player) >> "AGM_GForceCoef")];
|
||||
_suitCoef = getNumber (configFile >> "CfgWeapons" >> (uniform ACE_player) >> "AGM_GForceCoef");
|
||||
|
||||
_gBlackOut = MAXVIRTUALG / _classCoef + MAXVIRTUALG / _suitCoef - MAXVIRTUALG;
|
||||
_gRedOut = MINVIRTUALG / _classCoef;
|
||||
|
||||
["GForces", [], {format ["_g _gBO _coef: %1, %2, %3", _average, _gBlackOut, 2 * ((1.0 - ((_average - 0.30 * _gBlackOut) / (0.70 * _gBlackOut)) ^ 2) max 0) ]}] call EFUNC(common,log);
|
||||
|
||||
// @todo: Sort the interaction with medical
|
||||
if ((_average > _gBlackOut) and {isClass (configFile >> "CfgPatches" >> "ACE_Medical") and {!(ACE_player getVariable ["ACE_isUnconscious", false])}}) then {
|
||||
[ACE_player, (10 + floor(random 5))] call EFUNC(medical,knockOut);
|
||||
};
|
||||
|
||||
GVAR(GForces_CC) ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]];
|
||||
|
||||
if !(ACE_player getVariable ["ACE_isUnconscious", false]) then {
|
||||
if (_average > 0.30 * _gBlackOut) then {
|
||||
_strength = ((_average - 0.30 * _gBlackOut) / (0.70 * _gBlackOut)) max 0;
|
||||
GVAR(GForces_CC) ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[2*(1-_strength),2*(1-_strength),0,0,0,0.1,0.5]];
|
||||
addCamShake [_strength, 1, 15];
|
||||
} else {
|
||||
if (_average < -0.30 * _gRedOut) then {
|
||||
_strength = ((abs _average - 0.30 * _gRedOut) / (0.70 * _gRedOut)) max 0;
|
||||
GVAR(GForces_CC) ppEffectAdjust [1,1,0,[1,0.2,0.2,1],[0,0,0,0],[1,1,1,1],[2*(1-_strength),2*(1-_strength),0,0,0,0.1,0.5]];
|
||||
addCamShake [_strength / 1.5, 1, 15];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
GVAR(GForces_CC) ppEffectCommit INTERVAL;
|
1
addons/gforces/functions/script_component.hpp
Normal file
1
addons/gforces/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\gforces\script_component.hpp"
|
17
addons/gforces/script_component.hpp
Normal file
17
addons/gforces/script_component.hpp
Normal file
@ -0,0 +1,17 @@
|
||||
#define COMPONENT gforces
|
||||
#include "\z\ace\Addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_GFORCES
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_GFORCES
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_GFORCES
|
||||
#endif
|
||||
|
||||
#include "\z\ace\Addons\main\script_macros.hpp"
|
||||
|
||||
#define AVERAGEDURATION 6
|
||||
#define INTERVAL 0.20
|
||||
#define MAXVIRTUALG 5.0
|
||||
#define MINVIRTUALG 2.5
|
@ -25,11 +25,14 @@ GVAR(newStrength) = GVAR(newStrength) max _strength;
|
||||
if (missionNamespace getVariable [QGVAR(isEarRingingPlaying), false]) exitWith {};
|
||||
|
||||
_fnc_removeEarRinging = {
|
||||
// Skip first execution
|
||||
if (diag_tickTime < 1 + ((_this select 0) select 0)) exitWith {};
|
||||
EXPLODE_2_PVT(_this,_params,_pfhId);
|
||||
EXPLODE_2_PVT(_params,_startTime,_duration);
|
||||
|
||||
// Exit if the delay is not met yet
|
||||
if (time < _startTime + _duration) exitWith {};
|
||||
|
||||
GVAR(isEarRingingPlaying) = false;
|
||||
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
||||
[_pfhId] call cba_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
if (profileNamespace getVariable [QGVAR(DisableEarRinging), false]) exitWith {};
|
||||
@ -37,15 +40,15 @@ if (profileNamespace getVariable [QGVAR(DisableEarRinging), false]) exitWith {};
|
||||
if (_strength > 0.75) exitWith {
|
||||
playSound "ACE_EarRinging_Heavy";
|
||||
GVAR(isEarRingingPlaying) = true;
|
||||
[_fnc_removeEarRinging, 7.0, [diag_tickTime] ] call CBA_fnc_addPerFrameHandler;
|
||||
[_fnc_removeEarRinging, 0.25, [time, 7.0] ] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
if (_strength > 0.5) exitWith {
|
||||
playSound "ACE_EarRinging_Medium";
|
||||
GVAR(isEarRingingPlaying) = true;
|
||||
[_fnc_removeEarRinging, 5.0, [diag_tickTime] ] call CBA_fnc_addPerFrameHandler;
|
||||
[_fnc_removeEarRinging, 0.25, [time, 5.0] ] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
if (_strength > 0.2) exitWith {
|
||||
playSound "ACE_EarRinging_Weak";
|
||||
GVAR(isEarRingingPlaying) = true;
|
||||
[_fnc_removeEarRinging, 3.0, [diag_tickTime] ] call CBA_fnc_addPerFrameHandler;
|
||||
[_fnc_removeEarRinging, 0.25, [time, 3.0] ] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
|
@ -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>
|
@ -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;
|
||||
};
|
||||
};
|
37
addons/nightvision/XEH_postInitClient.sqf
Normal file
37
addons/nightvision/XEH_postInitClient.sqf
Normal file
@ -0,0 +1,37 @@
|
||||
// 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 the event handlers
|
||||
["playerInventoryChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
||||
["playerVisionModeChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
||||
["zeusDisplayChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
||||
["cameraViewChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
||||
["playerVehicleChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
||||
["playerTurretChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
|
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(updatePPEffects);
|
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";
|
||||
};
|
71
addons/nightvision/functions/fnc_updatePPEffects.sqf
Normal file
71
addons/nightvision/functions/fnc_updatePPEffects.sqf
Normal file
@ -0,0 +1,71 @@
|
||||
//by commy2, PabstMirror and CAA-Picard
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_currentVehicle", "_grainSetting", "_blurSetting", "_radBlurSetting", "_config"];
|
||||
|
||||
_currentVehicle = vehicle ACE_player;
|
||||
|
||||
// If the Zeus display is on or the player has no nightvision
|
||||
if ((!isNull findDisplay 312) || ((currentVisionMode ACE_player) != 1)) exitWith {
|
||||
GVAR(ppEffectFilmGrain) ppEffectEnable false;
|
||||
GVAR(ppEffectBlur) ppEffectEnable false;
|
||||
GVAR(ppEffectRadialBlur) ppEffectEnable false;
|
||||
GVAR(ppEffectNVGBrightness) ppEffectEnable false;
|
||||
};
|
||||
|
||||
// The unit has nightvision
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _currentVehicle;
|
||||
_hmd = hmd ACE_player;
|
||||
_cameraView = cameraView;
|
||||
_turret = [ACE_player] call EFUNC(common,getTurretIndex);
|
||||
|
||||
|
||||
_fnc_isUsingHMD = {
|
||||
if (_cameraView != "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, _turret] call EFUNC(common,getTurretConfigPath);
|
||||
_turretConfigOpticsIn = _turretConfig >> "OpticsIn";
|
||||
|
||||
if (isClass _turretConfigOpticsIn) then {
|
||||
for "_index" from 0 to (count _turretConfigOpticsIn - 1) do {
|
||||
if ("NVG" in getArray (_turretConfigOpticsIn select _index >> "visionMode")) exitWith {_result = false};
|
||||
};
|
||||
} else {
|
||||
//No OpticsIn usualy means RCWS, still need to test on more vehicles
|
||||
_result = false;
|
||||
};
|
||||
_result
|
||||
};
|
||||
|
||||
if ((_currentVehicle == ACE_player) || _fnc_isUsingHMD) then {
|
||||
_grainSetting = getNumber (configFile >> "CfgWeapons" >> _hmd >> "ACE_NightVision_grain");
|
||||
_blurSetting = getNumber (configFile >> "CfgWeapons" >> _hmd >> "ACE_NightVision_blur");
|
||||
_radBlurSetting = getNumber (configFile >> "CfgWeapons" >> _hmd >> "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)
|
||||
};
|
||||
|
||||
|
||||
// Enable the effects
|
||||
GVAR(ppEffectFilmGrain) ppEffectEnable true;
|
||||
GVAR(ppEffectBlur) ppEffectEnable true;
|
||||
GVAR(ppEffectRadialBlur) ppEffectEnable true;
|
||||
GVAR(ppEffectNVGBrightness) ppEffectEnable true;
|
||||
|
||||
// Configure effects parameters
|
||||
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;
|
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"
|
@ -82,7 +82,7 @@ class CfgVehicles {
|
||||
displayName = "Teleport to Rallypoint";
|
||||
distance = 4;
|
||||
condition = QUOTE(side group _player == west);
|
||||
statement = QUOTE([_player, side group _player, false] call FUNC(teleportToRallypoint));
|
||||
statement = QUOTE([ARR_3(_player, side group _player, false)] call FUNC(teleportToRallypoint));
|
||||
showDisabled = 1;
|
||||
priority = 1;
|
||||
};
|
||||
@ -102,7 +102,7 @@ class CfgVehicles {
|
||||
displayName = "Teleport to Rallypoint";
|
||||
distance = 4;
|
||||
condition = QUOTE(side group _player == east);
|
||||
statement = QUOTE([_player, side group _player, false] call FUNC(teleportToRallypoint));
|
||||
statement = QUOTE([ARR_3(_player, side group _player, false)] call FUNC(teleportToRallypoint));
|
||||
showDisabled = 1;
|
||||
priority = 1;
|
||||
};
|
||||
@ -122,7 +122,7 @@ class CfgVehicles {
|
||||
displayName = "Teleport to Rallypoint";
|
||||
distance = 4;
|
||||
condition = QUOTE(side group _player == independent);
|
||||
statement = QUOTE([_player, side group _player, false] call FUNC(teleportToRallypoint));
|
||||
statement = QUOTE([ARR_3(_player, side group _player, false)] call FUNC(teleportToRallypoint));
|
||||
showDisabled = 1;
|
||||
priority = 1;
|
||||
};
|
||||
@ -143,7 +143,7 @@ class CfgVehicles {
|
||||
displayName = "Teleport to Base";
|
||||
distance = 4;
|
||||
condition = QUOTE(side group _player == west);
|
||||
statement = QUOTE([_player, side group _player, true] call FUNC(teleportToRallypoint));
|
||||
statement = QUOTE([ARR_3(_player, side group _player, true)] call FUNC(teleportToRallypoint));
|
||||
showDisabled = 1;
|
||||
priority = 1;
|
||||
};
|
||||
@ -163,7 +163,7 @@ class CfgVehicles {
|
||||
displayName = "Teleport to Base";
|
||||
distance = 4;
|
||||
condition = QUOTE(side group _player == east);
|
||||
statement = QUOTE([_player, side group _player, true] call FUNC(teleportToRallypoint));
|
||||
statement = QUOTE([ARR_3(_player, side group _player, true)] call FUNC(teleportToRallypoint));
|
||||
showDisabled = 1;
|
||||
priority = 1;
|
||||
};
|
||||
@ -183,7 +183,7 @@ class CfgVehicles {
|
||||
displayName = "Teleport to Base";
|
||||
distance = 4;
|
||||
condition = QUOTE(side group _player == independent);
|
||||
statement = QUOTE([_player, side group _player, true] call FUNC(teleportToRallypoint));
|
||||
statement = QUOTE([ARR_3(_player, side group _player, true)] call FUNC(teleportToRallypoint));
|
||||
showDisabled = 1;
|
||||
priority = 1;
|
||||
};
|
||||
@ -196,8 +196,8 @@ class CfgVehicles {
|
||||
class ACE_SelfActions {
|
||||
class ACE_MoveRallypoint {
|
||||
displayName = "Move Rallypoint";
|
||||
condition = QUOTE([_player, side group _player] call FUNC(canMoveRallypoint));
|
||||
statement = QUOTE([_player, side group _player] call FUNC(moveRallypoint));
|
||||
condition = QUOTE([ARR_2(_player, side group _player)] call FUNC(canMoveRallypoint));
|
||||
statement = QUOTE([ARR_2(_player, side group _player)] call FUNC(moveRallypoint));
|
||||
showDisabled = 0;
|
||||
priority = -0.5;
|
||||
};
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
PREP(canMoveRallypoint);
|
||||
PREP(getAllGear);
|
||||
PREP(handleKilled);
|
||||
PREP(handleRespawn);
|
||||
PREP(initRallypoint);
|
||||
|
@ -1,16 +1,16 @@
|
||||
/*
|
||||
Name: ACE_Respawn_fnc_handleKilled
|
||||
|
||||
|
||||
Author(s):
|
||||
bux578
|
||||
|
||||
|
||||
Description:
|
||||
Handles the XEH Killed event
|
||||
|
||||
|
||||
Parameters:
|
||||
0: OBJECT - Killed unit
|
||||
1: OBJECT - Attacker
|
||||
|
||||
|
||||
Returns:
|
||||
VOID
|
||||
*/
|
||||
@ -25,7 +25,7 @@ _killedUnit = _this select 0;
|
||||
GVAR(unitGear) = [];
|
||||
|
||||
if (GVAR(SavePreDeathGear)) then {
|
||||
GVAR(unitGear) = [_killedUnit] call FUNC(getAllGear);
|
||||
GVAR(unitGear) = [_killedUnit] call EFUNC(common,getAllGear);
|
||||
};
|
||||
|
||||
if (missionNamespace getVariable [QGVAR(showFriendlyFireMessage), false]) then {
|
||||
|
@ -1,16 +1,16 @@
|
||||
/*
|
||||
Name: ACE_Respawn_fnc_showFriendlyFireMessages
|
||||
|
||||
|
||||
Author(s):
|
||||
commy2
|
||||
|
||||
|
||||
Description:
|
||||
shows a message in system chat of who killed who
|
||||
|
||||
|
||||
Parameters:
|
||||
0: OBJECT - unit
|
||||
1: OBJECT - killer
|
||||
|
||||
|
||||
Returns:
|
||||
VOID
|
||||
*/
|
||||
@ -25,5 +25,8 @@ _killer = _this select 1;
|
||||
if (_unit != _killer && side group _unit in [side group ACE_player, civilian] && {side group _killer == side group ACE_player}) then {
|
||||
systemChat format ["%1 was killed by %2", [_unit] call EFUNC(common,getName), [_killer] call EFUNC(common,getName)];
|
||||
|
||||
// Raise custom event. @todo: remove
|
||||
[_unit, "killedByFriendly", [_unit, _killer]] call EFUNC(common,callCustomEventHandlers);
|
||||
// Raise ACE globalEvent
|
||||
["killedByFriendly", [_unit, _killer]] call EFUNC(common,globalEvent);
|
||||
};
|
||||
|
1
addons/vehicles/$PBOPREFIX$
Normal file
1
addons/vehicles/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\vehicles
|
23
addons/vehicles/CfgAmmo.hpp
Normal file
23
addons/vehicles/CfgAmmo.hpp
Normal file
@ -0,0 +1,23 @@
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
14
addons/vehicles/CfgEventHandlers.hpp
Normal file
14
addons/vehicles/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Engine_EventHandlers {
|
||||
class Car {
|
||||
class ACE_EngineStartDelay {
|
||||
clientEngine = QUOTE(if (local driver (_this select 0)) then {_this call FUNC(startEngine)};);
|
||||
};
|
||||
};
|
||||
};
|
334
addons/vehicles/CfgVehicles.hpp
Normal file
334
addons/vehicles/CfgVehicles.hpp
Normal file
@ -0,0 +1,334 @@
|
||||
|
||||
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","ACE_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","ACE_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","ACE_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","ACE_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","ACE_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","ACE_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","ACE_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"};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
65
addons/vehicles/CfgWeapons.hpp
Normal file
65
addons/vehicles/CfgWeapons.hpp
Normal file
@ -0,0 +1,65 @@
|
||||
|
||||
class CfgWeapons {
|
||||
class MGunCore;
|
||||
class MGun: MGunCore {};
|
||||
class LMG_RCWS: MGun {};
|
||||
|
||||
class LMG_coax;
|
||||
class ACE_LMG_coax_MBT_01: LMG_coax {};
|
||||
class ACE_LMG_coax_APC_Tracked_03: LMG_coax {};
|
||||
|
||||
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_Base_F;
|
||||
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"};
|
||||
};
|
||||
};
|
4
addons/vehicles/XEH_preInit.sqf
Normal file
4
addons/vehicles/XEH_preInit.sqf
Normal file
@ -0,0 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
PREP(speedLimiter);
|
||||
PREP(startEngine);
|
30
addons/vehicles/config.cpp
Normal file
30
addons/vehicles/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/KoffeinFlummi/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgAmmo.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "CfgWeapons.hpp"
|
||||
|
||||
class ACE_Default_Keys {
|
||||
class speedLimiter {
|
||||
displayName = "$STR_ACE_SpeedLimiter";
|
||||
condition = QUOTE(_player == driver _vehicle && {_vehicle isKindOf 'Car' || {_vehicle isKindOf 'Tank'}});
|
||||
statement = QUOTE([ARR_2(_player, _vehicle)] call FUNC(speedLimiter));
|
||||
key = 211;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
};
|
41
addons/vehicles/functions/fnc_speedLimiter.sqf
Normal file
41
addons/vehicles/functions/fnc_speedLimiter.sqf
Normal file
@ -0,0 +1,41 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_driver", "_vehicle"];
|
||||
|
||||
_driver = _this select 0;
|
||||
_vehicle = _this select 1;
|
||||
|
||||
if (GETGVAR(isSpeedLimiter,false)) exitWith {
|
||||
[localize "STR_ACE_SpeedLimiter_Off"] call EFUNC(common,displayTextStructured);
|
||||
playSound "ACE_Sound_Click";
|
||||
GVAR(isSpeedLimiter) = false;
|
||||
};
|
||||
|
||||
[localize "STR_ACE_SpeedLimiter_On"] call EFUNC(common,displayTextStructured);
|
||||
playSound "ACE_Sound_Click";
|
||||
GVAR(isSpeedLimiter) = true;
|
||||
|
||||
private "_maxSpeed";
|
||||
_maxSpeed = speed _vehicle max 10;
|
||||
|
||||
[{
|
||||
private ["_driver", "_vehicle", "_maxSpeed"];
|
||||
|
||||
_driver = _this select 0 select 0;
|
||||
_vehicle = _this select 0 select 1;
|
||||
_maxSpeed = _this select 0 select 2;
|
||||
|
||||
if (!GVAR(isSpeedLimiter) || {_driver != driver _vehicle}) exitWith {
|
||||
GVAR(isSpeedLimiter) = false;
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
private "_speed";
|
||||
_speed = speed _vehicle;
|
||||
|
||||
if (_speed > _maxSpeed) then {
|
||||
_vehicle setVelocity ((velocity _vehicle) vectorMultiply (_maxSpeed / _speed));
|
||||
};
|
||||
|
||||
} , 0, [_driver, _vehicle, _maxSpeed]] call CBA_fnc_addPerFrameHandler;
|
25
addons/vehicles/functions/fnc_startEngine.sqf
Normal file
25
addons/vehicles/functions/fnc_startEngine.sqf
Normal file
@ -0,0 +1,25 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_vehicle", "_isEngineOn"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
_isEngineOn = _this select 1;
|
||||
|
||||
if (!_isEngineOn || {floor abs speed _vehicle > 0}) exitWith {};
|
||||
|
||||
[{
|
||||
private ["_vehicle", "_time", "_direction"];
|
||||
|
||||
_vehicle = _this select 0 select 0;
|
||||
_time = _this select 0 select 1;
|
||||
_direction = _this select 0 select 2;
|
||||
|
||||
if (time > _time) exitWith {
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
_vehicle setVelocity [0, 0, 0];
|
||||
_vehicle setVectorDirAndUp _direction;
|
||||
|
||||
} , 0, [_vehicle, time + STARTUP_DELAY, [vectorDir _vehicle, vectorUp _vehicle]]] call CBA_fnc_addPerFrameHandler;
|
1
addons/vehicles/functions/script_component.hpp
Normal file
1
addons/vehicles/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\vehicles\script_component.hpp"
|
15
addons/vehicles/script_component.hpp
Normal file
15
addons/vehicles/script_component.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
#define COMPONENT vehicles
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_VEHICLES
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_ENABLED_VEHICLES
|
||||
#define DEBUG_SETTINGS DEBUG_ENABLED_VEHICLES
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
#define FUEL_FACTOR 0.165 // fuel capacity = range in km * FUEL_FACTOR
|
||||
#define STARTUP_DELAY 1.3
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="AGM">
|
||||
<Project name="ACE">
|
||||
<Package name="Vehicles">
|
||||
|
||||
<Key ID="STR_AGM_SpeedLimiter_On">
|
||||
<Key ID="STR_ACE_SpeedLimiter_On">
|
||||
<English>Speed Limiter on</English>
|
||||
<German>Begrenzer an</German>
|
||||
<Spanish>Limitador de velocidad activado</Spanish>
|
||||
@ -14,7 +14,7 @@
|
||||
<Portuguese>Limitador de Velocidade Ativo</Portuguese>
|
||||
<Italian>Limitatore Attivo</Italian>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_SpeedLimiter_Off">
|
||||
<Key ID="STR_ACE_SpeedLimiter_Off">
|
||||
<English>Speed Limiter off</English>
|
||||
<German>Begrenzer aus</German>
|
||||
<Spanish>Limitador de velocidad desactivado</Spanish>
|
||||
@ -27,7 +27,7 @@
|
||||
<Italian>Limitatore Non Attivo</Italian>
|
||||
</Key>
|
||||
|
||||
<Key ID="STR_AGM_SpeedLimiter">
|
||||
<Key ID="STR_ACE_SpeedLimiter">
|
||||
<English>Speed Limiter</English>
|
||||
<German>Begrenzer</German>
|
||||
<Spanish>Limitador de velocidad</Spanish>
|
Loading…
Reference in New Issue
Block a user