mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' of https://github.com/KoffeinFlummi/ACE3
This commit is contained in:
commit
a78730d387
@ -1,62 +0,0 @@
|
||||
class CfgPatches {
|
||||
class AGM_Backpacks {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = 0.60;
|
||||
requiredAddons[] = {AGM_Core, AGM_Interaction};
|
||||
version = "0.95";
|
||||
versionStr = "0.95";
|
||||
versionAr[] = {0,95,0};
|
||||
author[] = {"bux", "commy2"};
|
||||
authorUrl = "https://github.com/commy2/";
|
||||
};
|
||||
};
|
||||
|
||||
class CfgFunctions {
|
||||
class AGM_Backpacks {
|
||||
class AGM_Backpacks {
|
||||
file = "\AGM_Backpacks\functions";
|
||||
class getBackpackAssignedUnit;
|
||||
class isBackpack;
|
||||
class openInventory;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_InventoryOpened_EventHandlers {
|
||||
class CAManBase {
|
||||
class AGM_Backpacks_openInventory {
|
||||
clientInventoryOpened = "if (_this select 0 == AGM_player) then {_this call AGM_Backpacks_fnc_openInventory};";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class CfgVehicles {
|
||||
class Man;
|
||||
class CAManBase: Man {
|
||||
class AGM_SelfActions {
|
||||
class AGM_Equipment {
|
||||
class AGM_LockBackpack {
|
||||
displayName = "$STR_AGM_Backpacks_LockBackpack";
|
||||
condition = "[backpackContainer _player] call AGM_Backpacks_fnc_isBackpack && {!((backpackContainer _player) getVariable ['AGM_LockedInventory', false])}";
|
||||
statement = "(backpackContainer _player) setVariable ['AGM_LockedInventory', true, true]";
|
||||
showDisabled = 0;
|
||||
priority = 2.5;
|
||||
icon = ""; // @todo
|
||||
hotkey = "L";
|
||||
enableInside = 1;
|
||||
};
|
||||
class AGM_UnlockBackpack {
|
||||
displayName = "$STR_AGM_Backpacks_UnlockBackpack";
|
||||
condition = "[backpackContainer _player] call AGM_Backpacks_fnc_isBackpack && {(backpackContainer _player) getVariable ['AGM_LockedInventory', false]}";
|
||||
statement = "(backpackContainer _player) setVariable ['AGM_LockedInventory', false, true]";
|
||||
showDisabled = 0;
|
||||
priority = 2.5;
|
||||
icon = ""; // @todo
|
||||
hotkey = "L";
|
||||
enableInside = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Author: bux, commy2
|
||||
*
|
||||
* Handle the open inventory event. Don't open the inventory if it's locked and display message.
|
||||
*
|
||||
* Argument:
|
||||
* Input from "InventoryOpened" eventhandler
|
||||
*
|
||||
* Return value:
|
||||
* Don't open the inventory dialog? (Bool)
|
||||
*/
|
||||
|
||||
private ["_target", "_isBackpack", "_isLocked", "_return"];
|
||||
|
||||
_target = _this select 1;
|
||||
|
||||
_isBackpack = [_target] call AGM_Backpacks_fnc_isBackpack;
|
||||
_isLocked = _target getVariable ["AGM_LockedInventory", false];
|
||||
|
||||
_return = false;
|
||||
if (_isBackpack) then {
|
||||
// target is a backpack
|
||||
private "_unit";
|
||||
_unit = [_target] call AGM_Backpacks_fnc_getBackpackAssignedUnit;
|
||||
|
||||
if (!alive _unit || {_unit getVariable ["AGM_isUnconscious", false]}) exitWith {};
|
||||
|
||||
if (_isLocked) then {
|
||||
// target is a locked backpack
|
||||
[format [localize "STR_AGM_Backpacks_BackpackLocked", [_unit] call AGM_Core_fnc_getName]] call AGM_Core_fnc_displayTextStructured;
|
||||
_return = true;
|
||||
} else {
|
||||
// target is a not-locked backpack
|
||||
if (_unit getVariable ["AGM_LockedInventory", false]) then {
|
||||
[localize "STR_AGM_Backpacks_InventoryLocked"] call AGM_Core_fnc_displayTextStructured;
|
||||
_return = true;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
// target is not a backpack
|
||||
if (_isLocked) then {
|
||||
[localize "STR_AGM_Backpacks_InventoryLocked"] call AGM_Core_fnc_displayTextStructured;
|
||||
_return = true;
|
||||
};
|
||||
};
|
||||
_return
|
@ -1,47 +0,0 @@
|
||||
|
||||
class CfgPatches {
|
||||
class AGM_Difficulties {
|
||||
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 CfgDifficulties {
|
||||
class Mercenary {
|
||||
class Flags {
|
||||
armor[] = {0,0};
|
||||
friendlyTag[] = {0,0};
|
||||
enemyTag[] = {0,0};
|
||||
mineTag[] = {0,0};
|
||||
hud[] = {0,1};//{1,1};
|
||||
hudPerm[] = {0,0};
|
||||
hudWp[] = {0,0};
|
||||
hudWpPerm[] = {0,0};
|
||||
autoSpot[] = {0,1};
|
||||
map[] = {0,0};
|
||||
weaponCursor[] = {0,1};//{1,1};
|
||||
autoGuideAT[] = {0,0};
|
||||
clockIndicator[] = {0,0};
|
||||
3rdPersonView[] = {0,0};
|
||||
autoAim[] = {0,0};
|
||||
unlimitedSaves[] = {0,0};
|
||||
deathMessages[] = {0,1};//{1,1};
|
||||
netStats[] = {0,1};//{1,1};
|
||||
vonID[] = {0,1};
|
||||
cameraShake[] = {1,0};
|
||||
hudGroupInfo[] = {0,0};
|
||||
extendetInfoType[] = {0,0};
|
||||
roughLanding[] = {0,0};
|
||||
windEnabled[] = {1,0};
|
||||
autoTrimEnabled[] = {0,0};
|
||||
stressDamageEnabled[] = {1,0};
|
||||
};
|
||||
};
|
||||
};
|
@ -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;
|
||||
};
|
||||
};
|
Binary file not shown.
Binary file not shown.
@ -1,4 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
AGM_Flashbang_CC = ppEffectCreate ["ColorCorrections", 4265];
|
||||
AGM_Flashbang_CC ppEffectForceInNVG true;
|
@ -1,272 +0,0 @@
|
||||
class CfgPatches {
|
||||
class AGM_Grenades {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = 0.60;
|
||||
requiredAddons[] = {AGM_Core};
|
||||
version = "0.95";
|
||||
versionStr = "0.95";
|
||||
versionAr[] = {0,95,0};
|
||||
author[] = {"commy2", "KoffeinFlummi"};
|
||||
authorUrl = "https://github.com/commy2/";
|
||||
};
|
||||
};
|
||||
|
||||
class CfgFunctions {
|
||||
class AGM_Grenades {
|
||||
class AGM_Grenades {
|
||||
file = "\AGM_Grenades\functions";
|
||||
class flashbangEffect;
|
||||
class nextMode;
|
||||
class throwGrenade;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class AGM_Grenades {
|
||||
clientInit = "call compile preprocessFileLineNumbers '\AGM_Grenades\clientInit.sqf'";
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_FiredBIS_EventHandlers {
|
||||
class CAManBase {
|
||||
class AGM_Grenades_ThrowGrenade {
|
||||
clientFiredBIS = "if (_this select 0 == AGM_player) then {_this call AGM_Grenades_fnc_throwGrenade;};";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class AGM_Core_Default_Keys {
|
||||
class switchGrenadeMode {
|
||||
displayName = "$STR_AGM_Grenades_SwitchGrenadeMode";
|
||||
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
|
||||
statement = "call AGM_Grenades_fnc_nextMode";
|
||||
key = 9;//34;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;//1;
|
||||
};
|
||||
};
|
||||
|
||||
class CfgAmmo {
|
||||
class FlareCore;
|
||||
class FlareBase: FlareCore {
|
||||
intensity = 20000;
|
||||
flareSize = 12;
|
||||
};
|
||||
class F_40mm_White: FlareBase {
|
||||
intensity = 40000;
|
||||
flareSize = 12;
|
||||
};
|
||||
class F_20mm_White: FlareBase {
|
||||
intensity = 20000;
|
||||
flareSize = 12;
|
||||
};
|
||||
class F_Signal_Green: FlareBase {
|
||||
intensity = 20000;
|
||||
flareSize = 12;
|
||||
};
|
||||
class Flare_82mm_AMOS_White: FlareCore {
|
||||
intensity = 80000;
|
||||
flareSize = 12;
|
||||
};
|
||||
|
||||
class F_20mm_Red: F_20mm_White {};
|
||||
class F_20mm_Green: F_20mm_White {};
|
||||
class F_20mm_Yellow: F_20mm_White {};
|
||||
|
||||
class AGM_F_Hand_White: F_20mm_White {
|
||||
grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
|
||||
grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5};
|
||||
soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
|
||||
SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100};
|
||||
SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100};
|
||||
SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100};
|
||||
SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70};
|
||||
SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70};
|
||||
timeToLive = 60;
|
||||
};
|
||||
class AGM_F_Hand_Red: F_20mm_Red {
|
||||
grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
|
||||
grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5};
|
||||
soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
|
||||
SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100};
|
||||
SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100};
|
||||
SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100};
|
||||
SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70};
|
||||
SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70};
|
||||
timeToLive = 60;
|
||||
};
|
||||
class AGM_F_Hand_Green: F_20mm_Green {
|
||||
grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
|
||||
grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5};
|
||||
soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
|
||||
SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100};
|
||||
SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100};
|
||||
SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100};
|
||||
SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70};
|
||||
SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70};
|
||||
timeToLive = 60;
|
||||
};
|
||||
class AGM_F_Hand_Yellow: F_20mm_Yellow {
|
||||
grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
|
||||
grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5};
|
||||
soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
|
||||
SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100};
|
||||
SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100};
|
||||
SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100};
|
||||
SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70};
|
||||
SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70};
|
||||
timeToLive = 60;
|
||||
};
|
||||
|
||||
|
||||
class AGM_G_M84: F_20mm_Yellow {
|
||||
useFlare = 0;
|
||||
flareSize = 0;
|
||||
intensity = 0;
|
||||
grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
|
||||
grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5};
|
||||
soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5};
|
||||
SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100};
|
||||
SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100};
|
||||
SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100};
|
||||
SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70};
|
||||
SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70};
|
||||
timeToLive = 60;
|
||||
fuseDistance = 2.3;
|
||||
model = "agm_grenades\agm_m84_thrown.p3d";
|
||||
};
|
||||
};
|
||||
|
||||
class CfgMagazines {
|
||||
class HandGrenade;
|
||||
class AGM_HandFlare_Base: HandGrenade {
|
||||
value = 2;
|
||||
nameSoundWeapon = "smokeshell";
|
||||
nameSound = "smokeshell";
|
||||
mass = 4;
|
||||
initSpeed = 22;
|
||||
};
|
||||
class AGM_HandFlare_White: AGM_HandFlare_Base {
|
||||
ammo = "AGM_F_Hand_White";
|
||||
displayname = "$STR_AGM_Grenades_M127A1_White_Name";
|
||||
descriptionshort = "$STR_AGM_Grenades_M127A1_White_Description";
|
||||
displayNameShort = "$STR_AGM_Grenades_M127A1_White_NameShort";
|
||||
model = "\A3\weapons_f\ammo\flare_white";
|
||||
picture = "\A3\Weapons_F\Data\UI\gear_flare_white_ca.paa";
|
||||
};
|
||||
class AGM_HandFlare_Red: AGM_HandFlare_Base {
|
||||
ammo = "AGM_F_Hand_Red";
|
||||
displayname = "$STR_AGM_Grenades_M127A1_Red_Name";
|
||||
descriptionshort = "$STR_AGM_Grenades_M127A1_Red_Description";
|
||||
displayNameShort = "$STR_AGM_Grenades_M127A1_Red_NameShort";
|
||||
model = "\A3\weapons_f\ammo\flare_red";
|
||||
picture = "\A3\Weapons_F\Data\UI\gear_flare_red_ca.paa";
|
||||
};
|
||||
class AGM_HandFlare_Green: AGM_HandFlare_Base {
|
||||
ammo = "AGM_F_Hand_Green";
|
||||
displayname = "$STR_AGM_Grenades_M127A1_Green_Name";
|
||||
descriptionshort = "$STR_AGM_Grenades_M127A1_Green_Description";
|
||||
displayNameShort = "$STR_AGM_Grenades_M127A1_Green_NameShort";
|
||||
model = "\A3\weapons_f\ammo\flare_green";
|
||||
picture = "\A3\Weapons_F\Data\UI\gear_flare_green_ca.paa";
|
||||
};
|
||||
class AGM_HandFlare_Yellow: AGM_HandFlare_Base {
|
||||
ammo = "AGM_F_Hand_Yellow";
|
||||
displayname = "$STR_AGM_Grenades_M127A1_Yellow_Name";
|
||||
descriptionshort = "$STR_AGM_Grenades_M127A1_Yellow_Description";
|
||||
displayNameShort = "$STR_AGM_Grenades_M127A1_Yellow_NameShort";
|
||||
model = "\A3\weapons_f\ammo\flare_yellow";
|
||||
picture = "\A3\Weapons_F\Data\UI\gear_flare_yellow_ca.paa";
|
||||
};
|
||||
class AGM_M84: HandGrenade {
|
||||
ammo = "AGM_G_M84";
|
||||
displayname = "$STR_AGM_Grenades_M84_Name";
|
||||
descriptionshort = "$STR_AGM_Grenades_M84_Description";
|
||||
displayNameShort = "M84";
|
||||
model = "agm_grenades\agm_m84.p3d";
|
||||
picture = "\agm_grenades\UI\agm_m84_x_ca.paa";
|
||||
};
|
||||
|
||||
class 3Rnd_UGL_FlareGreen_F;
|
||||
class 6Rnd_GreenSignal_F: 3Rnd_UGL_FlareGreen_F {
|
||||
ammo = "F_40mm_Green";
|
||||
initSpeed = 120;
|
||||
};
|
||||
class 6Rnd_RedSignal_F: 6Rnd_GreenSignal_F {
|
||||
ammo = "F_40mm_Red";
|
||||
initSpeed = 120;
|
||||
};
|
||||
};
|
||||
|
||||
class CfgWeapons {
|
||||
class GrenadeLauncher;
|
||||
|
||||
class Throw: GrenadeLauncher {
|
||||
muzzles[] += {"AGM_HandFlare_WhiteMuzzle", "AGM_HandFlare_RedMuzzle", "AGM_HandFlare_GreenMuzzle", "AGM_HandFlare_YellowMuzzle", "AGM_M84Muzzle"};
|
||||
class ThrowMuzzle;
|
||||
class AGM_HandFlare_WhiteMuzzle: ThrowMuzzle {
|
||||
magazines[] = {"AGM_HandFlare_White"};
|
||||
};
|
||||
class AGM_HandFlare_RedMuzzle: ThrowMuzzle {
|
||||
magazines[] = {"AGM_HandFlare_Red"};
|
||||
};
|
||||
class AGM_HandFlare_GreenMuzzle: ThrowMuzzle {
|
||||
magazines[] = {"AGM_HandFlare_Green"};
|
||||
};
|
||||
class AGM_HandFlare_YellowMuzzle: ThrowMuzzle {
|
||||
magazines[] = {"AGM_HandFlare_Yellow"};
|
||||
};
|
||||
class AGM_M84Muzzle: ThrowMuzzle {
|
||||
magazines[] = {"AGM_M84"};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
|
||||
name = #ITEM; \
|
||||
count = COUNT; \
|
||||
};
|
||||
|
||||
class CfgVehicles {
|
||||
class NATO_Box_Base;
|
||||
class EAST_Box_Base;
|
||||
class IND_Box_Base;
|
||||
class Box_NATO_Support_F;
|
||||
|
||||
class Box_NATO_Grenades_F: NATO_Box_Base {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(AGM_HandFlare_White,12)
|
||||
MACRO_ADDITEM(AGM_HandFlare_Green,12)
|
||||
MACRO_ADDITEM(AGM_M84,12)
|
||||
};
|
||||
};
|
||||
|
||||
class Box_East_Grenades_F: EAST_Box_Base {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(AGM_HandFlare_Yellow,12)
|
||||
MACRO_ADDITEM(AGM_HandFlare_Red,12)
|
||||
MACRO_ADDITEM(AGM_M84,12)
|
||||
};
|
||||
};
|
||||
|
||||
class Box_IND_Grenades_F: IND_Box_Base {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(AGM_HandFlare_Yellow,12)
|
||||
MACRO_ADDITEM(AGM_HandFlare_Green,12)
|
||||
MACRO_ADDITEM(AGM_M84,12)
|
||||
};
|
||||
};
|
||||
|
||||
class AGM_Box_Misc: Box_NATO_Support_F {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(AGM_HandFlare_White,12)
|
||||
MACRO_ADDITEM(AGM_HandFlare_Red,12)
|
||||
MACRO_ADDITEM(AGM_HandFlare_Green,12)
|
||||
MACRO_ADDITEM(AGM_HandFlare_Yellow,12)
|
||||
MACRO_ADDITEM(AGM_M84,12)
|
||||
};
|
||||
};
|
||||
};
|
Binary file not shown.
@ -1,93 +0,0 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi
|
||||
*
|
||||
* Creates the flashbang effect locally/knocks out AI units.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The unit (Object)
|
||||
* 1: The grenade (Object)
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*/
|
||||
|
||||
_this spawn {
|
||||
_unit = _this select 0;
|
||||
_grenade = _this select 1;
|
||||
|
||||
if (damage _unit >= 1) exitWith {};
|
||||
|
||||
_strength = 1 - ((_unit distance _grenade) min 15) / 15;
|
||||
|
||||
if !(isPlayer _unit) exitWith {
|
||||
_unit disableAI "MOVE";
|
||||
_unit disableAI "ANIM";
|
||||
_unit disableAI "AUTOTARGET";
|
||||
_unit disableAI "TARGET";
|
||||
_unit disableAI "FSM";
|
||||
_unit setSkill (skill _unit / 50);
|
||||
|
||||
sleep (7 * _strength);
|
||||
|
||||
_unit enableAI "MOVE";
|
||||
_unit enableAI "ANIM";
|
||||
_unit enableAI "AUTOTARGET";
|
||||
_unit enableAI "TARGET";
|
||||
_unit enableAI "FSM";
|
||||
_unit setSkill (skill _unit * 50);
|
||||
};
|
||||
|
||||
// is there line of sight to the grenade?
|
||||
_posGrenade = getPosASL _grenade;
|
||||
_posGrenade set [2, (_posGrenade select 2) + 0.2]; // compensate for grenade glitching into ground
|
||||
if (lineIntersects [_posGrenade, getPosASL _unit, _grenade, _unit]) then {
|
||||
_strength = _strength / 10;
|
||||
};
|
||||
|
||||
// beeeeeeeeeeeeeeeeeeeeeeeeeeeeep
|
||||
if (isClass (configFile >> "CfgPatches" >> "AGM_Hearing") and _strength > 0) then {
|
||||
[_unit, 0.5 + (_strength / 2)] call AGM_Hearing_fnc_earRinging;
|
||||
};
|
||||
|
||||
// account for people looking away by slightly
|
||||
// reducing the effect for visual effects.
|
||||
_posUnit = getPos _unit;
|
||||
_posGrenade = getPos _grenade;
|
||||
_angleGrenade = ((_posGrenade select 0) - (_posUnit select 0)) atan2 ((_posGrenade select 1) - (_posUnit select 1));
|
||||
_angleGrenade = (_angleGrenade + 360) % 360;
|
||||
|
||||
_angleView = (eyeDirection player select 0) atan2 (eyeDirection player select 1);
|
||||
_angleView = (_angleView + 360) % 360;
|
||||
|
||||
_angleDiff = 180 - abs (abs (_angleGrenade - _angleView) - 180);
|
||||
_angleDiff = ((_angleDiff - 45) max 0);
|
||||
|
||||
_strength = _strength - _strength * (_angleDiff / 135);
|
||||
|
||||
// create flash to illuminate environment
|
||||
_light = "#lightpoint" createVehicleLocal getPos _grenade;
|
||||
_light setLightBrightness 200;
|
||||
_light setLightAmbient [1,1,1];
|
||||
_light setLightColor [1,1,1];
|
||||
_light setLightDayLight true;
|
||||
|
||||
// blind player
|
||||
if (_strength > 0.1) then {
|
||||
AGM_Flashbang_CC ppEffectEnable true;
|
||||
AGM_Flashbang_CC ppEffectAdjust [1,1,(0.8 + _strength) min 1,[1,1,1,0],[0,0,0,1],[0,0,0,0]];
|
||||
AGM_Flashbang_CC ppEffectCommit 0.01;
|
||||
};
|
||||
|
||||
sleep 0.1;
|
||||
deleteVehicle _light;
|
||||
sleep (7 * _strength);
|
||||
|
||||
if (_strength > 0.1) then {
|
||||
AGM_Flashbang_CC ppEffectAdjust [1,1,0,[1,1,1,0],[0,0,0,1],[0,0,0,0]];
|
||||
AGM_Flashbang_CC ppEffectCommit (10 * _strength);
|
||||
|
||||
sleep (10 * _strength);
|
||||
|
||||
AGM_Flashbang_CC ppEffectEnable false;
|
||||
};
|
||||
};
|
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Select the next throwing mode and display message.
|
||||
*
|
||||
* Argument:
|
||||
* Nothing
|
||||
*
|
||||
* Return value:
|
||||
* Nothing
|
||||
*/
|
||||
|
||||
private ["_mode", "_hint"];
|
||||
|
||||
_mode = missionNamespace getVariable ["AGM_Grenades_Mode", 0];
|
||||
|
||||
if (_mode == 4) then {
|
||||
_mode = 0;
|
||||
} else {
|
||||
_mode = _mode + 1;
|
||||
};
|
||||
|
||||
// ROLL GRENADE DOESN'T WORK RIGHT NOW
|
||||
if (_mode == 3) then {
|
||||
_mode = 4;
|
||||
};
|
||||
|
||||
_hint = [
|
||||
localize "STR_AGM_Grenades_NormalThrow",
|
||||
localize "STR_AGM_Grenades_HighThrow",
|
||||
localize "STR_AGM_Grenades_PreciseThrow",
|
||||
localize "STR_AGM_Grenades_RollGrenade",
|
||||
localize "STR_AGM_Grenades_DropGrenade"
|
||||
] select _mode;
|
||||
|
||||
[_hint] call AGM_Core_fnc_displayTextStructured;
|
||||
|
||||
AGM_Grenades_Mode = _mode;
|
@ -1,71 +0,0 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Adjust the grenades throwing direction and speed to the selected throwing mode.
|
||||
*
|
||||
* Argument:
|
||||
* input from "Fired" eventhandler
|
||||
*
|
||||
* Return value:
|
||||
* Nothing
|
||||
*/
|
||||
|
||||
private ["_unit", "_weapon", "_projectile"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
_projectile = _this select 6;
|
||||
|
||||
if (_weapon != "Throw") exitWith {};
|
||||
|
||||
private "_mode";
|
||||
|
||||
_mode = missionNamespace getVariable ["AGM_Grenades_Mode", 0];
|
||||
|
||||
if (_mode != 0) then {
|
||||
private "_velocity";
|
||||
|
||||
_velocity = velocity _projectile;
|
||||
|
||||
switch (_mode) do {
|
||||
//high throw
|
||||
case 1 : {
|
||||
_velocity = [
|
||||
0.5 * (_velocity select 0),
|
||||
0.5 * (_velocity select 1),
|
||||
[0, 0, 0] distance (_velocity vectorMultiply 0.5)
|
||||
];
|
||||
};
|
||||
//precise throw
|
||||
case 2 : {
|
||||
_velocity = (_unit weaponDirection _weapon) vectorMultiply (vectorMagnitude _velocity);
|
||||
};
|
||||
//roll grande
|
||||
case 3 : {
|
||||
//@todo
|
||||
};
|
||||
//drop grenade
|
||||
case 4 : {
|
||||
_velocity = [0, 0, 0];
|
||||
};
|
||||
};
|
||||
|
||||
_projectile setVelocity _velocity;
|
||||
};
|
||||
|
||||
if (typeOf _projectile == "AGM_G_M84") then {
|
||||
_this spawn {
|
||||
_projectile = _this select 6;
|
||||
|
||||
sleep getNumber (configFile >> "CfgAmmo" >> typeOf _projectile >> "fuseDistance");
|
||||
|
||||
if (alive _projectile) then {
|
||||
playSound3D ["A3\Sounds_F\weapons\Explosion\explosion_mine_1.wss", _projectile, false, getPosASL _projectile, 5, 1.2, 400];
|
||||
|
||||
_affected = _projectile nearEntities ["CAManBase", 50];
|
||||
{
|
||||
[[_x, _projectile], "AGM_Grenades_fnc_flashbangEffect", _x] call AGM_Core_fnc_execRemoteFnc;
|
||||
} forEach _affected;
|
||||
};
|
||||
};
|
||||
};
|
Binary file not shown.
@ -1,87 +0,0 @@
|
||||
class controls {
|
||||
class ButtonPlayer: RscActiveText {
|
||||
text = "";
|
||||
w = 0;
|
||||
h = 0;
|
||||
sizeEx = 0;
|
||||
onButtonClick = "";
|
||||
};
|
||||
class CA_PlayerName: RscText {
|
||||
x = "2 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
};
|
||||
class ProfilePicture: RscPicture {
|
||||
x = "13.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
};
|
||||
class ProfileBackground: RscText {
|
||||
x = "13.3 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
};
|
||||
class Separator1: RscPicture {
|
||||
x = "14.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
};
|
||||
class ColorBlack: RscButton {
|
||||
idc = 36732;
|
||||
x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
colorBackground[] = {0.2,0.2,0.2,1};
|
||||
colorBackgroundActive[] = {0,0,0,1};
|
||||
colorFocused[] = {0,0,0,1};
|
||||
onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorBlack""]";
|
||||
};
|
||||
class ColorRed: RscButton {
|
||||
idc = 36733;
|
||||
x = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
colorBackground[] = {0.8,0.2,0.2,1};
|
||||
colorBackgroundActive[] = {1,0,0,1};
|
||||
colorFocused[] = {1,0,0,1};
|
||||
onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorRed""]";
|
||||
};
|
||||
class ColorGreen: RscButton {
|
||||
idc = 36734;
|
||||
x = "0.6 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
colorBackground[] = {0.2,0.8,0.2,1};
|
||||
colorBackgroundActive[] = {0,1,0,1};
|
||||
colorFocused[] = {0,1,0,1};
|
||||
onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorGreen""]";
|
||||
};
|
||||
class ColorBlue: RscButton {
|
||||
idc = 36735;
|
||||
x = "0.9 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
colorBackground[] = {0.2,0.2,0.8,1};
|
||||
colorBackgroundActive[] = {0,0,1,1};
|
||||
colorFocused[] = {0,0,1,1};
|
||||
onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorBlue""]";
|
||||
};
|
||||
class ColorYellow: RscButton {
|
||||
idc = 36736;
|
||||
x = "1.2 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
colorBackground[] = {0.8,0.8,0.2,1};
|
||||
colorBackgroundActive[] = {1,1,0,1};
|
||||
colorFocused[] = {1,1,0,1};
|
||||
onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorYellow""]";
|
||||
};
|
||||
class ColorWhite: RscButton {
|
||||
idc = 36737;
|
||||
x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
colorBackground[] = {0.8,0.8,0.8,1};
|
||||
colorBackgroundActive[] = {1,1,1,1};
|
||||
colorFocused[] = {1,1,1,1};
|
||||
onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorWhite""]";
|
||||
};
|
||||
};
|
@ -1,154 +0,0 @@
|
||||
// by CAA-Picard
|
||||
|
||||
if (!hasInterface) exitWith{};
|
||||
|
||||
[] spawn {
|
||||
while {true} do {
|
||||
sleep 5;
|
||||
_markers = [];
|
||||
|
||||
while {AGM_Map_BFT_Enabled and {(!isNil "AGM_player") and {alive AGM_player}}} do {
|
||||
|
||||
_groups = [];
|
||||
_playerSide = call AGM_Core_fnc_playerSide;
|
||||
|
||||
if (AGM_Map_BFT_HideAiGroups) then {
|
||||
_groups = [allGroups, {side _this == _playerSide}] call AGM_Core_fnc_filter;
|
||||
} else {
|
||||
_groups = [allGroups, {
|
||||
_anyPlayers = {
|
||||
[_x] call AGM_Core_fnc_isPlayer
|
||||
} count units _this;
|
||||
(side _this == _playerSide) && _anyPlayers > 0
|
||||
}] call AGM_Core_fnc_filter;
|
||||
};
|
||||
|
||||
{
|
||||
deleteMarkerLocal _x;
|
||||
} forEach _markers;
|
||||
_markers = [];
|
||||
|
||||
for "_i" from 0 to (count _groups - 1) do {
|
||||
_group1 = _groups select _i;
|
||||
|
||||
_markerType = [_group1] call AGM_Core_fnc_getMarkerType;
|
||||
|
||||
_colour = format ["Color%1", side _group1];
|
||||
|
||||
_marker = createMarkerLocal [format ["AGM_BFT_%1", _i], [(getPos leader _group1) select 0, (getPos leader _group1) select 1]];
|
||||
_marker setMarkerTypeLocal _markerType;
|
||||
_marker setMarkerColorLocal _colour;
|
||||
_marker setMarkerTextLocal (groupID _group1);
|
||||
|
||||
_markers pushBack _marker;
|
||||
};
|
||||
|
||||
sleep AGM_Map_BFT_Interval;
|
||||
};
|
||||
|
||||
// Delete markers as soon as the player dies
|
||||
{
|
||||
deleteMarkerLocal _x;
|
||||
} forEach _markers;
|
||||
};
|
||||
};
|
||||
|
||||
[] spawn {
|
||||
// Init variables
|
||||
AGM_Map_mapToolsShown = 0;
|
||||
AGM_Map_pos = [0,0];
|
||||
AGM_Map_angle = 0;
|
||||
AGM_Map_dragging = false;
|
||||
AGM_Map_rotating = false;
|
||||
AGM_Map_mapGpsShow = true;
|
||||
AGM_Map_drawing = false;
|
||||
AGM_Map_tempLineMarker = [];
|
||||
AGM_Map_lineMarkers = [];
|
||||
|
||||
AGM_Map_drawColor = "ColorBlack";
|
||||
AGM_Map_drawingControls = [36732, 36733, 36734, 36735, 36736, 36737];
|
||||
|
||||
AGM_Map_fnc_installEvents = {
|
||||
_d = _this;
|
||||
diag_log format ["Installing EH in display %1", _d];
|
||||
((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseMoving", {_this call AGM_Map_fnc_handleMouseMove;}];
|
||||
((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call AGM_Map_fnc_handleMouseButton;}];
|
||||
((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call AGM_Map_fnc_handleMouseButton}];
|
||||
((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["Draw", {[] call AGM_Map_fnc_updateMapToolMarkers;}];
|
||||
(finddisplay _d) displayAddEventHandler ["KeyDown", {_this call AGM_Map_fnc_handleKeyDown;}];
|
||||
};
|
||||
|
||||
// Wait until the briefing map is detected
|
||||
// display = 37 for SP
|
||||
// display = 52 for host server on MP;
|
||||
// display = 53 for MP clients)
|
||||
waitUntil {(!isNull findDisplay 37) || (!isNull findDisplay 52) || (!isNull findDisplay 53) || (!isNull findDisplay 12)};
|
||||
|
||||
if (isNull findDisplay 12) then {
|
||||
// Install event handlers on the map control of the briefing screen (control = 51)
|
||||
AGM_Map_syncMarkers = true;
|
||||
if (!isNull findDisplay 52) then {
|
||||
52 call AGM_Map_fnc_installEvents;
|
||||
} else {
|
||||
if (!isNull findDisplay 53) then {
|
||||
53 call AGM_Map_fnc_installEvents;
|
||||
} else {
|
||||
37 call AGM_Map_fnc_installEvents;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
// Briefing screen was skipped; the player is JIP, create the markers defined during the briefing
|
||||
AGM_Map_syncMarkers = false;
|
||||
{
|
||||
_x call AGM_Map_fnc_addLineMarker;
|
||||
} forEach AGM_Map_serverLineMarkers;
|
||||
};
|
||||
|
||||
// Wait until the main map display is detected (display = 12)
|
||||
waitUntil { !isNull findDisplay 12 };
|
||||
// Install event handlers on the map control and display (control = 51)
|
||||
AGM_Map_syncMarkers = false;
|
||||
12 call AGM_Map_fnc_installEvents;
|
||||
|
||||
// Update the size and rotation of map tools
|
||||
[] call AGM_Map_fnc_updateMapToolMarkers;
|
||||
|
||||
while {true} do {
|
||||
waitUntil {visibleMap};
|
||||
|
||||
// Show and update map tools if required
|
||||
[] call AGM_Map_fnc_updateMapToolMarkers;
|
||||
// Show GPS if required
|
||||
[AGM_Map_mapGpsShow] call AGM_Map_fnc_openMapGps;
|
||||
|
||||
// Update visibility of maptools and gps, handling inventory changes
|
||||
[] spawn {
|
||||
while {visibleMap} do {
|
||||
// Show/Hide draw buttons
|
||||
if ("AGM_MapTools" in items player) then {
|
||||
{ ((finddisplay 12) displayctrl _x) ctrlShow true; } forEach AGM_Map_drawingControls;
|
||||
} else {
|
||||
{ ((finddisplay 12) displayctrl _x) ctrlShow false; } forEach AGM_Map_drawingControls;
|
||||
if (AGM_Map_drawing) then {
|
||||
call AGM_Map_fnc_cancelDrawing;
|
||||
};
|
||||
};
|
||||
sleep 1;
|
||||
};
|
||||
};
|
||||
|
||||
waitUntil {!visibleMap};
|
||||
|
||||
// Hide GPS
|
||||
[false] call AGM_Map_fnc_openMapGps;
|
||||
// Hide Map tools
|
||||
deleteMarkerLocal "AGM_MapToolFixed";
|
||||
deleteMarkerLocal "AGM_MapToolRotatingNormal";
|
||||
deleteMarkerLocal "AGM_MapToolRotatingSmall";
|
||||
AGM_Map_mapToolFixed = nil;
|
||||
AGM_Map_mapToolRotatingNormal = nil;
|
||||
AGM_Map_mapToolRotatingSmall = nil;
|
||||
// Cancel drawing
|
||||
call AGM_Map_fnc_cancelDrawing;
|
||||
};
|
||||
};
|
@ -1,423 +0,0 @@
|
||||
class CfgPatches {
|
||||
class AGM_Map {
|
||||
units[] = {};
|
||||
weapons[] = {"AGM_MapTools"};
|
||||
requiredVersion = 0.60;
|
||||
requiredAddons[] = {AGM_Core, AGM_Interaction};
|
||||
version = "0.95";
|
||||
versionStr = "0.95";
|
||||
versionAr[] = {0,95,0};
|
||||
author[] = {"KoffeinFlummi","CAA-Picard"};
|
||||
authorUrl = "https://github.com/KoffeinFlummi/";
|
||||
};
|
||||
};
|
||||
|
||||
class CfgFunctions {
|
||||
class AGM_Map {
|
||||
class AGM_Map {
|
||||
file = "AGM_Map\functions";
|
||||
class addLineMarker;
|
||||
class blueForceTracking;
|
||||
class calculateMapScale;
|
||||
class cancelDrawing;
|
||||
class canDraw;
|
||||
class canUseMapTools;
|
||||
class canUseMapGPS;
|
||||
class copyMapMarkers;
|
||||
class handleKeyDown;
|
||||
class handleMouseButton;
|
||||
class handleMouseMove;
|
||||
class handleMouseZChanged;
|
||||
class isInsideMapTool;
|
||||
class openMapGps;
|
||||
class removeLineMarker;
|
||||
class sendMapMarkers;
|
||||
class updateMapToolMarkers;
|
||||
class updateLineMarker;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class AGM_Map {
|
||||
serverInit = "call compile preprocessFileLineNumbers '\AGM_Map\serverInit.sqf'";
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class AGM_Map {
|
||||
clientInit = "call compile preprocessFileLineNumbers 'AGM_Map\clientInit.sqf'";
|
||||
};
|
||||
};
|
||||
|
||||
class CfgWeapons {
|
||||
class AGM_ItemCore;
|
||||
class InventoryItem_Base_F;
|
||||
|
||||
class AGM_MapTools: AGM_ItemCore {
|
||||
displayName = "$STR_AGM_MapTools_Name";
|
||||
descriptionShort = "$STR_AGM_MapTools_Description";
|
||||
model = "\A3\weapons_F\ammo\mag_univ.p3d";
|
||||
picture = "\AGM_Map\UI\maptool_item.paa";
|
||||
scope = 2;
|
||||
class ItemInfo: InventoryItem_Base_F {
|
||||
mass = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
|
||||
name = #ITEM; \
|
||||
count = COUNT; \
|
||||
};
|
||||
|
||||
class CfgVehicles {
|
||||
|
||||
class Man;
|
||||
class CAManBase: Man {
|
||||
class AGM_SelfActions {
|
||||
|
||||
class AGM_MapTools {
|
||||
displayName = "$STR_AGM_Map_MapTools_Menu";
|
||||
condition = "(call AGM_Map_fnc_canUseMapTools) || (call AGM_Map_fnc_canUseMapGPS)";
|
||||
statement = "";
|
||||
exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Core_notOnMap"};
|
||||
showDisabled = 0;
|
||||
priority = 100;
|
||||
subMenu[] = {"AGM_MapTools", 1};
|
||||
enableInside = 1;
|
||||
|
||||
class AGM_MapToolsHide {
|
||||
displayName = "$STR_AGM_Map_MapToolsHide";
|
||||
condition = "(call AGM_Map_fnc_canUseMapTools) && {AGM_Map_mapToolsShown > 0}";
|
||||
statement = "AGM_Map_mapToolsShown = 0; [] call AGM_Map_fnc_updateMapToolMarkers";
|
||||
exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Core_notOnMap"};
|
||||
showDisabled = 1;
|
||||
priority = 5;
|
||||
enableInside = 1;
|
||||
};
|
||||
class AGM_MapToolsShowNormal {
|
||||
displayName = "$STR_AGM_Map_MapToolsShowNormal";
|
||||
condition = "(call AGM_Map_fnc_canUseMapTools) && {AGM_Map_mapToolsShown != 1}";
|
||||
statement = "AGM_Map_mapToolsShown = 1; [] call AGM_Map_fnc_updateMapToolMarkers";
|
||||
exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Core_notOnMap"};
|
||||
showDisabled = 1;
|
||||
priority = 4;
|
||||
enableInside = 1;
|
||||
};
|
||||
class AGM_MapToolsShowSmall {
|
||||
displayName = "$STR_AGM_Map_MapToolsShowSmall";
|
||||
condition = "(call AGM_Map_fnc_canUseMapTools) && {AGM_Map_mapToolsShown != 2}";
|
||||
statement = "AGM_Map_mapToolsShown = 2; [] call AGM_Map_fnc_updateMapToolMarkers";
|
||||
exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Core_notOnMap"};
|
||||
showDisabled = 1;
|
||||
priority = 3;
|
||||
enableInside = 1;
|
||||
};
|
||||
class AGM_MapToolsAlignNorth {
|
||||
displayName = "$STR_AGM_Map_MapToolsAlignNorth";
|
||||
condition = "(call AGM_Map_fnc_canUseMapTools) && {AGM_Map_mapToolsShown != 0}";
|
||||
statement = "AGM_Map_angle = 0; [] call AGM_Map_fnc_updateMapToolMarkers";
|
||||
exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Core_notOnMap"};
|
||||
showDisabled = 1;
|
||||
priority = 2;
|
||||
enableInside = 1;
|
||||
};
|
||||
class AGM_MapToolsAlignCompass {
|
||||
displayName = "$STR_AGM_Map_MapToolsAlignCompass";
|
||||
condition = "(call AGM_Map_fnc_canUseMapTools) && {AGM_Map_mapToolsShown != 0} && {(""ItemCompass"" in assignedItems player) || {""ItemGPS"" in assignedItems player}}";
|
||||
statement = "AGM_Map_angle = getDir player; [] call AGM_Map_fnc_updateMapToolMarkers";
|
||||
exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Core_notOnMap"};
|
||||
showDisabled = 1;
|
||||
priority = 1;
|
||||
enableInside = 1;
|
||||
};
|
||||
class AGM_MapGpsShow {
|
||||
displayName = "$STR_AGM_Map_MapGpsShow";
|
||||
condition = "(call AGM_Map_fnc_canUseMapGPS) && {!AGM_Map_mapGpsShow}";
|
||||
statement = "AGM_Map_mapGpsShow = true; [AGM_Map_mapGpsShow] call AGM_Map_fnc_openMapGps";
|
||||
exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Core_notOnMap"};
|
||||
showDisabled = 0;
|
||||
priority = 0;
|
||||
enableInside = 1;
|
||||
};
|
||||
class AGM_MapGpsHide {
|
||||
displayName = "$STR_AGM_Map_MapGpsHide";
|
||||
condition = "(call AGM_Map_fnc_canUseMapGPS) && AGM_Map_mapGpsShow";
|
||||
statement = "AGM_Map_mapGpsShow = false; [AGM_Map_mapGpsShow] call AGM_Map_fnc_openMapGps";
|
||||
exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Core_notOnMap"};
|
||||
showDisabled = 0;
|
||||
priority = 0;
|
||||
enableInside = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class AGM_Actions {
|
||||
class AGM_CopyMap {
|
||||
displayName = "$STR_AGM_Map_CopyMap";
|
||||
condition = "isPlayer AGM_Interaction_Target && {""ItemMap"" in assignedItems player} && {""AGM_MapTools"" in items player} && {""ItemMap"" in assignedItems AGM_Interaction_Target}";
|
||||
statement = "[player, ""AGM_Map_fnc_sendMapMarkers"", AGM_Interaction_Target] call AGM_Core_fnc_execRemoteFnc";
|
||||
showDisabled = 0;
|
||||
priority = -1;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class NATO_Box_Base;
|
||||
class EAST_Box_Base;
|
||||
class IND_Box_Base;
|
||||
class FIA_Box_Base_F;
|
||||
|
||||
class Box_NATO_Support_F: NATO_Box_Base {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(AGM_MapTools,12)
|
||||
};
|
||||
};
|
||||
|
||||
class Box_East_Support_F: EAST_Box_Base {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(AGM_MapTools,12)
|
||||
};
|
||||
};
|
||||
|
||||
class Box_IND_Support_F: IND_Box_Base {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(AGM_MapTools,12)
|
||||
};
|
||||
};
|
||||
|
||||
class Box_FIA_Support_F: FIA_Box_Base_F {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(AGM_MapTools,12)
|
||||
};
|
||||
};
|
||||
|
||||
class AGM_Box_Misc: Box_NATO_Support_F {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(AGM_MapTools,12)
|
||||
};
|
||||
};
|
||||
|
||||
class Module_F;
|
||||
class AGM_ModuleBlueForceTracking: Module_F {
|
||||
author = "AGM Team";
|
||||
category = "AGM";
|
||||
displayName = "Blue Force Tracking";
|
||||
function = "AGM_Map_fnc_blueForceTracking";
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
icon = "\AGM_Map\UI\IconBFTracking_ca.paa";
|
||||
class Arguments {
|
||||
class Interval {
|
||||
displayName = "Interval";
|
||||
description = "How often the markers should be refreshed (in seconds)";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class HideAiGroups {
|
||||
displayName = "Hide AI groups?";
|
||||
description = "Hide markers for 'AI only' groups?";
|
||||
typeName = "BOOL";
|
||||
class values {
|
||||
class Yes { name = "Yes"; value = 1; };
|
||||
class No { name = "No"; value = 0; default = 1; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class RscControlsGroup;
|
||||
class RscActiveText;
|
||||
class RscPicture;
|
||||
class RscText;
|
||||
class RscObject;
|
||||
class RscButton;
|
||||
class RscButtonMenuOK;
|
||||
class RscButtonMenuCancel;
|
||||
class RscButtonMenu;
|
||||
class RscEdit;
|
||||
|
||||
class RscMapControl {
|
||||
sizeExGrid = 0.032;
|
||||
};
|
||||
|
||||
// REGULAR MAP
|
||||
class RscDisplayMainMap {
|
||||
// get rid of the "center to player position" - button (as it works even on elite)
|
||||
class controls {
|
||||
class TopRight: RscControlsGroup {
|
||||
#include "MapControls.hpp"
|
||||
};
|
||||
};
|
||||
// scale up the compass
|
||||
class objects {
|
||||
class Compass: RscObject {
|
||||
scale = 0.7;
|
||||
zoomDuration = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// DIARY
|
||||
class RscDisplayDiary {
|
||||
// get rid of the "center to player position" - button (as it works even on elite)
|
||||
class controls {
|
||||
class TopRight: RscControlsGroup {
|
||||
class controls {
|
||||
class ButtonPlayer: RscActiveText {
|
||||
text = "";
|
||||
w = 0;
|
||||
h = 0;
|
||||
sizeEx = 0;
|
||||
onButtonClick = "";
|
||||
};
|
||||
class CA_PlayerName: RscText {
|
||||
x = "2 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
};
|
||||
class ProfilePicture: RscPicture {
|
||||
x = "13.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
};
|
||||
class ProfileBackground: RscText {
|
||||
x = "13.3 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
};
|
||||
class Separator1: RscPicture {
|
||||
x = "14.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
// scale up the compass
|
||||
class objects {
|
||||
class Compass: RscObject {
|
||||
scale = 0.7;
|
||||
zoomDuration = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// BRIEFING SCREEN
|
||||
class RscDisplayGetReady: RscDisplayMainMap {
|
||||
// get rid of the "center to player position" - button (as it works even on elite)
|
||||
class controls {
|
||||
class TopRight: RscControlsGroup {
|
||||
#include "MapControls.hpp"
|
||||
};
|
||||
};
|
||||
// scale up the compass
|
||||
class objects {
|
||||
class Compass: RscObject {
|
||||
scale = 0.7;
|
||||
zoomDuration = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
class RscDisplayClientGetReady: RscDisplayGetReady {
|
||||
// get rid of the "center to player position" - button (as it works even on elite)
|
||||
class controls {
|
||||
class TopRight: RscControlsGroup {
|
||||
#include "MapControls.hpp"
|
||||
};
|
||||
};
|
||||
// scale up the compass
|
||||
class objects {
|
||||
class Compass: RscObject {
|
||||
scale = 0.7;
|
||||
zoomDuration = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
class RscDisplayServerGetReady: RscDisplayGetReady {
|
||||
// get rid of the "center to player position" - button (as it works even on elite)
|
||||
class controls {
|
||||
class TopRight: RscControlsGroup {
|
||||
#include "MapControls.hpp"
|
||||
};
|
||||
};
|
||||
// scale up the compass
|
||||
class objects {
|
||||
class Compass: RscObject {
|
||||
scale = 0.7;
|
||||
zoomDuration = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// MARKERS
|
||||
class CfgMarkers {
|
||||
class Flag;
|
||||
|
||||
// Reenable NATO symbols ...
|
||||
class b_unknown: Flag {scope = 2;};
|
||||
|
||||
// ... and disable all the useless ones
|
||||
// If you think that some of these are needed, create an issue; But until
|
||||
// there's a better way to place markers, there should be only the most
|
||||
// important markers here.
|
||||
// Keep in mind that all of these can still be placed in the editor.
|
||||
class b_hq: b_unknown {scope = 1;};
|
||||
class b_installation: b_unknown {scope = 1;};
|
||||
class b_maint: b_unknown {scope = 1;};
|
||||
class b_med: b_unknown {scope = 1;};
|
||||
class b_service: b_unknown {scope = 1;};
|
||||
class b_support: b_unknown {scope = 1;};
|
||||
|
||||
class n_unknown: b_unknown {};
|
||||
class n_hq: n_unknown {scope = 1;};
|
||||
class n_installation: n_unknown {scope = 1;};
|
||||
class u_installation: n_unknown {scope = 1;}; // i have no idea...
|
||||
class n_maint: n_unknown {scope = 1;};
|
||||
class n_med: n_unknown {scope = 1;};
|
||||
class n_service: n_unknown {scope = 1;};
|
||||
class n_support: n_unknown {scope = 1;};
|
||||
|
||||
class o_unknown: b_unknown {};
|
||||
class o_hq: o_unknown {scope = 1;};
|
||||
class o_installation: o_unknown {scope = 1;};
|
||||
class o_maint: o_unknown {scope = 1;};
|
||||
class o_med: o_unknown {scope = 1;};
|
||||
class o_service: o_unknown {scope = 1;};
|
||||
class o_support: o_unknown {scope = 1;};
|
||||
|
||||
// disable all civy markers (harbor etc.)
|
||||
class c_unknown: b_unknown {scope = 1;};
|
||||
|
||||
// disable quantity indicators (fire team/squad/platoon ...)
|
||||
class group_0: b_unknown {scope = 1;};
|
||||
|
||||
|
||||
class AGM_MapToolFixed {
|
||||
name = "MapToolFixed";
|
||||
icon = "\AGM_Map\data\mapToolFixed.paa";
|
||||
scope = 0;
|
||||
color[] = {1,1,1,1};
|
||||
size = 32;
|
||||
};
|
||||
|
||||
class AGM_MapToolRotatingNormal {
|
||||
name = "MapToolRotating";
|
||||
icon = "\AGM_Map\data\mapToolRotatingNormal.paa";
|
||||
scope = 0;
|
||||
color[] = {1,1,1,1};
|
||||
size = 32;
|
||||
};
|
||||
|
||||
class AGM_MapToolRotatingSmall {
|
||||
name = "MapToolRotating";
|
||||
icon = "\AGM_Map\data\mapToolRotatingSmall.paa";
|
||||
scope = 0;
|
||||
color[] = {1,1,1,1};
|
||||
size = 32;
|
||||
};
|
||||
};
|
||||
|
||||
class AGM_Parameters_Numeric {
|
||||
AGM_Map_BFT_Interval = 1;
|
||||
};
|
||||
class AGM_Parameters_Boolean {
|
||||
AGM_Map_EveryoneCanDrawOnBriefing = 1;
|
||||
AGM_Map_BFT_Enabled = 0;
|
||||
AGM_Map_BFT_HideAiGroups = 0;
|
||||
};
|
||||
|
||||
#include "MapGpsUI.hpp"
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi
|
||||
*
|
||||
* Initializes the blue force tracking module.
|
||||
*
|
||||
* Arguments:
|
||||
* Whatever the module provides. (I dunno.)
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*/
|
||||
|
||||
if !(hasInterface) exitWith {};
|
||||
|
||||
_logic = _this select 0;
|
||||
_units = _this select 1;
|
||||
_activated = _this select 2;
|
||||
|
||||
if !(_activated) exitWith {};
|
||||
|
||||
_logic spawn {
|
||||
waitUntil {alive player};
|
||||
|
||||
AGM_Map_BFT_Enabled = true;
|
||||
[_this, "AGM_Map_BFT_Interval", "Interval"] call AGM_Core_fnc_readNumericParameterFromModule;
|
||||
[_this, "AGM_Map_BFT_HideAiGroups", "HideAiGroups"] call AGM_Core_fnc_readBooleanParameterFromModule;
|
||||
|
||||
diag_log text "[AGM]: Blue Force Tracking Module initialized.";
|
||||
};
|
@ -1,4 +0,0 @@
|
||||
// by CAA-Picard
|
||||
|
||||
(missionNameSpace getVariable ["AGM_Map_syncMarkers", true] && {AGM_Map_EveryoneCanDrawOnBriefing}) ||
|
||||
{(!isNull player) && {"AGM_MapTools" in items player}}
|
@ -1,5 +0,0 @@
|
||||
// by CAA-Picard
|
||||
|
||||
visibleMap &&
|
||||
{alive player} &&
|
||||
{"ItemGPS" in assignedItems player}
|
@ -1,8 +0,0 @@
|
||||
// by CAA-Picard
|
||||
|
||||
visibleMap &&
|
||||
{alive player} &&
|
||||
{"ItemMap" in assignedItems player} &&
|
||||
{"AGM_MapTools" in items player} &&
|
||||
{!AGM_Map_dragging} &&
|
||||
{!AGM_Map_rotating}
|
@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Author: CAA-Picard
|
||||
*
|
||||
* Cancel the drawing of the current line marker
|
||||
*
|
||||
* Argument:
|
||||
* None
|
||||
*
|
||||
* Return value:
|
||||
* Nothing
|
||||
*/
|
||||
|
||||
AGM_Map_drawing = false;
|
||||
if (count AGM_Map_tempLineMarker > 0) then {
|
||||
deleteMarkerLocal (AGM_Map_tempLineMarker select 0);
|
||||
};
|
||||
AGM_Map_tempLineMarker = [];
|
@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Author: CAA-Picard
|
||||
*
|
||||
* Copy markers to mapd
|
||||
*
|
||||
* Argument:
|
||||
* 0: Array of markers to copy (Array)
|
||||
*
|
||||
* Return value:
|
||||
* Return
|
||||
*/
|
||||
|
||||
_lineMarkers = _this;
|
||||
|
||||
{
|
||||
_marker = _x;
|
||||
|
||||
if (({(_x select 0) == (_marker select 0)} count AGM_Map_lineMarkers) == 0) then {
|
||||
_marker call AGM_Map_fnc_addLineMarker;
|
||||
};
|
||||
} forEach _lineMarkers;
|
@ -1,98 +0,0 @@
|
||||
/*
|
||||
* Author: CAA-Picard
|
||||
*
|
||||
* Handle mouse buttons.
|
||||
*
|
||||
* Argument:
|
||||
* 0: 1 if mouse down down, 0 if mouse button up (Number)
|
||||
* 1: Parameters of the mouse button event
|
||||
*
|
||||
* Return value:
|
||||
* Boolean, true if event was handled
|
||||
*/
|
||||
|
||||
private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"];
|
||||
|
||||
_dir = _this select 0;
|
||||
_params = _this select 1;
|
||||
_control = _params select 0;
|
||||
_button = _params select 1;
|
||||
_screenPos = [_params select 2, _params select 3];
|
||||
_shiftKey = _params select 4;
|
||||
_ctrlKey = _params select 5;
|
||||
_altKey = _params select 6;
|
||||
_handled = false;
|
||||
|
||||
// If it's not a left button event, exit
|
||||
if (_button != 0) exitWith {};
|
||||
|
||||
// If releasing
|
||||
if (_dir != 1 && (AGM_Map_dragging or AGM_Map_rotating)) exitWith {
|
||||
AGM_Map_dragging = false;
|
||||
AGM_Map_rotating = false;
|
||||
_handled = true;
|
||||
_handled
|
||||
};
|
||||
|
||||
// If clicking
|
||||
if (_dir == 1) exitWith {
|
||||
|
||||
if !(call AGM_Map_fnc_canDraw) exitWith {_handled = false;};
|
||||
|
||||
// Transform mouse screen position to coordinates
|
||||
_pos = _control ctrlMapScreenToWorld _screenPos;
|
||||
_pos set [count _pos, 0];
|
||||
|
||||
if (AGM_Map_drawing) exitWith {
|
||||
// Already drawing -> Add tempLineMarker to permanent list
|
||||
if (AGM_Map_syncMarkers) then {
|
||||
deleteMarkerLocal (AGM_Map_tempLineMarker select 0);
|
||||
[AGM_Map_tempLineMarker, "AGM_Map_fnc_addLineMarker", 2] call AGM_Core_fnc_execRemoteFnc;
|
||||
// Log who drew on the briefing screen
|
||||
(text format ["[AGM] Server: Player %1 drew on the briefing screen", name player]) call AGM_Core_fnc_serverLog;
|
||||
} else {
|
||||
AGM_Map_tempLineMarker call AGM_Map_fnc_updateLineMarker;
|
||||
AGM_Map_lineMarkers pushBack (+AGM_Map_tempLineMarker);
|
||||
};
|
||||
AGM_Map_tempLineMarker = [];
|
||||
AGM_Map_drawing = false;
|
||||
_handled = true;
|
||||
};
|
||||
|
||||
if (_altKey) exitWith {
|
||||
// Start drawing
|
||||
AGM_Map_drawing = true;
|
||||
// Create tempLineMarker
|
||||
_gui = format ["%1%2%3%4", random (100), random (100), random (100), random (100)];
|
||||
AGM_Map_tempLineMarker = [_gui, + _pos, + _pos, AGM_Map_drawColor];
|
||||
_marker = createMarkerLocal [_gui, [0,0]];
|
||||
AGM_Map_tempLineMarker call AGM_Map_fnc_updateLineMarker;
|
||||
_handled = true;
|
||||
};
|
||||
|
||||
AGM_Map_dragging = false;
|
||||
AGM_Map_rotating = false;
|
||||
|
||||
// If no map tool marker then exit
|
||||
if (isNil "AGM_Map_mapToolFixed") exitWith {_handled = false;};
|
||||
|
||||
// Check if clicking the maptool
|
||||
if (_pos call AGM_Map_fnc_isInsideMapTool) exitWith {
|
||||
// Store data for dragging
|
||||
AGM_Map_startPos = + AGM_Map_pos;
|
||||
AGM_Map_startDragPos = + _pos;
|
||||
if (_ctrlKey) then {
|
||||
// Store data for rotating
|
||||
AGM_Map_startAngle = + AGM_Map_angle;
|
||||
AGM_Map_startDragAngle = (180 + ((AGM_Map_startDragPos select 0) - (AGM_Map_startPos select 0)) atan2 ((AGM_Map_startDragPos select 1) - (AGM_Map_startPos select 1)) mod 360);
|
||||
// Start rotating
|
||||
AGM_Map_rotating = true;
|
||||
} else {
|
||||
// Start dragging
|
||||
AGM_Map_dragging = true;
|
||||
};
|
||||
_handled = true;
|
||||
};
|
||||
};
|
||||
|
||||
_handled
|
@ -1,61 +0,0 @@
|
||||
/*
|
||||
* Author: CAA-Picard
|
||||
*
|
||||
* Handle mouse movement over the map tool.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Map Control
|
||||
* 1: Mouse position on screen coordinates
|
||||
*
|
||||
* Return value:
|
||||
* Boolean, true if event was handled
|
||||
*/
|
||||
|
||||
private ["_control", "_pos"];
|
||||
|
||||
_control = _this select 0;
|
||||
_pos = [_this select 1, _this select 2];
|
||||
AGM_Map_mousePos = _control ctrlMapScreenToWorld _pos;
|
||||
AGM_Map_mousePos set [count AGM_Map_mousePos, 0];
|
||||
|
||||
// If cannot draw then exit
|
||||
if !(call AGM_Map_fnc_canDraw) exitWith {
|
||||
// If was drawing, cancel
|
||||
if (AGM_Map_drawing) then {
|
||||
call AGM_Map_fnc_cancelDrawing;
|
||||
};
|
||||
false
|
||||
};
|
||||
|
||||
// Handle drawing
|
||||
if (AGM_Map_drawing) exitWith {
|
||||
AGM_Map_tempLineMarker set [2, AGM_Map_mousePos];
|
||||
AGM_Map_tempLineMarker call AGM_Map_fnc_updateLineMarker;
|
||||
false
|
||||
};
|
||||
|
||||
// Handle Map tools
|
||||
if (isNil "AGM_Map_mapToolFixed") exitWith {false};
|
||||
|
||||
// Translation
|
||||
if (AGM_Map_dragging) exitWith {
|
||||
AGM_Map_pos set [0, (AGM_Map_startPos select 0) + (AGM_Map_mousePos select 0) - (AGM_Map_startDragPos select 0)];
|
||||
AGM_Map_pos set [1, (AGM_Map_startPos select 1) + (AGM_Map_mousePos select 1) - (AGM_Map_startDragPos select 1)];
|
||||
|
||||
// Update the size and rotation of the maptool
|
||||
[] call AGM_Map_fnc_updateMapToolMarkers;
|
||||
true
|
||||
};
|
||||
|
||||
// Rotation
|
||||
if (AGM_Map_rotating) exitWith {
|
||||
// Get new angle
|
||||
_angle = (180 + ((AGM_Map_mousePos select 0) - (AGM_Map_startPos select 0)) atan2 ((AGM_Map_mousePos select 1) - (AGM_Map_startPos select 1)) mod 360);
|
||||
AGM_Map_angle = AGM_Map_startAngle + _angle - AGM_Map_startDragAngle;
|
||||
|
||||
// Update the size and rotation of the maptool
|
||||
[] call AGM_Map_fnc_updateMapToolMarkers;
|
||||
true
|
||||
};
|
||||
|
||||
false
|
@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Author: CAA-Picard
|
||||
*
|
||||
* Handle mouse wheel.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Control
|
||||
* 1: Scroll Amount
|
||||
*
|
||||
* Return value:
|
||||
* Boolean, true if event was handled
|
||||
*/
|
||||
|
||||
private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"];
|
||||
|
||||
_control = _this select 0;
|
||||
_dir = _this select 1;
|
||||
diag_log "Scroll";
|
||||
diag_log _this;
|
||||
_handled = false;
|
||||
|
||||
// If drawing, change line color
|
||||
if (count AGM_Map_tempLineMarker > 0) then {
|
||||
AGM_Map_drawColor = if (_dir > 0) then {AGM_Map_drawColor + 1} else {AGM_Map_drawColor - 1};
|
||||
if (AGM_Map_drawColor >= count AGM_Map_drawColors) then {
|
||||
AGM_Map_drawColor = AGM_Map_drawColor - count AGM_Map_drawColors;
|
||||
};
|
||||
if (AGM_Map_drawColor < 0) then {
|
||||
AGM_Map_drawColor = AGM_Map_drawColor + count AGM_Map_drawColors;
|
||||
};
|
||||
AGM_Map_tempLineMarker set [3, AGM_Map_drawColor];
|
||||
AGM_Map_tempLineMarker call AGM_Map_fnc_updateLineMarker;
|
||||
|
||||
_handled = true;
|
||||
};
|
||||
_handled
|
@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Author: CAA-Picard
|
||||
*
|
||||
* Opens or closes the gps on the map screen, showing coordinates
|
||||
*
|
||||
* Argument:
|
||||
* 0: Open GPS? (Boolean)
|
||||
*
|
||||
* Return value:
|
||||
* Nothing
|
||||
*/
|
||||
|
||||
|
||||
_open = _this select 0;
|
||||
_isOpen = !(isNull (uiNamespace getVariable ['AGM_Map_mapGpsDisplay', displayNull]));
|
||||
|
||||
if (_open && {"ItemGPS" in assignedItems player} && {!_isOpen}) then {
|
||||
("AGM_mapGpsLayer" call BIS_fnc_rscLayer) cutRsc ["RscAGM_MapGps","PLAIN"];
|
||||
|
||||
// Spawn a thread to update gps display
|
||||
[] spawn {
|
||||
disableSerialization;
|
||||
while {!(isNull (uiNamespace getVariable ['AGM_Map_mapGpsDisplay', displayNull]))} do {
|
||||
if !("ItemGPS" in assignedItems player) exitWith {};
|
||||
|
||||
_mapGpsDisplay = uiNamespace getVariable ['AGM_Map_mapGpsDisplay', displayNull];
|
||||
_ctrl = _mapGpsDisplay displayCtrl 913590;
|
||||
_ctrl ctrlSetText str(round(getDir player));
|
||||
_ctrl = _mapGpsDisplay displayCtrl 913591;
|
||||
_ctrl ctrlSetText str(round((getPosASL player) select 2));
|
||||
_ctrl = _mapGpsDisplay displayCtrl 913592;
|
||||
_ctrl ctrlSetText mapGridPosition player;
|
||||
|
||||
sleep 0.5;
|
||||
};
|
||||
("AGM_mapGpsLayer" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
("AGM_mapGpsLayer" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
|
||||
};
|
||||
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Author: CAA-Picard
|
||||
*
|
||||
* Remove the line marker
|
||||
*
|
||||
* Argument:
|
||||
* 0: Marker Name (string)
|
||||
*
|
||||
* Return value:
|
||||
* Return
|
||||
*/
|
||||
|
||||
_name = _this select 0;
|
||||
|
||||
deleteMarkerLocal _name;
|
||||
{
|
||||
if ((_x select 0) == _name) exitWith {
|
||||
AGM_Map_lineMarkers = AGM_Map_lineMarkers - [_x];
|
||||
};
|
||||
} forEach AGM_Map_lineMarkers;
|
||||
|
||||
if (isServer && AGM_Map_syncMarkers) then {
|
||||
{
|
||||
if ((_x select 0) == _name) exitWith {
|
||||
AGM_Map_serverLineMarkers = AGM_Map_serverLineMarkers - [_x];
|
||||
publicVariable "AGM_Map_serverLineMarkers";
|
||||
};
|
||||
} forEach AGM_Map_serverLineMarkers;
|
||||
};
|
@ -1,13 +0,0 @@
|
||||
/*
|
||||
* Author: CAA-Picard
|
||||
*
|
||||
* Send Map markers to other player
|
||||
*
|
||||
* Argument:
|
||||
* 0: Target player (Unit)
|
||||
*
|
||||
* Return value:
|
||||
* Return
|
||||
*/
|
||||
|
||||
[AGM_Map_lineMarkers, "AGM_Map_fnc_copyMapMarkers", _this] call AGM_Core_fnc_execRemoteFnc;
|
@ -1,71 +0,0 @@
|
||||
/*
|
||||
* Author: CAA-Picard
|
||||
*
|
||||
* Update the map tool markers, position, size, rotation and visibility.
|
||||
*
|
||||
* Argument:
|
||||
* None
|
||||
*
|
||||
* Return value:
|
||||
* Nothing
|
||||
*/
|
||||
|
||||
#define TEXTURE_WIDTH_IN_M 6205
|
||||
#define CENTER_OFFSET_Y_PERC 0.1606
|
||||
#define CONSTANT_SCALE 0.2
|
||||
|
||||
// If markers exist and they should'nt, delete them
|
||||
if (!("AGM_MapTools" in items player) || {AGM_Map_mapToolsShown == 0}) then {
|
||||
// If markers exist, delete them
|
||||
if (!isNil "AGM_Map_mapToolFixed") then {
|
||||
deleteMarkerLocal "AGM_MapToolFixed";
|
||||
AGM_Map_mapToolFixed = nil;
|
||||
};
|
||||
};
|
||||
if (!("AGM_MapTools" in items player) || {AGM_Map_mapToolsShown != 1}) then {
|
||||
if (!isNil "AGM_Map_mapToolRotatingNormal") then {
|
||||
deleteMarkerLocal "AGM_MapToolRotatingNormal";
|
||||
AGM_Map_mapToolRotatingNormal = nil;
|
||||
};
|
||||
};
|
||||
if (!("AGM_MapTools" in items player) || {AGM_Map_mapToolsShown != 2}) then {
|
||||
if (!isNil "AGM_Map_mapToolRotatingSmall") then {
|
||||
deleteMarkerLocal "AGM_MapToolRotatingSmall";
|
||||
AGM_Map_mapToolRotatingSmall = nil;
|
||||
};
|
||||
};
|
||||
|
||||
if (!("AGM_MapTools" in items player)|| {AGM_Map_mapToolsShown == 0}) exitWith {};
|
||||
|
||||
// If markers don't exist and should, create them
|
||||
if (isNil "AGM_Map_mapToolFixed") then {
|
||||
AGM_Map_mapToolFixed = createMarkerLocal ["AGM_MapToolFixed", AGM_Map_pos];
|
||||
"AGM_MapToolFixed" setMarkerType "AGM_MapToolFixed";
|
||||
};
|
||||
if ((isNil "AGM_Map_mapToolRotatingNormal") && {AGM_Map_mapToolsShown == 1}) then {
|
||||
AGM_Map_mapToolRotatingNormal = createMarkerLocal ["AGM_MapToolRotatingNormal", AGM_Map_pos];
|
||||
"AGM_MapToolRotatingNormal" setMarkerType "AGM_MapToolRotatingNormal";
|
||||
};
|
||||
if ((isNil "AGM_Map_mapToolRotatingSmall") && {AGM_Map_mapToolsShown == 2}) then {
|
||||
AGM_Map_mapToolRotatingSmall = createMarkerLocal ["AGM_MapToolRotatingSmall", AGM_Map_pos];
|
||||
"AGM_MapToolRotatingSmall" setMarkerType "AGM_MapToolRotatingSmall";
|
||||
};
|
||||
|
||||
_rotatingMarker = ["AGM_MapToolRotatingNormal", "AGM_MapToolRotatingSmall"] select (AGM_Map_mapToolsShown - 1);
|
||||
_textureWidth = [TEXTURE_WIDTH_IN_M, TEXTURE_WIDTH_IN_M / 2] select (AGM_Map_mapToolsShown - 1);
|
||||
|
||||
// Update scale of both parts
|
||||
_scale = _textureWidth * CONSTANT_SCALE * (call AGM_Map_fnc_calculateMapScale);
|
||||
"AGM_MapToolFixed" setMarkerSizeLocal [_scale,_scale];
|
||||
_rotatingMarker setMarkerSizeLocal [_scale,_scale];
|
||||
|
||||
// Position of the fixed part
|
||||
_xPos = AGM_Map_pos select 0;
|
||||
_yPos = (AGM_Map_pos select 1) + _textureWidth * CENTER_OFFSET_Y_PERC;
|
||||
"AGM_MapToolFixed" setMarkerPosLocal [_xPos,_yPos];
|
||||
|
||||
// Position and rotation of the rotating part
|
||||
_xPos = (AGM_Map_pos select 0) + sin(AGM_Map_angle) * _textureWidth * CENTER_OFFSET_Y_PERC;
|
||||
_yPos = (AGM_Map_pos select 1) + cos(AGM_Map_angle) * _textureWidth * CENTER_OFFSET_Y_PERC;
|
||||
_rotatingMarker setMarkerPosLocal [_xPos,_yPos];
|
||||
_rotatingMarker setMarkerDirLocal AGM_Map_angle;
|
@ -1,4 +0,0 @@
|
||||
// by CAA-Picard
|
||||
|
||||
AGM_Map_serverLineMarkers = [];
|
||||
publicVariable "AGM_Map_serverLineMarkers";
|
Binary file not shown.
@ -1,4 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
//0 spawn compile preprocessFileLineNumbers "\AGM_Movement\fatigue.sqf";
|
||||
0 spawn compile preprocessFileLineNumbers "\AGM_Movement\showWeight.sqf";
|
@ -1,223 +0,0 @@
|
||||
// PATCH CONFIG
|
||||
class CfgPatches {
|
||||
class AGM_Movement {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = 0.10;
|
||||
requiredAddons[] = {AGM_Core};
|
||||
version = "0.95";
|
||||
versionStr = "0.95";
|
||||
versionAr[] = {0,95,0};
|
||||
author[] = {"commy2", "KoffeinFlummi", "Tachii"};
|
||||
authorUrl = "https://github.com/commy2/";
|
||||
};
|
||||
};
|
||||
|
||||
class CfgFunctions {
|
||||
class AGM_Movement {
|
||||
class AGM_Movement {
|
||||
file = "AGM_Movement\functions";
|
||||
class blinking;
|
||||
class canClimb;
|
||||
class climb;
|
||||
class fatigueModule;
|
||||
class heartbeat;
|
||||
class getWeight;
|
||||
class handleClimb;
|
||||
class recoil;
|
||||
class stumble;
|
||||
class vision;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class AGM_Movement {
|
||||
clientInit = "call compile preprocessFileLineNumbers '\AGM_Movement\clientInit.sqf'";
|
||||
};
|
||||
};
|
||||
|
||||
class AGM_Core_Default_Keys {
|
||||
class climb {
|
||||
displayName = "$STR_AGM_Movement_Climb";
|
||||
condition = "_player == _vehicle";
|
||||
statement = "[_player] call AGM_Movement_fnc_climb";
|
||||
key = 47;
|
||||
shift = 0;
|
||||
control = 1;
|
||||
alt = 0;
|
||||
};
|
||||
};
|
||||
|
||||
/*class CfgInventoryGlobalVariable {
|
||||
maxSoldierLoad = 1200;
|
||||
};*/
|
||||
|
||||
class CfgFatigue {
|
||||
MinValue1 = 0.2;
|
||||
MinValue2 = 0.8;
|
||||
NormalRunSpeed = 7.2;
|
||||
TiredRunSpeedLimit = 0.8;
|
||||
FrequencyMin = 0.2;
|
||||
FrequencyMax = 1.0;
|
||||
TotalLoadCoef = 1.1;
|
||||
MaxDuty = 10;
|
||||
};
|
||||
|
||||
class CfgSounds {
|
||||
class AGM_Heartbeat {
|
||||
name = "AGM_Heartbeat";
|
||||
sound[] = {"AGM_Movement\sounds\heartbeat.ogg",1,1};
|
||||
titles[] = {};
|
||||
};
|
||||
};
|
||||
|
||||
class AGM_Core_Options {
|
||||
class useImperial {
|
||||
displayName = "$STR_AGM_Movement_UseImperial";
|
||||
default = 0;
|
||||
};
|
||||
};
|
||||
|
||||
// leaving this for compatibility
|
||||
class CfgVehicles {
|
||||
class Module_F;
|
||||
class AGM_ModuleFatigue: Module_F {
|
||||
author = "AGM Team";
|
||||
category = "AGM";
|
||||
displayName = "Fatigue System";
|
||||
function = "AGM_Movement_fnc_fatigueModule";
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
icon = "\AGM_Movement\UI\IconFatigue_ca.paa";
|
||||
class Arguments {
|
||||
class CoefFatigue {
|
||||
displayName = "Getting Tired Coef.";
|
||||
description = "Multiplier for the rate of getting tired. Default: 1";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class CoefRecover {
|
||||
displayName = "Recover Coef.";
|
||||
description = "Multiplier for the time to rest after getting tired. Default: 1";
|
||||
defaultValue = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class CfgMovesBasic {
|
||||
class ManActions {
|
||||
AGM_Climb = "AGM_Climb";
|
||||
};
|
||||
|
||||
class Actions {
|
||||
class RifleStandActionsNoAdjust;
|
||||
class RifleLowStandActionsNoAdjust;
|
||||
|
||||
// WEAPON RAISED - RUNNING
|
||||
class RifleStandActionsRunF: RifleStandActionsNoAdjust {
|
||||
getOver = "AovrPercMrunSrasWrflDf";
|
||||
};
|
||||
class RifleStandActionsRunFL: RifleStandActionsNoAdjust {
|
||||
getOver = "AovrPercMrunSrasWrflDf";
|
||||
};
|
||||
class RifleStandActionsRunFR: RifleStandActionsNoAdjust {
|
||||
getOver = "AovrPercMrunSrasWrflDf";
|
||||
};
|
||||
// WEAPON RAISED - SPRINTING
|
||||
class RifleStandEvasiveActionsF: RifleStandActionsNoAdjust {
|
||||
getOver = "AovrPercMrunSrasWrflDf";
|
||||
};
|
||||
class RifleStandEvasiveActionsFL: RifleStandActionsNoAdjust {
|
||||
getOver = "AovrPercMrunSrasWrflDf";
|
||||
};
|
||||
class RifleStandEvasiveActionsFR: RifleStandActionsNoAdjust {
|
||||
getOver = "AovrPercMrunSrasWrflDf";
|
||||
};
|
||||
// WEAPON LOWERED - RUNNING
|
||||
class RifleLowStandActionsRunF: RifleLowStandActionsNoAdjust {
|
||||
getOver = "AovrPercMrunSrasWrflDf";
|
||||
};
|
||||
class RifleLowStandActionsRunFL: RifleLowStandActionsNoAdjust {
|
||||
getOver = "AovrPercMrunSrasWrflDf";
|
||||
};
|
||||
class RifleLowStandActionsRunFR: RifleLowStandActionsNoAdjust {
|
||||
getOver = "AovrPercMrunSrasWrflDf";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class CfgMovesMaleSdr: CfgMovesBasic {
|
||||
class StandBase;
|
||||
class States {
|
||||
// better slow walk with lowered rifle animation
|
||||
class AmovPercMstpSrasWrflDnon;
|
||||
class AmovPercMrunSrasWrflDf: AmovPercMstpSrasWrflDnon {
|
||||
InterpolateTo[] = {"AovrPercMrunSrasWrflDf",0.22,"AmovPercMrunSlowWrflDf",0.025,"AmovPercMwlkSrasWrflDf",0.025,"AmovPknlMrunSrasWrflDf",0.03,"AmovPercMrunSlowWrflDf_AmovPpneMstpSrasWrflDnon",0.02,"AmovPercMevaSrasWrflDf",0.025,"Unconscious",0.01,"AmovPercMtacSrasWrflDf",0.02,"AmovPercMrunSrasWrflDfl",0.02,"AmovPercMrunSrasWrflDfl_ldst",0.02,"AmovPercMrunSrasWrflDfr",0.02,"AmovPercMrunSrasWrflDfr_ldst",0.02,"AmovPercMstpSrasWrflDnon",0.02,"AmovPercMrunSrasWrflDl",0.02,"AmovPercMrunSrasWrflDbl",0.02,"AmovPercMrunSrasWrflDb",0.02,"AmovPercMrunSrasWrflDbr",0.02,"AmovPercMrunSrasWrflDr",0.02,"AmovPknlMstpSlowWrflDnon_relax",0.1,"AmovPercMrunSrasWrflDf_ldst",0.02,"AmovPercMrunSrasWrflDf",0.02};
|
||||
};
|
||||
|
||||
class AmovPercMstpSlowWrflDnon;
|
||||
class AmovPercMwlkSlowWrflDf: AmovPercMstpSlowWrflDnon {
|
||||
speed = 0.3; //0.206897;
|
||||
file = "\A3\anims_f\Data\Anim\Sdr\Mov\Erc\Wlk\Low\Rfl\AmovPercMwlkSlowWrflDf_ver2";
|
||||
leftHandIKCurve[] = {1};
|
||||
};
|
||||
class AmovPercMwlkSlowWrflDfl: AmovPercMwlkSlowWrflDf {
|
||||
leftHandIKCurve[] = {};
|
||||
};
|
||||
class AmovPercMwlkSlowWrflDfr: AmovPercMwlkSlowWrflDf {
|
||||
leftHandIKCurve[] = {};
|
||||
};
|
||||
class AmovPercMwlkSlowWrflDb: AmovPercMwlkSlowWrflDf {
|
||||
leftHandIKCurve[] = {};
|
||||
};
|
||||
class AmovPercMwlkSlowWrflDbl: AmovPercMwlkSlowWrflDf {
|
||||
leftHandIKCurve[] = {};
|
||||
};
|
||||
class AmovPercMwlkSlowWrflDbr: AmovPercMwlkSlowWrflDf {
|
||||
leftHandIKCurve[] = {};
|
||||
};
|
||||
class AmovPercMwlkSlowWrflDl: AmovPercMwlkSlowWrflDf {
|
||||
leftHandIKCurve[] = {};
|
||||
};
|
||||
class AmovPercMwlkSlowWrflDr: AmovPercMwlkSlowWrflDf {
|
||||
leftHandIKCurve[] = {};
|
||||
};
|
||||
|
||||
// enable optics in prone left and right stance
|
||||
class AidlPpneMstpSrasWrflDnon_G0S;
|
||||
class AadjPpneMstpSrasWrflDleft: AidlPpneMstpSrasWrflDnon_G0S {
|
||||
enableOptics = 1;
|
||||
};
|
||||
class AadjPpneMstpSrasWrflDright: AidlPpneMstpSrasWrflDnon_G0S {
|
||||
enableOptics = 1;
|
||||
};
|
||||
class AadjPpneMstpSrasWrflDup;
|
||||
class AadjPpneMstpSrasWrflDdown: AadjPpneMstpSrasWrflDup {
|
||||
enableOptics = 1;
|
||||
};
|
||||
|
||||
class AidlPpneMstpSrasWpstDnon_G0S;
|
||||
class AadjPpneMstpSrasWpstDleft: AidlPpneMstpSrasWpstDnon_G0S {
|
||||
enableOptics = 2;
|
||||
};
|
||||
class AadjPpneMstpSrasWpstDright: AidlPpneMstpSrasWpstDnon_G0S {
|
||||
enableOptics = 2;
|
||||
};
|
||||
class AadjPpneMstpSrasWpstDup;
|
||||
class AadjPpneMstpSrasWpstDdown: AadjPpneMstpSrasWpstDup {
|
||||
enableOptics = 2;
|
||||
};
|
||||
|
||||
// climb animation
|
||||
class AmovPercMstpSnonWnonDnon: StandBase {
|
||||
ConnectTo[] += {"AGM_Climb",0.02};
|
||||
};
|
||||
|
||||
class AmovPercMstpSnonWnonDnon_AcrgPknlMstpSnonWnonDnon_getInMedium;
|
||||
class AGM_Climb: AmovPercMstpSnonWnonDnon_AcrgPknlMstpSnonWnonDnon_getInMedium {
|
||||
canReload = 0;
|
||||
forceAim = 1;
|
||||
};
|
||||
};
|
||||
};
|
@ -1,55 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
#define THRESHOLD_1 0.8
|
||||
#define THRESHOLD_2 0.9
|
||||
#define THRESHOLD_3 0.99
|
||||
|
||||
// init onEachFrame EH
|
||||
AGM_UpdatePlayerFatigue_EHID = ["AGM_UpdatePlayerFatigue", "onEachFrame", {
|
||||
_player = AGM_player;
|
||||
|
||||
// calc new fatigue
|
||||
_fatigue = getFatigue _player;
|
||||
_fatigueOld = _player getVariable ["AGM_Fatigue", getFatigue _player];
|
||||
|
||||
if (_fatigue > _fatigueOld) then {
|
||||
_fatigue = _fatigueOld + (missionNamespace getVariable ["AGM_Fatigue_CoefFatigue", 1]) * (_fatigue - _fatigueOld) max 0 min 1;
|
||||
} else {
|
||||
_fatigue = _fatigueOld - (missionNamespace getVariable ["AGM_Fatigue_CoefRecover", 1]) * (_fatigueOld - _fatigue) max 0 min 1;
|
||||
};
|
||||
|
||||
_player setFatigue _fatigue;
|
||||
_player setVariable ["AGM_Fatigue", _fatigue];
|
||||
|
||||
["Fatigue", _player, {getFatigue _this}] call AGM_Debug_fnc_log;
|
||||
}] call BIS_fnc_addStackedEventHandler;
|
||||
|
||||
// init script ehids
|
||||
_handleRecoil = scriptNull;
|
||||
_handleBlinking = scriptNull;
|
||||
_handleHeartbeat = scriptNull;
|
||||
_handleStumble = scriptNull;
|
||||
|
||||
// apply fatigue effects
|
||||
while {true} do {
|
||||
_fatigue = getFatigue AGM_player;
|
||||
|
||||
if (_fatigue > THRESHOLD_1) then {
|
||||
if (scriptDone _handleHeartbeat) then {
|
||||
_handleHeartbeat = call AGM_Movement_fnc_heartbeat;
|
||||
};
|
||||
if (_fatigue > THRESHOLD_2) then {
|
||||
if (scriptDone _handleBlinking) then {
|
||||
_handleBlinking = call AGM_Movement_fnc_blinking;
|
||||
};
|
||||
|
||||
if (_fatigue > THRESHOLD_3) then {
|
||||
if (scriptDone _handleStumble) then {
|
||||
_handleStumble = call AGM_Movement_fnc_stumble;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sleep 0.5;
|
||||
};
|
@ -1,23 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private "_script_handle";
|
||||
|
||||
_script_handle = _this spawn {
|
||||
if (!isTouchingGround player) exitWith {};
|
||||
|
||||
_ppEffect = ppEffectCreate ["ColorCorrections", 1240];
|
||||
_ppEffect ppEffectEnable true;
|
||||
_ppEffect ppEffectForceInNVG true;
|
||||
_ppEffect ppEffectAdjust [0, -1, 0, [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]];
|
||||
_ppEffect ppEffectCommit 0.2;
|
||||
sleep 0.2;
|
||||
|
||||
_ppEffect ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [1, 1, 1, 1], [0.5, 0.5, 0.5, 0.5]];
|
||||
_ppEffect ppEffectCommit 0.2;
|
||||
sleep 0.2;
|
||||
|
||||
_ppEffect ppEffectEnable false;
|
||||
ppEffectDestroy _ppEffect;
|
||||
sleep 2 + random 2;
|
||||
};
|
||||
_script_handle
|
@ -1,21 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private "_unit";
|
||||
|
||||
_unit = _this select 0;
|
||||
|
||||
if !([_unit] call AGM_Movement_fnc_canClimb) exitWith {
|
||||
[localize "STR_AGM_Movement_CanNotClimb"] call AGM_Core_fnc_displayTextStructured;
|
||||
};
|
||||
|
||||
if !(_unit getVariable ["AGM_isClimbInit", false]) then {
|
||||
_unit addEventHandler ["AnimDone", {
|
||||
if (local (_this select 0) && {_this select 1 == "AGM_Climb"}) then {_this call AGM_Movement_fnc_handleClimb};
|
||||
}];
|
||||
|
||||
_unit setVariable ["AGM_isClimbInit", true];
|
||||
};
|
||||
|
||||
[_unit] call AGM_Core_fnc_fixLoweredRifleAnimation;
|
||||
[_unit, "AmovPercMstpSnonWnonDnon", 2] call AGM_Core_fnc_doAnimation;
|
||||
[_unit, "AGM_Climb", 0] call AGM_Core_fnc_doAnimation;
|
@ -1,14 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
_logic = _this select 0;
|
||||
_units = _this select 1;
|
||||
_activated = _this select 2;
|
||||
|
||||
if !(_activated) exitWith {};
|
||||
|
||||
AGM_Fatigue_Module = true;
|
||||
|
||||
AGM_Fatigue_CoefFatigue = parseNumber (_logic getVariable "CoefFatigue");
|
||||
AGM_Fatigue_CoefRecover = parseNumber (_logic getVariable "CoefRecover");
|
||||
|
||||
diag_log text "[AGM]: Fatigue Module Initialized.";
|
@ -1,17 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
#define FACTOR_POUND_TO_KILOGRAMM 1/2.2046
|
||||
|
||||
private ["_unit", "_weight"];
|
||||
|
||||
_unit = _this select 0;
|
||||
|
||||
_weight = loadAbs _unit * 0.1;
|
||||
|
||||
if (profileNamespace getVariable ["AGM_useImperial", false]) then {
|
||||
_weight = format ["%1lb", (round (_weight * 100)) / 100];
|
||||
} else {
|
||||
_weight = format ["%1kg", (round (_weight * FACTOR_POUND_TO_KILOGRAMM * 100)) / 100];
|
||||
};
|
||||
|
||||
_weight
|
@ -1,9 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private "_script_handle";
|
||||
|
||||
_script_handle = _this spawn {
|
||||
playSound "AGM_Heartbeat";
|
||||
sleep 8;
|
||||
};
|
||||
_script_handle
|
@ -1,15 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private "_script_handle";
|
||||
|
||||
_script_handle = _this spawn {
|
||||
_recoilFactor = _this select 0;
|
||||
_recoverThreshold = _this select 1;
|
||||
|
||||
player setUnitRecoilCoefficient (_recoilFactor * unitRecoilCoefficient player);
|
||||
|
||||
waitUntil {getFatigue player < _recoverThreshold};
|
||||
|
||||
player setUnitRecoilCoefficient (_recoilFactor / unitRecoilCoefficient player);
|
||||
};
|
||||
_script_handle
|
@ -1,16 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
_this spawn {
|
||||
if (isTouchingGround player) then {
|
||||
_animation = switch (currentWeapon player) do {
|
||||
case "" : {"AmovPpneMstpSnonWnonDnon"};
|
||||
case (primaryWeapon player) : {"AmovPpneMstpSrasWrflDnon"};
|
||||
case (secondaryWeapon player) : {"AmovPpneMstpSrasWrflDnon"};
|
||||
case (handgunWeapon player) : {"AmovPpneMstpSrasWpstDnon"};
|
||||
case (binocular player) : {"AmovPpneMstpSrasWbinDnon"};
|
||||
default {"AmovPpneMstpSnonWnonDnon"};
|
||||
};
|
||||
[player, _animation] call AGM_Core_fnc_doAnimation;
|
||||
};
|
||||
sleep 6;
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private "_script_handle";
|
||||
|
||||
_script_handle = _this spawn {
|
||||
_ppEffect = ppEffectCreate ["radialBlur", 1241];
|
||||
|
||||
_ppEffect ppEffectEnable true;
|
||||
_ppEffect ppEffectForceInNVG true;
|
||||
_ppEffect ppEffectAdjust [0.01, 0.01, 0.1, 0.1];
|
||||
_ppEffect ppEffectCommit 0;
|
||||
|
||||
sleep 0.5;
|
||||
|
||||
_ppEffect ppEffectEnable false;
|
||||
ppEffectDestroy _ppEffect;
|
||||
};
|
||||
_script_handle
|
@ -1,10 +0,0 @@
|
||||
//by commy2
|
||||
|
||||
while {true} do {
|
||||
waitUntil {!isNull (findDisplay 602)};
|
||||
waitUntil {
|
||||
_player = AGM_player;
|
||||
findDisplay 602 displayCtrl 111 ctrlSetText format ["%1 - %2 %3", [_player] call AGM_Core_fnc_getName, localize "STR_AGM_Movement_Weight", [_player] call AGM_Movement_fnc_getWeight];
|
||||
isNull (findDisplay 602)
|
||||
};
|
||||
};
|
Binary file not shown.
@ -1,5 +0,0 @@
|
||||
|
||||
// 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,46 +0,0 @@
|
||||
// PATCH CONFIG
|
||||
class CfgPatches {
|
||||
class AGM_SafeMode {
|
||||
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 CfgFunctions {
|
||||
class AGM_SafeMode {
|
||||
class AGM_SafeMode {
|
||||
file = "AGM_SafeMode\functions";
|
||||
class firstMode;
|
||||
class lockSafety;
|
||||
class playChangeFiremodeSound;
|
||||
class setSafeModeVisual;
|
||||
class unlockSafety;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class AGM_SafeMode {
|
||||
clientInit = "call compile preprocessFileLineNumbers '\AGM_SafeMode\clientInit.sqf';";
|
||||
};
|
||||
};
|
||||
|
||||
class AGM_Core_Default_Keys {
|
||||
class safeWeapon {
|
||||
displayName = "$STR_AGM_SafeMode_SafeMode";
|
||||
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
|
||||
statement = "[_player, currentWeapon _player, currentMuzzle _player] call AGM_SafeMode_fnc_lockSafety";
|
||||
exceptions[] = {"AGM_Interaction_isNotEscorting"};
|
||||
key = 41;
|
||||
shift = 0;
|
||||
control = 1;
|
||||
alt = 0;
|
||||
};
|
||||
};
|
@ -1,65 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private ["_unit", "_weapon", "_muzzle", "_safedWeapons"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
_muzzle = _this select 2;
|
||||
|
||||
// don't immediately switch back
|
||||
if (inputAction "nextWeapon" > 0) exitWith {};
|
||||
|
||||
_safedWeapons = _unit getVariable ["AGM_SafeMode_safedWeapons", []];
|
||||
|
||||
if (_weapon in _safedWeapons) exitWith {
|
||||
_this call AGM_SafeMode_fnc_unlockSafety;
|
||||
};
|
||||
|
||||
_safedWeapons pushBack _weapon;
|
||||
|
||||
_unit setVariable ["AGM_SafeMode_safedWeapons", _safedWeapons];
|
||||
|
||||
if (_unit getVariable ["AGM_SafeWeapon_actionID", -1] == -1) then {
|
||||
private ["_condition", "_statement", "_id"];
|
||||
|
||||
_condition = {
|
||||
if (
|
||||
[_this select 1] call AGM_Core_fnc_canUseWeapon
|
||||
&& {
|
||||
if (currentMuzzle (_this select 1) in ((_this select 1) getVariable ["AGM_SafeMode_safedWeapons", []])) then {
|
||||
if (inputAction "nextWeapon" > 0) exitWith {
|
||||
[_this select 1, currentWeapon (_this select 1), currentMuzzle (_this select 1)] call AGM_SafeMode_fnc_unlockSafety;
|
||||
false
|
||||
};
|
||||
true
|
||||
} else {false}
|
||||
}
|
||||
) then {
|
||||
// player hud
|
||||
[false] call AGM_SafeMode_fnc_setSafeModeVisual;
|
||||
true
|
||||
} else {
|
||||
// player hud
|
||||
[true] call AGM_SafeMode_fnc_setSafeModeVisual;
|
||||
false
|
||||
}
|
||||
};
|
||||
|
||||
_statement = {
|
||||
[_this select 1, currentWeapon (_this select 1), currentMuzzle (_this select 1)] call AGM_SafeMode_fnc_unlockSafety;
|
||||
};
|
||||
|
||||
//_id = [_unit, format ["<t color=""#FFFF00"" >%1</t>", localize "STR_AGM_SafeMode_TakeOffSafety"], "DefaultAction", _condition, {}, {true}, _statement, 10] call AGM_Core_fnc_addActionMenuEventHandler;
|
||||
_id = [_unit, "DefaultAction", _condition, {}] call AGM_Core_fnc_addActionEventHandler;
|
||||
|
||||
_unit setVariable ["AGM_SafeWeapon_actionID", _id];
|
||||
};
|
||||
|
||||
_unit selectWeapon _muzzle;//_weapon
|
||||
|
||||
// play fire mode selector sound
|
||||
[_unit, _weapon, _muzzle] call AGM_SafeMode_fnc_playChangeFiremodeSound;
|
||||
|
||||
private "_picture";
|
||||
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
[localize "STR_AGM_SafeMode_PutOnSafety", _picture] call AGM_Core_fnc_displayTextPicture;
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi
|
||||
*
|
||||
* Initializes vars needed for scope adjustment and watches for scope changes.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*/
|
||||
AGM_Scopes_fadeScript = scriptNull;
|
||||
|
||||
// show overlay after changing weapon/optic
|
||||
0 spawn {
|
||||
_layer = ["AGM_Scope_Zeroing"] call BIS_fnc_rscLayer;
|
||||
while {True} do {
|
||||
waitUntil {[AGM_player, 0,0] call AGM_Scopes_fnc_canAdjustScope};
|
||||
_layer cutRsc ["AGM_Scope_Zeroing", "PLAIN", 0, false];
|
||||
sleep 3;
|
||||
_layer cutFadeOut 2;
|
||||
|
||||
_weapon = currentWeapon AGM_player;
|
||||
_optics = [AGM_player] call AGM_Scopes_fnc_getOptics;
|
||||
waitUntil {sleep 0.05; !(_optics isEqualTo ([AGM_player] call AGM_Scopes_fnc_getOptics)) or (currentWeapon AGM_player != _weapon)};
|
||||
};
|
||||
};
|
||||
|
||||
// instantly hide when scoping in
|
||||
0 spawn {
|
||||
_layer = ["AGM_Scope_Zeroing"] call BIS_fnc_rscLayer;
|
||||
while {True} do {
|
||||
waitUntil {sleep 0.05; cameraView == "GUNNER"};
|
||||
if !(isNull AGM_Scopes_fadeScript) then {
|
||||
terminate AGM_Scopes_fadeScript;
|
||||
};
|
||||
_layer cutText ["", "PLAIN", 0];
|
||||
};
|
||||
};
|
@ -1,238 +0,0 @@
|
||||
class CfgPatches {
|
||||
class AGM_Scopes {
|
||||
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 CfgFunctions {
|
||||
class AGM_Scopes {
|
||||
class AGM_Scopes {
|
||||
file = "AGM_Scopes\functions";
|
||||
class adjustScope;
|
||||
class canAdjustScope;
|
||||
class firedEH;
|
||||
class getOptics;
|
||||
class hideZeroing;
|
||||
class inventoryCheck;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class AGM_Scopes {
|
||||
clientInit = "call compile preprocessFileLineNumbers '\AGM_Scopes\clientInit.sqf';";
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Fired_EventHandlers {
|
||||
class CAManBase {
|
||||
class AGM_Scopes {
|
||||
clientFired = "if (_this select 0 == AGM_player) then {_this call AGM_Scopes_fnc_firedEH};";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Take_EventHandlers {
|
||||
class CAManBase {
|
||||
class AGM_Scopes {
|
||||
clientTake = "if (_this select 0 == AGM_player) then {_this call AGM_Scopes_fnc_inventoryCheck};";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Put_EventHandlers {
|
||||
class CAManBase {
|
||||
class AGM_Scopes {
|
||||
clientPut = "if (_this select 0 == AGM_player) then {_this call AGM_Scopes_fnc_inventoryCheck};";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_InitPost_EventHandlers {
|
||||
class CAManBase {
|
||||
class AGM_Scopes {
|
||||
init = "if (_this select 0 == call AGM_Core_fnc_player) then {_this call AGM_Scopes_fnc_inventoryCheck};";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Respawn_EventHandlers {
|
||||
class CAManBase {
|
||||
class AGM_Scopes {
|
||||
respawn = "if (_this select 0 == call AGM_Core_fnc_player) then {_this call AGM_Scopes_fnc_inventoryCheck};";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class AGM_Core_Default_Keys {
|
||||
class adjustScopeUp {
|
||||
displayName = "$STR_AGM_Scopes_AdjustUp";
|
||||
condition = "[_player] call AGM_Scopes_fnc_inventoryCheck; [_player, 0, 0.1] call AGM_Scopes_fnc_canAdjustScope";
|
||||
statement = "[_player, 0, 0.1] call AGM_Scopes_fnc_adjustScope;";
|
||||
allowHolding = 1;
|
||||
key = 201;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
class adjustScopeDown: adjustScopeUp {
|
||||
displayName = "$STR_AGM_Scopes_AdjustDown";
|
||||
condition = "[_player] call AGM_Scopes_fnc_inventoryCheck; [_player, 0, -0.1] call AGM_Scopes_fnc_canAdjustScope";
|
||||
statement = "[_player, 0, -0.1] call AGM_Scopes_fnc_adjustScope;";
|
||||
key = 209;
|
||||
};
|
||||
class adjustScopeLeft: adjustScopeUp {
|
||||
displayName = "$STR_AGM_Scopes_AdjustLeft";
|
||||
condition = "[_player] call AGM_Scopes_fnc_inventoryCheck; [_player, -0.1, 0] call AGM_Scopes_fnc_canAdjustScope";
|
||||
statement = "[_player, -0.1, 0] call AGM_Scopes_fnc_adjustScope;";
|
||||
key = 209;
|
||||
control = 1;
|
||||
};
|
||||
class adjustScopeRight: adjustScopeLeft {
|
||||
displayName = "$STR_AGM_Scopes_AdjustRight";
|
||||
condition = "[_player] call AGM_Scopes_fnc_inventoryCheck; [_player, 0.1, 0] call AGM_Scopes_fnc_canAdjustScope";
|
||||
statement = "[_player, 0.1, 0] call AGM_Scopes_fnc_adjustScope;";
|
||||
key = 201;
|
||||
};
|
||||
};
|
||||
|
||||
class CfgSounds {
|
||||
class AGM_Sound_Click;
|
||||
class AGM_Scopes_Click_1: AGM_Sound_Click {
|
||||
sound[] = {"\AGM_Scopes\sounds\agm_scopes_click.wav", 3, 2, 200};
|
||||
};
|
||||
class AGM_Scopes_Click_2: AGM_Scopes_Click_1 {
|
||||
sound[] = {"\AGM_Scopes\sounds\agm_scopes_click.wav", 3.3, 1.8, 200};
|
||||
};
|
||||
class AGM_Scopes_Click_3: AGM_Scopes_Click_1 {
|
||||
sound[] = {"\AGM_Scopes\sounds\agm_scopes_click.wav", 2.8, 2.3, 200};
|
||||
};
|
||||
};
|
||||
|
||||
class CfgWeapons {
|
||||
class ItemCore;
|
||||
class InventoryOpticsItem_Base_F;
|
||||
|
||||
class optic_LRPS: ItemCore {
|
||||
AGM_ScopeAdjust_Horizontal[] = {-50,50};
|
||||
AGM_ScopeAdjust_Vertical[] = {-70,70};
|
||||
class ItemInfo: InventoryOpticsItem_Base_F {
|
||||
class OpticsModes {
|
||||
class Snip {
|
||||
discreteDistance[] = {1};
|
||||
discreteDistanceInitIndex = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class optic_SOS: ItemCore {
|
||||
AGM_ScopeAdjust_Horizontal[] = {-50,50};
|
||||
AGM_ScopeAdjust_Vertical[] = {-60,60};
|
||||
class ItemInfo: InventoryOpticsItem_Base_F {
|
||||
class OpticsModes {
|
||||
class Snip {
|
||||
discreteDistance[] = {1};
|
||||
discreteDistanceInitIndex = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class optic_DMS: ItemCore {
|
||||
AGM_ScopeAdjust_Horizontal[] = {-40,40};
|
||||
AGM_ScopeAdjust_Vertical[] = {-40,40};
|
||||
class ItemInfo: InventoryOpticsItem_Base_F {
|
||||
class OpticsModes {
|
||||
class Snip {
|
||||
discreteDistance[] = {1};
|
||||
discreteDistanceInitIndex = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class RscTitles {
|
||||
class AGM_Scope_Zeroing {
|
||||
idd = -1;
|
||||
movingEnable = 0;
|
||||
enableSimulation = 1;
|
||||
enableDisplay = 1;
|
||||
onLoad = "_this spawn compile preprocessFileLineNumbers '\AGM_Scopes\scripts\zeroingOnLoad.sqf'; uiNamespace setVariable ['AGM_Scope_Debug', _this];";
|
||||
duration = 1e+011;
|
||||
fadein = 0;
|
||||
fadeout = 0;
|
||||
name = "AGM_Scope_Zeroing";
|
||||
class RscPicture;
|
||||
class RscText;
|
||||
class controls {
|
||||
class AGM_Scope_Zeroing_BG: RscPicture {
|
||||
idc = 925001;
|
||||
type = 0;
|
||||
text = "AGM_Scopes\UI\scopes_bg.paa";
|
||||
style = 48 + 0x800;
|
||||
scale = 1;
|
||||
sizeEx = 1;
|
||||
font = "PuristaMedium";
|
||||
colorText[] = {1,1,1,1};
|
||||
colorBackground[] = {1,1,1,1};
|
||||
shadow = 1;
|
||||
|
||||
x = (0.5-0.4/2) * safezoneW + safezoneX;
|
||||
y = 0 * safezoneH + safezoneY;
|
||||
w = 0.4 * safezoneW;
|
||||
h = 0.3 * safezoneH;
|
||||
};
|
||||
class AGM_Scope_Zeroing_Vertical: RscText {
|
||||
idc = 925002;
|
||||
type = 0;
|
||||
style = 2;
|
||||
sizeEx = 0.04;
|
||||
lineSpacing = 1;
|
||||
font = "PuristaMedium";
|
||||
text = "";
|
||||
colorText[] = {1,1,1, 0.9};
|
||||
colorBackground[] = {1,0,0, 0};
|
||||
shadow = 0;
|
||||
|
||||
x = (0.5-0.4/2 + 0.45*0.4) * safezoneW + safezoneX;
|
||||
y = (0 + 0.19*0.3) * safezoneH + safezoneY;
|
||||
w = 0.04 * safezoneW;
|
||||
h = 0.025 * safezoneH;
|
||||
};
|
||||
class AGM_Scope_Zeroing_Horizontal: RscText {
|
||||
idc = 925003;
|
||||
type = 0;
|
||||
style = 0;
|
||||
sizeEx = 0.04;
|
||||
lineSpacing = 1;
|
||||
font = "PuristaMedium";
|
||||
text = "";
|
||||
colorText[] = {1,1,1, 0.9};
|
||||
colorBackground[] = {1,0,0, 0};
|
||||
shadow = 0;
|
||||
|
||||
x = (0.5-0.4/2 + 0.6*0.4) * safezoneW + safezoneX;
|
||||
y = (0 + 0.47*0.3) * safezoneH + safezoneY;
|
||||
w = 0.04 * safezoneW;
|
||||
h = 0.025 * safezoneH;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class RscInGameUI {
|
||||
class RscUnitInfo;
|
||||
class RscWeaponZeroing: RscUnitInfo {
|
||||
onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable ['AGM_dlgWeaponZeroing', _this select 0];";
|
||||
};
|
||||
};
|
@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi
|
||||
*
|
||||
* Changes the adjustment for the current scope
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Horizontal adjustment
|
||||
* 1: Vertical adjustment
|
||||
*
|
||||
* Return Value:
|
||||
* True
|
||||
*/
|
||||
|
||||
private ["_unit", "_weapons", "_zeroing", "_pitchbankyaw", "_pitch", "_bank", "_yaw", "_hint"];
|
||||
|
||||
_unit = _this select 0;
|
||||
|
||||
_weapons = [
|
||||
primaryWeapon _unit,
|
||||
secondaryWeapon _unit,
|
||||
handgunWeapon _unit
|
||||
];
|
||||
|
||||
if (isNil "AGM_Scopes_Adjustment") then {
|
||||
AGM_Scopes_Adjustment = [[0,0], [0,0], [0,0]];
|
||||
};
|
||||
|
||||
_zeroing = AGM_Scopes_Adjustment select (_weapons find (currentWeapon _unit));
|
||||
_zeroing set [0, (round (((_zeroing select 0) + (_this select 1)) * 10)) / 10];
|
||||
_zeroing set [1, (round (((_zeroing select 1) + (_this select 2)) * 10)) / 10];
|
||||
|
||||
AGM_Scopes_Adjustment set [_weapons find (currentWeapon _unit), _zeroing];
|
||||
|
||||
playSound (["AGM_Scopes_Click_1", "AGM_Scopes_Click_2", "AGM_Scopes_Click_3"] select floor random 3);
|
||||
|
||||
// slightly rotate the player if looking through optic
|
||||
if (cameraView == "GUNNER") then {
|
||||
_pitchbankyaw = [_unit] call AGM_Core_fnc_getPitchBankYaw;
|
||||
// these are not exact mil-to-degree conversions, but instead chosen
|
||||
// to minimize the effect of rounding errors
|
||||
_pitch = (_pitchbankyaw select 0) + ((_this select 2) * -0.04);
|
||||
_bank = _pitchbankyaw select 1;
|
||||
_yaw = (_pitchbankyaw select 2) + ((_this select 1) * -0.04);
|
||||
[_unit, _pitch, _bank, _yaw] call AGM_Core_fnc_setPitchBankYaw;
|
||||
};
|
||||
|
||||
_display = uiNamespace getVariable ["AGM_Scopes_ZeroingDisplay", displayNull];
|
||||
if !(isNull _display) then {
|
||||
_vertical = _display displayCtrl 925002;
|
||||
_horizontal = _display displayCtrl 925003;
|
||||
_vertical ctrlSetText (str (_zeroing select 1));
|
||||
_horizontal ctrlSetText (str (_zeroing select 0));
|
||||
};
|
||||
|
||||
if (!isNull (missionNamespace getVariable ["AGM_Scopes_fadeScript", scriptNull])) then {
|
||||
terminate AGM_Scopes_fadeScript;
|
||||
};
|
||||
if (cameraView != "GUNNER") then {
|
||||
AGM_Scopes_fadeScript = 0 spawn {
|
||||
_layer = ["AGM_Scope_Zeroing"] call BIS_fnc_rscLayer;
|
||||
_layer cutRsc ["AGM_Scope_Zeroing", "PLAIN", 0, false];
|
||||
sleep 3;
|
||||
_layer cutFadeOut 2;
|
||||
};
|
||||
};
|
||||
|
||||
true
|
@ -1,25 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private ["_state", "_ctrl"];
|
||||
|
||||
_state = _this select 0;
|
||||
|
||||
disableSerialization;
|
||||
_ctrl = (uiNamespace getVariable ['AGM_dlgWeaponZeroing', displayNull]) displayCtrl 168;
|
||||
|
||||
if (_state) then {
|
||||
_ctrl ctrlSetPosition [0,0,0,0];
|
||||
} else {
|
||||
private "_config";
|
||||
|
||||
_config = configFile >> "RscInGameUI" >> "RscWeaponZeroing" >> "CA_Zeroing";
|
||||
|
||||
_ctrl ctrlSetPosition [
|
||||
getNumber (_config >> "x"),
|
||||
getNumber (_config >> "y"),
|
||||
getNumber (_config >> "w"),
|
||||
getNumber (_config >> "h")
|
||||
];
|
||||
};
|
||||
|
||||
_ctrl ctrlCommit 0;
|
@ -1,21 +0,0 @@
|
||||
// by KoffeinFlummi / commy2
|
||||
|
||||
private "_new";
|
||||
|
||||
_new = _this call AGM_Scopes_fnc_getOptics;
|
||||
|
||||
if (isNil "AGM_Scopes_Optics") then {
|
||||
AGM_Scopes_Optics = ["", "", ""];
|
||||
};
|
||||
|
||||
if (isNil "AGM_Scopes_Adjustment") then {
|
||||
AGM_Scopes_Adjustment = [[0,0], [0,0], [0,0]];
|
||||
};
|
||||
|
||||
{
|
||||
if (_new select _forEachIndex != _x) then {
|
||||
AGM_Scopes_Adjustment set [_forEachIndex, [0,0]];
|
||||
};
|
||||
} forEach AGM_Scopes_Optics;
|
||||
|
||||
AGM_Scopes_Optics = _new;
|
@ -1,18 +0,0 @@
|
||||
disableSerialization;
|
||||
|
||||
_display = _this select 0;
|
||||
uiNamespace setVariable ["AGM_Scopes_ZeroingDisplay", _display];
|
||||
_vertical = _display displayCtrl 925002;
|
||||
_horizontal = _display displayCtrl 925003;
|
||||
|
||||
_weapons = [
|
||||
primaryWeapon player,
|
||||
secondaryWeapon player,
|
||||
handgunWeapon player
|
||||
];
|
||||
|
||||
if ((currentWeapon player) in _weapons) then {
|
||||
_zeroing = AGM_Scopes_Adjustment select (_weapons find (currentWeapon player));
|
||||
_horizontal ctrlSetText (str (_zeroing select 0));
|
||||
_vertical ctrlSetText (str (_zeroing select 1));
|
||||
};
|
@ -1,530 +0,0 @@
|
||||
// SEE LICENSE.TXT FOR LICENSING INFORMATION
|
||||
|
||||
class CfgPatches {
|
||||
class AGM_Smallarms {
|
||||
units[] = {};
|
||||
weapons[] = {}; //{"AGM_acc_flashlight_tls"};
|
||||
requiredVersion = 0.60;
|
||||
requiredAddons[] = {AGM_Core};
|
||||
version = "0.95";
|
||||
versionStr = "0.95";
|
||||
versionAr[] = {0,95,0};
|
||||
author[] = {"TaoSensai", "KoffeinFlummi"};
|
||||
authorUrl = "https://github.com/Taosenai/tmr";
|
||||
};
|
||||
};
|
||||
|
||||
// EVERYTHING BELOW BELONGS TO TAOSENSAI
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
// TMR strings update for weapons and magazines:
|
||||
// 1. Change displayname to match TMR standards.
|
||||
// 3. Add displaynameshort to TMR standards.
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
class CfgMagazines {
|
||||
class CA_Magazine;
|
||||
|
||||
// Magazine updates:
|
||||
// 1. Update all magazines with tracer mix to use 1 in 5 mix. Full tracer mags should not be changed!
|
||||
// 2. Remove tracers at bottom of magazine.
|
||||
// 3. Do string updates.
|
||||
|
||||
// 5.56mm ////////////////////////////////////
|
||||
|
||||
class 30Rnd_556x45_Stanag : CA_Magazine {
|
||||
displayname = "5.56mm 30Rnd Mag";
|
||||
displaynameshort = "5.56mm";
|
||||
|
||||
tracersEvery = 0;
|
||||
lastRoundsTracer = 0;
|
||||
};
|
||||
|
||||
class 30Rnd_556x45_Stanag_Tracer_Red: 30Rnd_556x45_Stanag {
|
||||
displayname = "5.56mm 30Rnd Tracer Mag";
|
||||
displaynameshort = "5.56mm";
|
||||
};
|
||||
|
||||
class 30Rnd_556x45_Stanag_Tracer_Green: 30Rnd_556x45_Stanag {
|
||||
displayname = "5.56mm 30Rnd Tracer Mag";
|
||||
displaynameshort = "5.56mm";
|
||||
};
|
||||
|
||||
class 30Rnd_556x45_Stanag_Tracer_Yellow: 30Rnd_556x45_Stanag {
|
||||
displayname = "5.56mm 30Rnd Tracer Mag";
|
||||
displaynameshort = "5.56mm";
|
||||
};
|
||||
|
||||
class 20Rnd_556x45_UW_mag: 30Rnd_556x45_Stanag {
|
||||
displayname = "5.56mm 20Rnd MEA Mag";
|
||||
displaynameshort = "5.56mm MEA";
|
||||
};
|
||||
|
||||
// 6.5mm //////////////////////////////////////////
|
||||
|
||||
class 30Rnd_65x39_caseless_mag : CA_Magazine { // MX!!
|
||||
displayname = "6.5mm 30Rnd Mag";
|
||||
displaynameshort = "6.5mm";
|
||||
|
||||
tracersEvery = 0;
|
||||
lastRoundsTracer = 0;
|
||||
};
|
||||
|
||||
class 30Rnd_65x39_caseless_mag_Tracer : 30Rnd_65x39_caseless_mag { // MX!!
|
||||
displayname = "6.5mm 30Rnd Tracer Mag";
|
||||
displaynameshort = "6.5mm Tracer";
|
||||
};
|
||||
|
||||
class 30Rnd_65x39_caseless_green : 30Rnd_65x39_caseless_mag { // Katiba!!
|
||||
displayname = "6.5mm 30Rnd Mag";
|
||||
displaynameshort = "6.5mm";
|
||||
|
||||
tracersEvery = 0;
|
||||
lastRoundsTracer = 0;
|
||||
};
|
||||
|
||||
class 30Rnd_65x39_caseless_green_Tracer : 30Rnd_65x39_caseless_green { // Katiba!!
|
||||
displayname = "6.5mm 30Rnd Tracer Magazine";
|
||||
displaynameshort = "6.5mm Tracer";
|
||||
};
|
||||
|
||||
class 100Rnd_65x39_caseless_mag : CA_Magazine {
|
||||
displayname = "6.5mm 100Rnd Mag";
|
||||
displaynameshort = "6.5mm";
|
||||
|
||||
tracersEvery = 5;
|
||||
lastRoundsTracer = 3;
|
||||
};
|
||||
|
||||
class 100Rnd_65x39_caseless_mag_Tracer : 100Rnd_65x39_caseless_mag {
|
||||
displayname = "6.5mm 100Rnd Tracer Mag";
|
||||
displaynameshort = "6.5mm Tracer";
|
||||
};
|
||||
|
||||
class 200Rnd_65x39_cased_Box : 100Rnd_65x39_caseless_mag {
|
||||
displayname = "6.5mm 200Rnd Box";
|
||||
displaynameshort = "6.5mm";
|
||||
|
||||
tracersEvery = 5;
|
||||
lastRoundsTracer = 3;
|
||||
};
|
||||
class 200Rnd_65x39_cased_Box_Tracer: 200Rnd_65x39_cased_Box {
|
||||
displayname = "6.5mm 200Rnd Tracer Box";
|
||||
displaynameshort = "6.5mm Tracer";
|
||||
};
|
||||
|
||||
// 7.62mm //////////////////////////////////////////
|
||||
|
||||
class 20Rnd_762x51_Mag: CA_Magazine {
|
||||
displayname = "7.62mm 20Rnd Mag";
|
||||
displaynameshort = "7.62mm";
|
||||
};
|
||||
|
||||
class 150Rnd_762x51_Box : CA_Magazine {
|
||||
displayname = "7.62mm 150Rnd Box";
|
||||
|
||||
tracersEvery = 5;
|
||||
lastRoundsTracer = 3;
|
||||
};
|
||||
|
||||
class 150Rnd_762x51_Box_Tracer : 150Rnd_762x51_Box {
|
||||
displayname = "7.62mm 150Rnd Tracer Box";
|
||||
};
|
||||
|
||||
// Anti-materiel ///////////////////////////////
|
||||
|
||||
class 7Rnd_408_Mag: CA_Magazine {
|
||||
displayname = ".408 7Rnd Mag";
|
||||
};
|
||||
|
||||
class 5Rnd_127x108_Mag: CA_Magazine {
|
||||
displayname = "12.7mm 5Rnd Mag";
|
||||
};
|
||||
|
||||
// SMG & Pistol ////////////////////////////
|
||||
|
||||
class 30Rnd_9x21_Mag : CA_Magazine {
|
||||
displayname = "9mm 30Rnd Mag";
|
||||
displaynameshort = "9mm";
|
||||
|
||||
lastRoundsTracer = 0;
|
||||
};
|
||||
|
||||
class 16Rnd_9x21_Mag: 30Rnd_9x21_Mag {
|
||||
displayname = "9mm 17Rnd Mag";
|
||||
displaynameshort = "9mm";
|
||||
|
||||
count = 17;
|
||||
};
|
||||
|
||||
class 30Rnd_45ACP_Mag_SMG_01 : 30Rnd_9x21_Mag {
|
||||
displayname = ".45 25Rnd Mag";
|
||||
displaynameshort = ".45";
|
||||
|
||||
picture = "\A3\weapons_f\data\ui\M_30Rnd_9x21_CA.paa";
|
||||
|
||||
count = 25;
|
||||
|
||||
tracersEvery = 0;
|
||||
lastRoundsTracer = 0;
|
||||
};
|
||||
|
||||
class 9Rnd_45ACP_Mag : 30Rnd_45ACP_Mag_SMG_01 {
|
||||
displayname = ".45 8Rnd Mag";
|
||||
displaynameshort = ".45";
|
||||
|
||||
count = 8;
|
||||
};
|
||||
|
||||
class 30Rnd_45ACP_Mag_SMG_01_Tracer_Green: 30Rnd_45ACP_Mag_SMG_01 {
|
||||
displayname = ".45 25Rnd Tracer Mag";
|
||||
};
|
||||
};
|
||||
|
||||
class Mode_SemiAuto;
|
||||
class Mode_Burst;
|
||||
class Mode_FullAuto;
|
||||
|
||||
// config inheritance of weapon slot info v1.32
|
||||
class SlotInfo;
|
||||
class CowsSlot: SlotInfo {};
|
||||
class PointerSlot: SlotInfo {
|
||||
//compatibleItems[] = {"acc_flashlight","acc_pointer_IR", "AGM_acc_flashlight_tls"};
|
||||
};
|
||||
|
||||
class CfgWeapons {
|
||||
|
||||
// config inheritance of weapon slot info v1.32 for launchers
|
||||
class Launcher;
|
||||
class Launcher_Base_F: Launcher {
|
||||
class WeaponSlotsInfo {};
|
||||
};
|
||||
|
||||
// config inheritance of weapon slot info v1.32 for assault rifles
|
||||
class RifleCore;
|
||||
class Rifle: RifleCore {
|
||||
class WeaponSlotsInfo {
|
||||
class MuzzleSlot: SlotInfo {};
|
||||
class CowsSlot: CowsSlot {};
|
||||
class PointerSlot: PointerSlot {};
|
||||
};
|
||||
};
|
||||
class Rifle_Base_F: Rifle {};
|
||||
class Rifle_Long_Base_F: Rifle_Base_F {
|
||||
class WeaponSlotsInfo: WeaponSlotsInfo {};
|
||||
};
|
||||
|
||||
// config inheritance of weapon slot info v1.32 for handguns
|
||||
class PistolCore;
|
||||
class Pistol: PistolCore {
|
||||
class WeaponSlotsInfo {
|
||||
class CowsSlot: SlotInfo {};
|
||||
};
|
||||
};
|
||||
class Pistol_Base_F: Pistol {
|
||||
class WeaponSlotsInfo: WeaponSlotsInfo {
|
||||
class MuzzleSlot: SlotInfo {};
|
||||
};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////// SMALL ARMS WEAPONS ///////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Weapon updates:
|
||||
// 1. Do string update.
|
||||
// 2. Fix magazine compatibility as needed.
|
||||
// 3. Fix firing modes as needed.
|
||||
// 4. Fix accessory compatibility as needed.
|
||||
|
||||
// Grenade launchers /////////////////////////////////////
|
||||
// Updated strings are in weapon configs.
|
||||
class GrenadeLauncher;
|
||||
class UGL_F : GrenadeLauncher {};
|
||||
|
||||
// MXs ////////////////////////////////////////////////////
|
||||
|
||||
class arifle_MX_Base_F : Rifle_Base_F {
|
||||
//magazines[] = {"30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag_Tracer", "100Rnd_65x39_caseless_mag", "100Rnd_65x39_caseless_mag_Tracer"};
|
||||
|
||||
// http://www.bushmaster.com/acr/#/intro
|
||||
// 800 rpm (whatever, fictional lol)
|
||||
|
||||
//class Single : Mode_SemiAuto {};
|
||||
class Single : Mode_SemiAuto {
|
||||
reloadTime = 0.075;
|
||||
};
|
||||
|
||||
class FullAuto: Mode_FullAuto {
|
||||
reloadTime = 0.075;
|
||||
};
|
||||
};
|
||||
|
||||
class arifle_MX_SW_F : arifle_MX_Base_F {
|
||||
modes[] = {"Single", "manual", "close", "short", "medium", "far_optic1", "far_optic2"};
|
||||
|
||||
//class Single : Single {};
|
||||
//class manual : FullAuto {};
|
||||
};
|
||||
|
||||
// Katibas ////////////////////////////////////////////////////
|
||||
|
||||
class arifle_katiba_Base_F : Rifle_Base_F {
|
||||
// http://world.guns.ru/assault/iran/khaybar-kh2002-e.html
|
||||
// 800 rpm
|
||||
|
||||
class Single : Mode_SemiAuto {
|
||||
reloadTime = 0.075;
|
||||
};
|
||||
|
||||
class FullAuto: Mode_FullAuto {
|
||||
reloadTime = 0.075;
|
||||
};
|
||||
};
|
||||
|
||||
// SDAR //////////////////////////////////////////////////
|
||||
|
||||
class SDAR_base_F : Rifle_Base_F {
|
||||
modes[] = {"Single", "FullAuto"}; // Leave in the imaginary full-auto mode because, whatever.
|
||||
};
|
||||
|
||||
// Tavor TRG ////////////////////////////////////////////////
|
||||
|
||||
class Tavor_base_F : Rifle_Base_F {
|
||||
// http://www.israel-weapon.com/files/brochure_2012/IWI_TAVOR_AR.pdf
|
||||
// 700 ~1000 rpm (850)
|
||||
class Single : Mode_SemiAuto {
|
||||
reloadTime = 0.07;
|
||||
};
|
||||
|
||||
class FullAuto: Mode_FullAuto {
|
||||
reloadTime = 0.07;
|
||||
};
|
||||
};
|
||||
|
||||
// Mk20 (F2000) //////////////////////////////////////////////////
|
||||
|
||||
class mk20_base_F : Rifle_Base_F {
|
||||
// http://www.fnherstal.com/primary-menu/products-capabilities/rifles/technical-data/product/182/232/182/1/_/fn-f2000R-standard.html
|
||||
// 850 rpm
|
||||
class Single : Mode_SemiAuto {
|
||||
reloadTime = 0.07;
|
||||
};
|
||||
|
||||
class FullAuto: Mode_FullAuto {
|
||||
reloadTime = 0.07;
|
||||
};
|
||||
};
|
||||
|
||||
// SMG Vermin ////////////////////////////////////////////////////
|
||||
|
||||
class SMG_01_Base : Rifle_Base_F {
|
||||
// http://kriss-usa.com/pdf/operatormanual/
|
||||
// 1200 rpm
|
||||
class Single : Mode_SemiAuto {
|
||||
reloadTime = 0.05;
|
||||
};
|
||||
|
||||
class Burst : Mode_Burst {
|
||||
burst = 2;
|
||||
reloadTime = 0.05;
|
||||
};
|
||||
|
||||
class FullAuto: Mode_FullAuto {
|
||||
reloadTime = 0.05;
|
||||
};
|
||||
};
|
||||
|
||||
// SMG Scorpion ////////////////////////////////////////////////////
|
||||
|
||||
class SMG_02_base_F : Rifle_Base_F {
|
||||
//http://www.czub.cz/zbrojovka/cz-manual/Instruction-Manual-Scorpion-EVO-3-A1_en.pdf
|
||||
// 1150 rpm
|
||||
|
||||
class Single : Mode_SemiAuto {
|
||||
// http://www.stengg.com/upload/915fGdhTi3ggnnGQGGL.pdf
|
||||
// 900-1100 rpm (1000rpm)
|
||||
reloadTime = 0.052;
|
||||
};
|
||||
|
||||
class Burst : Mode_Burst {
|
||||
reloadTime = 0.052;
|
||||
};
|
||||
|
||||
class FullAuto: Mode_FullAuto {
|
||||
reloadTime = 0.052;
|
||||
};
|
||||
};
|
||||
|
||||
// SMG PDW2000 ///////////////////////////////////////////////////
|
||||
|
||||
class pdw2000_base_F: Rifle_Base_F {
|
||||
magazines[] = {"30Rnd_9x21_Mag"};
|
||||
|
||||
modes[] = {"Single", "FullAuto"}; // No burst on this thing
|
||||
|
||||
class Single : Mode_SemiAuto {
|
||||
// http://www.stengg.com/upload/915fGdhTi3ggnnGQGGL.pdf
|
||||
// 900-1100 rpm (1000rpm)
|
||||
reloadTime = 0.06;
|
||||
};
|
||||
|
||||
class FullAuto: Mode_FullAuto {
|
||||
reloadTime = 0.06;
|
||||
};
|
||||
};
|
||||
|
||||
// Pistols //////////////////////////////////////////////
|
||||
|
||||
class hgun_P07_F : Pistol_Base_F {
|
||||
magazines[] = {"16Rnd_9x21_Mag"};
|
||||
};
|
||||
|
||||
class hgun_Rook40_F : Pistol_Base_F {
|
||||
magazines[] = {"16Rnd_9x21_Mag"};
|
||||
};
|
||||
|
||||
/*class hgun_ACPC2_F: Pistol_Base_F {};
|
||||
class hgun_Pistol_heavy_01_F: Pistol_Base_F {};
|
||||
class hgun_Pistol_heavy_02_F: Pistol_Base_F {};*/
|
||||
|
||||
// LMGs //////////////////////////////////////////////
|
||||
|
||||
class LMG_Mk200_F : Rifle_Long_Base_F {
|
||||
modes[] = {"manual", "Single", "close", "short", "medium", "far_optic1", "far_optic2"};
|
||||
|
||||
class manual : Mode_FullAuto {
|
||||
// http://www.defensereview.com/kac-stoner-lmg-belt-fed-5-56mm-nato-lightweight-light-machine-gun-squad-automatic-weapon-lmgsaw-displayed-at-sofic-2010/
|
||||
// 550 rpm
|
||||
reloadTime = 0.109;
|
||||
};
|
||||
|
||||
// Add semi-auto mode.
|
||||
// Inherit from 'manual' for sound reasons.
|
||||
class Single : manual {
|
||||
reloadTime = 0.109;
|
||||
dispersion = 0.00175; // radians. Equal to 6 MOA.
|
||||
autofire = 0;
|
||||
burst = 1;
|
||||
displayname = "Semi";
|
||||
texturetype = "semi";
|
||||
showToPlayer = 1;
|
||||
};
|
||||
};
|
||||
|
||||
class LMG_Zafir_F: Rifle_Long_Base_F {
|
||||
modes[] = {"FullAuto", "Single", "close", "short", "medium", "far_optic1", "far_optic2"};
|
||||
|
||||
class FullAuto : Mode_FullAuto {
|
||||
reloadTime = 0.070; // 850 RPM on gas position 1
|
||||
};
|
||||
};
|
||||
|
||||
// Sniper and anti-materiel rifles /////////////////////////////////
|
||||
|
||||
class EBR_base_F : Rifle_Long_Base_F {
|
||||
// EMR/EBR is typically issued semi-auto AFAIK
|
||||
modes[] = {"Single", "single_close_optics1", "single_medium_optics1", "single_far_optics1"};
|
||||
cursor = "arifle";
|
||||
};
|
||||
|
||||
class LRR_base_F : Rifle_Long_Base_F {
|
||||
cursor = "arifle";
|
||||
};
|
||||
|
||||
class GM6_base_F : Rifle_Long_Base_F {
|
||||
cursor = "arifle";
|
||||
|
||||
// Fuck your balancing, BI.
|
||||
class Single : Mode_SemiAuto {
|
||||
// 250 rpm is probably the limit of the finger on a heavy bullpup trigger like this thing must have.
|
||||
reloadTime = 0.24;
|
||||
};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////// WEAPON ATTACHMENTS ///////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
||||
class ItemCore;
|
||||
class InventoryItem_Base_F;
|
||||
class InventoryMuzzleItem_Base_F;
|
||||
class InventoryFlashLightItem_Base_F;
|
||||
|
||||
class AGM_acc_flashlight_tls: ItemCore {
|
||||
author = "$STR_A3_Bohemia_Interactive";
|
||||
_generalMacro = "AGM_acc_flashlight_tls";
|
||||
scope = 1; //2;
|
||||
displayName = "$STR_A3_cfgWeapons_acc_flashlight0";//
|
||||
descriptionUse = "$STR_A3_cfgWeapons_use_flashlight0";//
|
||||
picture = "\A3\weapons_F\Data\UI\gear_accv_flashlight_tls_ca.paa";
|
||||
model = "\A3\weapons_f\acc\accv_flashlight_TLS_F";
|
||||
descriptionShort = "$STR_A3_cfgWeapons_acc_flashlight1";//
|
||||
class ItemInfo: InventoryFlashLightItem_Base_F {
|
||||
mass = 4;
|
||||
class FlashLight {
|
||||
color[] = {180,156,120};
|
||||
ambient[] = {0.9,0.78,0.6};
|
||||
intensity = 20;
|
||||
size = 1;
|
||||
innerAngle = 20;
|
||||
outerAngle = 80;
|
||||
coneFadeCoef = 5;
|
||||
position = "flash dir";
|
||||
direction = "flash";
|
||||
useFlare = 1;
|
||||
flareSize = 1.4;
|
||||
flareMaxDistance = "100.0f";
|
||||
dayLight = 0;
|
||||
class Attenuation {
|
||||
start = 0.5;
|
||||
constant = 0;
|
||||
linear = 0;
|
||||
quadratic = 1.1;
|
||||
hardLimitStart = 20;
|
||||
hardLimitEnd = 30;
|
||||
};
|
||||
scale[] = {0};
|
||||
};
|
||||
};
|
||||
inertia = 0.1;
|
||||
};
|
||||
};
|
||||
|
||||
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
|
||||
name = #ITEM; \
|
||||
count = COUNT; \
|
||||
};
|
||||
|
||||
/*class CfgVehicles {
|
||||
class NATO_Box_Base;
|
||||
class EAST_Box_Base;
|
||||
class IND_Box_Base;
|
||||
|
||||
class Box_NATO_Support_F: NATO_Box_Base {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(AGM_acc_flashlight_tls,5)
|
||||
};
|
||||
};
|
||||
|
||||
class Box_East_Support_F: EAST_Box_Base {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(AGM_acc_flashlight_tls,5)
|
||||
};
|
||||
};
|
||||
|
||||
class Box_IND_Support_F: IND_Box_Base {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(AGM_acc_flashlight_tls,5)
|
||||
};
|
||||
};
|
||||
|
||||
class AGM_Box_Misc: Box_NATO_Support_F {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(AGM_acc_flashlight_tls,2)
|
||||
};
|
||||
};
|
||||
};*/
|
@ -1,49 +0,0 @@
|
||||
// by CAA-Picard, commy2
|
||||
|
||||
AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag = true;
|
||||
AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = "";
|
||||
AGM_WeaponSelect_CurrentGrenadeMuzzleOther = "";
|
||||
|
||||
// Collect frag and other muzzles separately
|
||||
with uiNamespace do {
|
||||
if (isNil "AGM_WeaponSelect_FragMuzzles") then {
|
||||
AGM_WeaponSelect_FragMuzzles = [];
|
||||
AGM_WeaponSelect_NonFragMuzzles = [];
|
||||
AGM_WeaponSelect_AllMuzzles = [];
|
||||
|
||||
AGM_WeaponSelect_FragMagazines = [];
|
||||
AGM_WeaponSelect_NonFragMagazines = [];
|
||||
AGM_WeaponSelect_AllMagazines = [];
|
||||
|
||||
{
|
||||
_magazines = getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines");
|
||||
_magazine = _magazines select 0;
|
||||
|
||||
_ammo = getText (configfile >> "CfgMagazines" >> _magazine >> "ammo");
|
||||
_explosive = getNumber (configfile >> "CfgAmmo" >> _ammo >> "explosive");
|
||||
|
||||
if (_explosive == 0) then {
|
||||
AGM_WeaponSelect_NonFragMuzzles pushBack _x;
|
||||
AGM_WeaponSelect_NonFragMagazines pushBack _magazines;
|
||||
} else {
|
||||
AGM_WeaponSelect_FragMuzzles pushBack _x;
|
||||
AGM_WeaponSelect_FragMagazines pushBack _magazines;
|
||||
};
|
||||
AGM_WeaponSelect_AllMuzzles pushBack _x;
|
||||
AGM_WeaponSelect_AllMagazines pushBack _magazines;
|
||||
} forEach getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles");
|
||||
};
|
||||
};
|
||||
|
||||
AGM_WeaponSelect_FragMuzzles = uiNamespace getVariable "AGM_WeaponSelect_FragMuzzles";
|
||||
AGM_WeaponSelect_NonFragMuzzles = uiNamespace getVariable "AGM_WeaponSelect_NonFragMuzzles";
|
||||
AGM_WeaponSelect_AllMuzzles = uiNamespace getVariable "AGM_WeaponSelect_AllMuzzles";
|
||||
AGM_WeaponSelect_FragMagazines = uiNamespace getVariable "AGM_WeaponSelect_FragMagazines";
|
||||
AGM_WeaponSelect_NonFragMagazines = uiNamespace getVariable "AGM_WeaponSelect_NonFragMagazines";
|
||||
AGM_WeaponSelect_AllMagazines = uiNamespace getVariable "AGM_WeaponSelect_AllMagazines";
|
||||
|
||||
//AGM_WeaponSelect_AllMuzzlesCount = count AGM_WeaponSelect_AllMuzzles;
|
||||
|
||||
// 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; //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"
|
@ -1,234 +0,0 @@
|
||||
class CfgPatches {
|
||||
class AGM_WeaponSelect {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = 0.60;
|
||||
requiredAddons[] = {AGM_Core};
|
||||
version = "0.95";
|
||||
versionStr = "0.95";
|
||||
versionAr[] = {0,95,0};
|
||||
author[] = {"commy2", "KoffeinFlummi", "CAA-Picard"};
|
||||
authorUrl = "https://github.com/commy2/";
|
||||
};
|
||||
};
|
||||
|
||||
class CfgFunctions {
|
||||
class AGM_WeaponSelect {
|
||||
class AGM_WeaponSelect {
|
||||
file = "\AGM_WeaponSelect\functions";
|
||||
class actionThrow;
|
||||
class actionThrowCondition;
|
||||
class countMagazinesForGrenadeMuzzle;
|
||||
class displayGrenadeTypeAndNumber;
|
||||
class findNextGrenadeMagazine;
|
||||
class findNextGrenadeMuzzle;
|
||||
class fireSmokeLauncher;
|
||||
class getSelectedGrenade;
|
||||
class getWeaponModes;
|
||||
class getWeaponMuzzles;
|
||||
class playChangeFiremodeSound;
|
||||
class putWeaponAway;
|
||||
class selectGrenadeAll;
|
||||
class selectGrenadeFrag;
|
||||
class selectGrenadeOther;
|
||||
class selectWeaponMode;
|
||||
class selectWeaponMuzzle;
|
||||
class selectWeaponVehicle;
|
||||
class selectMagazineVehicle;
|
||||
class setNextGrenadeMuzzle;
|
||||
class throwGrenade;
|
||||
class toggleGrenadeCount;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class AGM_WeaponSelect {
|
||||
clientInit = "call compile preprocessFileLineNumbers '\AGM_WeaponSelect\clientInit.sqf';";
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Init_EventHandlers {
|
||||
class CAManBase {
|
||||
class AGM_WeaponSelect_ThrowGrenade {
|
||||
clientInit = "_this call compile preprocessFileLineNumbers '\AGM_WeaponSelect\initActions.sqf';";
|
||||
};
|
||||
};
|
||||
};
|
||||
class Extended_Respawn_EventHandlers {
|
||||
class CAManBase {
|
||||
class AGM_WeaponSelect_ThrowGrenade {
|
||||
respawn = "[_this, ""{_this call compile preprocessFileLineNumbers '\AGM_WeaponSelect\initActions.sqf';}""] call AGM_Core_fnc_execRemoteFnc;";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_FiredBIS_EventHandlers {
|
||||
class CAManBase {
|
||||
class AGM_WeaponSelect_ThrowGrenade {
|
||||
clientFiredBIS = "if (_this select 0 == AGM_player) then {_this call AGM_WeaponSelect_fnc_throwGrenade;};";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class AGM_Core_Default_Keys {
|
||||
class selectPistol {
|
||||
displayName = "$STR_AGM_WeaponSelect_SelectPistol";
|
||||
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
|
||||
statement = "[_player, handgunWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMode";
|
||||
exceptions[] = {"AGM_Interaction_isNotEscorting"};
|
||||
key = 2;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
class selectRifle {
|
||||
displayName = "$STR_AGM_WeaponSelect_SelectRifle";
|
||||
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
|
||||
statement = "[_player, primaryWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMode";
|
||||
exceptions[] = {"AGM_Interaction_isNotEscorting"};
|
||||
key = 3;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
class selectLauncher {
|
||||
displayName = "$STR_AGM_WeaponSelect_SelectLauncher";
|
||||
condition = "_player == _vehicle";
|
||||
statement = "[_player, secondaryWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMode";
|
||||
exceptions[] = {"AGM_Interaction_isNotEscorting"};
|
||||
key = 5;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
/*class selectPistolMuzzle {
|
||||
displayName = "Select Pistol Muzzle";
|
||||
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
|
||||
statement = "[_player, handgunWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMuzzle";
|
||||
exceptions[] = {"AGM_Interaction_isNotEscorting"};
|
||||
disabled = 1;
|
||||
key = 7;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};*/
|
||||
class selectRifleMuzzle {
|
||||
displayName = "$STR_AGM_WeaponSelect_SelectRifleMuzzle";
|
||||
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
|
||||
statement = "[_player, primaryWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMuzzle";
|
||||
exceptions[] = {"AGM_Interaction_isNotEscorting"};
|
||||
key = 4;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
/*class selectLauncherMuzzle {
|
||||
displayName = "Select Launcher Muzzle";
|
||||
condition = "_player == _vehicle";
|
||||
statement = "[_player, secondaryWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMuzzle";
|
||||
exceptions[] = {"AGM_Interaction_isNotEscorting"};
|
||||
disabled = 1;
|
||||
key = 8;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};*/
|
||||
class selectBinocular {
|
||||
displayName = "$STR_AGM_WeaponSelect_SelectBinocular";
|
||||
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
|
||||
statement = "[_player, binocular _player] call AGM_WeaponSelect_fnc_selectWeaponMode";
|
||||
exceptions[] = {"AGM_Interaction_isNotEscorting"};
|
||||
key = 6;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
class selectGrenadeFrag {
|
||||
displayName = "$STR_AGM_WeaponSelect_SelectGrenadeFrag";
|
||||
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
|
||||
statement = "[_player] call AGM_WeaponSelect_fnc_selectGrenadeFrag";
|
||||
exceptions[] = {"AGM_Interaction_isNotEscorting"};
|
||||
key = 7;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
class selectGrenadeOther {
|
||||
displayName = "$STR_AGM_WeaponSelect_SelectGrenadeOther";
|
||||
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
|
||||
statement = "[_player] call AGM_WeaponSelect_fnc_selectGrenadeOther";
|
||||
exceptions[] = {"AGM_Interaction_isNotEscorting"};
|
||||
key = 8;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
class holsterWeapon {
|
||||
displayName = "$STR_AGM_WeaponSelect_HolsterWeapon";
|
||||
condition = "[_player] call AGM_Core_fnc_canUseWeapon";
|
||||
statement = "[_player] call AGM_WeaponSelect_fnc_putWeaponAway";
|
||||
exceptions[] = {"AGM_Interaction_isNotEscorting"};
|
||||
key = 11;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
|
||||
class engineOn {
|
||||
displayName = "$STR_AGM_WeaponSelect_EngineOn";
|
||||
condition = "_player != _vehicle && {_player == driver _vehicle} && {!isEngineOn _vehicle}";
|
||||
statement = "_vehicle engineOn true";
|
||||
key = 3;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
class engineOff {
|
||||
displayName = "$STR_AGM_WeaponSelect_EngineOff";
|
||||
condition = "_player != _vehicle && {_player == driver _vehicle} && {isEngineOn _vehicle}";
|
||||
statement = "_vehicle engineOn false";
|
||||
key = 2;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
|
||||
class selectMaingun {
|
||||
displayName = "$STR_AGM_WeaponSelect_SelectMainGun";
|
||||
condition = "_player != _vehicle";
|
||||
statement = "[_player, _vehicle, 0] call AGM_WeaponSelect_fnc_selectWeaponVehicle";
|
||||
key = 4;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
class selectMachineGun {
|
||||
displayName = "$STR_AGM_WeaponSelect_SelectMachineGun";
|
||||
condition = "_player != _vehicle";
|
||||
statement = "[_player, _vehicle, 1] call AGM_WeaponSelect_fnc_selectWeaponVehicle";
|
||||
key = 5;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
class selectMissile {
|
||||
displayName = "$STR_AGM_WeaponSelect_SelectMissiles";
|
||||
condition = "_player != _vehicle";
|
||||
statement = "[_player, _vehicle, 2] call AGM_WeaponSelect_fnc_selectWeaponVehicle";
|
||||
key = 6;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
|
||||
class fireSmokeLauncher {
|
||||
displayName = "$STR_AGM_WeaponSelect_FireSmokeLauncher";
|
||||
condition = "_player != _vehicle && {_player == commander _vehicle}";
|
||||
statement = "[_vehicle] call AGM_WeaponSelect_fnc_fireSmokeLauncher";
|
||||
key = 10;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
};
|
@ -1,4 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
_text = [localize "STR_AGM_WeaponSelect_NoGrenadeSelected", [1,0,0]] call AGM_Core_fnc_stringToColoredText;
|
||||
[composeText [lineBreak, _text]] call AGM_Core_fnc_displayTextStructured;
|
@ -1,32 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
_muzzle = call AGM_WeaponSelect_fnc_getSelectedGrenade;
|
||||
|
||||
_isInput = inputAction "CycleThrownItems" > 0;
|
||||
if !(_isInput isEqualTo (missionNamespace getVariable ["AGM_WeaponSelect_CycleThrownItemsState", false])) then {
|
||||
if (_isInput) then {
|
||||
if (_muzzle == "") then {
|
||||
[_this select 1] spawn AGM_WeaponSelect_fnc_selectGrenadeAll;
|
||||
} else {
|
||||
[_this select 1] spawn AGM_WeaponSelect_fnc_selectGrenadeAll;//
|
||||
};
|
||||
};
|
||||
AGM_WeaponSelect_CycleThrownItemsState = _isInput;
|
||||
};
|
||||
|
||||
if !([_this select 1] call AGM_Core_fnc_canUseWeapon) exitWith {false};
|
||||
|
||||
if (_muzzle == "") exitWith {["All"] call AGM_WeaponSelect_fnc_findNextGrenadeMagazine != ""};
|
||||
|
||||
// fix auto muzzle swap after entering or leaving a vehicle
|
||||
if (_this select 0 != missionNamespace getVariable ["AGM_WeaponSelect_CurrentGrenadeMuzzleVehicle", objNull]) then {
|
||||
[_this select 1, _muzzle] call AGM_WeaponSelect_fnc_setNextGrenadeMuzzle;
|
||||
AGM_WeaponSelect_CurrentGrenadeMuzzleVehicle = _this select 0;
|
||||
};
|
||||
|
||||
if ((_this select 1) ammo _muzzle == 0) exitWith {
|
||||
if (AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag) then {AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = ""} else {AGM_WeaponSelect_CurrentGrenadeMuzzleOther = ""};
|
||||
[uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
|
||||
true
|
||||
};
|
||||
false
|
@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Author: CAA-Picard
|
||||
*
|
||||
* Count how many grenade magazines the unit has on the uniform and vest.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Muzzle name
|
||||
*
|
||||
* Return value:
|
||||
* 0: Number of magazines
|
||||
* 1: First magazine name
|
||||
*/
|
||||
|
||||
private ["_player", "_muzzle"];
|
||||
|
||||
_player = _this select 0;
|
||||
_muzzle = _this select 1;
|
||||
|
||||
_uniformMags = getMagazineCargo uniformContainer _player;
|
||||
_vestMags = getMagazineCargo vestContainer _player;
|
||||
_backPackMags = getMagazineCargo backpackContainer _player;
|
||||
|
||||
_numberOfMagazines = 0;
|
||||
_magazineClasses = getArray (configFile >> "CfgWeapons" >> "Throw" >> _muzzle >> "magazines" );
|
||||
_firstMagazine = _magazineClasses select 0;
|
||||
{
|
||||
_indexInUniform = (_uniformMags select 0) find _x;
|
||||
if (_indexInUniform > -1) then {
|
||||
_numberOfMagazines = _numberOfMagazines + ((_uniformMags select 1) select _indexInUniform);
|
||||
_firstMagazine = _x;
|
||||
};
|
||||
_indexInVest = (_vestMags select 0) find _x;
|
||||
if (_indexInVest > -1) then {
|
||||
_numberOfMagazines = _numberOfMagazines + ((_vestMags select 1) select _indexInVest);
|
||||
_firstMagazine = _x;
|
||||
};
|
||||
_indexInBackpack = (_backpackMags select 0) find _x;
|
||||
if (_indexInBackpack > -1) then {
|
||||
_numberOfMagazines = _numberOfMagazines + ((_backpackMags select 1) select _indexInBackpack);
|
||||
_firstMagazine = _x;
|
||||
};
|
||||
} forEach _magazineClasses;
|
||||
|
||||
[_numberOfMagazines, _firstMagazine]
|
@ -1,32 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private ["_scope", "_allMags", "_allMuzzles", "_magazines", "_start", "_index", "_nextMagazine"];
|
||||
|
||||
_scope = _this select 0; //"All", "Frag" or "NonFrag"
|
||||
|
||||
_allMags = missionNamespace getVariable [format ["AGM_WeaponSelect_%1Magazines", _scope], []];
|
||||
_allMuzzles = missionNamespace getVariable [format ["AGM_WeaponSelect_%1Muzzles", _scope], []];
|
||||
|
||||
_magazines = magazines AGM_player;
|
||||
|
||||
_start = [AGM_WeaponSelect_CurrentGrenadeMuzzleOther, AGM_WeaponSelect_CurrentGrenadeMuzzleFrag] select AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag;
|
||||
_index = _allMuzzles find _start;
|
||||
|
||||
scopeName "SearchMain";
|
||||
|
||||
_nextMagazine = "";
|
||||
for "_index" from (_index + 1) to (count _allMuzzles - 1) do {
|
||||
{
|
||||
if (_x in (_allMags select _index)) exitWith {_nextMagazine = _x; breakTo "SearchMain"};
|
||||
} count _magazines;
|
||||
};
|
||||
|
||||
if (_nextMagazine != "") exitWith {_nextMagazine};
|
||||
|
||||
for "_index" from 0 to _index do {
|
||||
{
|
||||
if (_x in (_allMags select _index)) exitWith {_nextMagazine = _x; breakTo "SearchMain"};
|
||||
} count _magazines;
|
||||
};
|
||||
|
||||
_nextMagazine
|
@ -1,32 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private ["_scope", "_allMags", "_allMuzzles", "_magazines", "_start", "_index", "_nextMuzzle"];
|
||||
|
||||
_scope = _this select 0; //"All", "Frag" or "NonFrag"
|
||||
|
||||
_allMags = missionNamespace getVariable [format ["AGM_WeaponSelect_%1Magazines", _scope], []];
|
||||
_allMuzzles = missionNamespace getVariable [format ["AGM_WeaponSelect_%1Muzzles", _scope], []];
|
||||
|
||||
_magazines = magazines AGM_player;
|
||||
|
||||
_start = [AGM_WeaponSelect_CurrentGrenadeMuzzleOther, AGM_WeaponSelect_CurrentGrenadeMuzzleFrag] select AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag;
|
||||
_index = _allMuzzles find _start;
|
||||
|
||||
scopeName "SearchMain";
|
||||
|
||||
_nextMuzzle = "";
|
||||
for "_index" from (_index + 1) to (count _allMuzzles - 1) do {
|
||||
{
|
||||
if (_x in (_allMags select _index)) exitWith {_nextMuzzle = _allMuzzles select _index; breakTo "SearchMain"};
|
||||
} count _magazines;
|
||||
};
|
||||
|
||||
if (_nextMuzzle != "") exitWith {_nextMuzzle};
|
||||
|
||||
for "_index" from 0 to _index do {
|
||||
{
|
||||
if (_x in (_allMags select _index)) exitWith {_nextMuzzle = _allMuzzles select _index; breakTo "SearchMain"};
|
||||
} count _magazines;
|
||||
};
|
||||
|
||||
_nextMuzzle
|
@ -1,37 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private ["_vehicle", "_turret", "_weapons"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
|
||||
_turret = [typeOf _vehicle] call AGM_Core_fnc_getTurretCommander;
|
||||
|
||||
_weapons = _vehicle weaponsTurret _turret;
|
||||
|
||||
if (
|
||||
count _weapons > 1
|
||||
|| {count _weapons > 0 && {!(_weapons select 0 in ["SmokeLauncher", "BWA3_SmokeLauncher"])}} // @todo somebody might use custom smoke launcher weapons aswell, maybe ...
|
||||
) then {
|
||||
//This doesn't work reliably for vehilces with additional weapons for the commander. Select smoke launcher instead.
|
||||
|
||||
private "_index";
|
||||
|
||||
// avoid infinite loop
|
||||
if !("SmokeLauncher" in _weapons) exitWith {};
|
||||
|
||||
_index = 0;
|
||||
while {
|
||||
_vehicle currentWeaponTurret _turret != "SmokeLauncher"
|
||||
} do {
|
||||
[commander _vehicle, _vehicle, _index] call AGM_WeaponSelect_fnc_selectWeaponVehicle;
|
||||
_index = _index + 1;
|
||||
};
|
||||
} else {
|
||||
// fire away!
|
||||
|
||||
private "_logic";
|
||||
|
||||
_logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"];
|
||||
_logic action ["useWeapon", _vehicle, commander _vehicle, 0];
|
||||
deleteVehicle _logic;
|
||||
};
|
@ -1,3 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
[AGM_WeaponSelect_CurrentGrenadeMuzzleOther, AGM_WeaponSelect_CurrentGrenadeMuzzleFrag] select AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag
|
@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Author: CAA-Picard, commy2
|
||||
*
|
||||
* Cycle through all grenades.
|
||||
*
|
||||
* Argument:
|
||||
* None
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
|
||||
private ["_player", "_nextMuzzle"];
|
||||
|
||||
_player = _this select 0;
|
||||
|
||||
_nextMuzzle = ["All"] call AGM_WeaponSelect_fnc_findNextGrenadeMuzzle;
|
||||
|
||||
if (_nextMuzzle != "") then {
|
||||
|
||||
|
||||
private ["_magazines", "_magazine", "_count", "_return"];
|
||||
_magazines = AGM_WeaponSelect_AllMagazines select (AGM_WeaponSelect_AllMuzzles find _nextMuzzle);
|
||||
reverse _magazines;
|
||||
|
||||
_magazine = "";
|
||||
_count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _player;
|
||||
|
||||
// There is a muzzle with magazines --> cycle to it
|
||||
[_player, _nextMuzzle] call AGM_WeaponSelect_fnc_setNextGrenadeMuzzle;
|
||||
|
||||
[_magazine, _count] call AGM_WeaponSelect_fnc_displayGrenadeTypeAndNumber;
|
||||
|
||||
[uiNamespace getVariable "AGM_dlgSoldier", true] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
|
||||
} else {
|
||||
// There is a no muzzle with magazines --> select nothing
|
||||
AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = ""; AGM_WeaponSelect_CurrentGrenadeMuzzleOther = "";
|
||||
|
||||
_text = [localize "STR_AGM_WeaponSelect_NoGrenadesLeft", [1,0,0]] call AGM_Core_fnc_stringToColoredText;
|
||||
[composeText [lineBreak, _text]] call AGM_Core_fnc_displayTextStructured;
|
||||
|
||||
[uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
|
||||
};
|
||||
|
||||
if (_nextMuzzle in AGM_WeaponSelect_FragMuzzles) then {
|
||||
AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = _nextMuzzle;
|
||||
AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag = true;
|
||||
} else {
|
||||
AGM_WeaponSelect_CurrentGrenadeMuzzleOther = _nextMuzzle;
|
||||
AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag = false;
|
||||
};
|
@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Author: CAA-Picard, commy2
|
||||
*
|
||||
* Cycle through frags.
|
||||
*
|
||||
* Argument:
|
||||
* None
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
|
||||
private ["_player", "_nextMuzzle"];
|
||||
|
||||
_player = _this select 0;
|
||||
|
||||
_nextMuzzle = ["Frag"] call AGM_WeaponSelect_fnc_findNextGrenadeMuzzle;
|
||||
|
||||
if (_nextMuzzle != "") then {
|
||||
AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = _nextMuzzle;
|
||||
|
||||
private ["_magazines", "_magazine", "_count", "_return"];
|
||||
_magazines = AGM_WeaponSelect_FragMagazines select (AGM_WeaponSelect_FragMuzzles find _nextMuzzle);
|
||||
reverse _magazines;
|
||||
|
||||
_magazine = "";
|
||||
_count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _player;
|
||||
|
||||
// There is a muzzle with magazines --> cycle to it
|
||||
[_player, _nextMuzzle] call AGM_WeaponSelect_fnc_setNextGrenadeMuzzle;
|
||||
|
||||
[_magazine, _count] call AGM_WeaponSelect_fnc_displayGrenadeTypeAndNumber;
|
||||
|
||||
[uiNamespace getVariable "AGM_dlgSoldier", true] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
|
||||
} else {
|
||||
// There is a no muzzle with magazines --> select nothing
|
||||
AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = "";
|
||||
|
||||
_text = [localize "STR_AGM_WeaponSelect_NoFragsLeft", [1,0,0]] call AGM_Core_fnc_stringToColoredText;
|
||||
[composeText [lineBreak, _text]] call AGM_Core_fnc_displayTextStructured;
|
||||
|
||||
[uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
|
||||
};
|
||||
|
||||
AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag = true;
|
@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Author: CAA-Picard, commy2
|
||||
*
|
||||
* Cycle through non explosive grenades.
|
||||
*
|
||||
* Argument:
|
||||
* None
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
|
||||
private ["_player", "_nextMuzzle"];
|
||||
|
||||
_player = _this select 0;
|
||||
|
||||
_nextMuzzle = ["NonFrag"] call AGM_WeaponSelect_fnc_findNextGrenadeMuzzle;
|
||||
|
||||
if (_nextMuzzle != "") then {
|
||||
AGM_WeaponSelect_CurrentGrenadeMuzzleOther = _nextMuzzle;
|
||||
|
||||
private ["_magazines", "_magazine", "_count", "_return"];
|
||||
_magazines = AGM_WeaponSelect_NonFragMagazines select (AGM_WeaponSelect_NonFragMuzzles find _nextMuzzle);
|
||||
reverse _magazines;
|
||||
|
||||
_magazine = "";
|
||||
_count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _player;
|
||||
|
||||
// There is a muzzle with magazines --> cycle to it
|
||||
[_player, _nextMuzzle] call AGM_WeaponSelect_fnc_setNextGrenadeMuzzle;
|
||||
|
||||
[_magazine, _count] call AGM_WeaponSelect_fnc_displayGrenadeTypeAndNumber;
|
||||
|
||||
[uiNamespace getVariable "AGM_dlgSoldier", true] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
|
||||
} else {
|
||||
// There is a no muzzle with magazines --> select nothing
|
||||
AGM_WeaponSelect_CurrentGrenadeMuzzleOther = "";
|
||||
|
||||
_text = [localize "STR_AGM_WeaponSelect_NoMiscGrenadeLeft", [1,0,0]] call AGM_Core_fnc_stringToColoredText;
|
||||
[composeText [lineBreak, _text]] call AGM_Core_fnc_displayTextStructured;
|
||||
|
||||
[uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
|
||||
};
|
||||
|
||||
AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag = false;
|
@ -1,52 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private ["_vehicle", "_index", "_turret", "_weapon", "_magazine"];
|
||||
|
||||
_vehicle = _this select 0;
|
||||
_index = _this select 1;
|
||||
|
||||
_turret = [player] call AGM_Core_fnc_getTurretIndex;
|
||||
|
||||
/* WIP
|
||||
|
||||
|
||||
|
||||
_weapon = currentWeapon _vehicle;
|
||||
|
||||
|
||||
_weapons = _vehicle weaponsTurret _turret;
|
||||
_magazines = _vehicle magazinesTurret _turret;
|
||||
|
||||
|
||||
|
||||
|
||||
vehicle player loadMagazine [[0], "cannon_120mm", "32Rnd_120mm_APFSDS_shells_Tracer_Red"]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
["cannon_105mm","LMG_M200"]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
vehicle player loadMagazine [[0,0], "SmokeLauncher", "SmokeLauncherMag"]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
player action ["SwitchMagazine", vehicle player, player, 1];
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* The player will select the specified weapon or will change to the next firing mode if the weapon was already selected.
|
||||
*
|
||||
* Argument:
|
||||
* 0: A weapon (String)
|
||||
*
|
||||
* Return value:
|
||||
* None.
|
||||
*/
|
||||
|
||||
private ["_player", "_weapon", "_muzzles", "_modes", "_count", "_index", "_muzzle", "_mode"];
|
||||
|
||||
_player = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
|
||||
if (_weapon == "") exitWith {};
|
||||
|
||||
if (currentWeapon _player != _weapon) exitWith {
|
||||
_player selectWeapon _weapon;
|
||||
};
|
||||
|
||||
// unlock safety
|
||||
if (_weapon in (_player getVariable ["AGM_SafeMode_safedWeapons", []])) exitWith {
|
||||
[_player, _weapon, _weapon] call AGM_SafeMode_fnc_unlockSafety;
|
||||
};
|
||||
|
||||
_muzzles = [_weapon] call AGM_WeaponSelect_fnc_getWeaponMuzzles;
|
||||
_modes = [_weapon] call AGM_WeaponSelect_fnc_getWeaponModes;
|
||||
|
||||
_count = count _modes;
|
||||
_index = (_modes find currentWeaponMode _player) + 1;
|
||||
if (_index > _count - 1) then {_index = 0};
|
||||
|
||||
_muzzle = _muzzles select 0;
|
||||
_mode = _modes select _index;
|
||||
|
||||
_index = 0;
|
||||
while {
|
||||
_index < 100 && {currentMuzzle _player != _muzzle || {currentWeaponMode _player != _mode}}
|
||||
} do {
|
||||
_player action ["SwitchWeapon", _player, _player, _index];
|
||||
_index = _index + 1;
|
||||
};
|
||||
|
||||
// play fire mode selector sound
|
||||
[_player, _weapon] call AGM_WeaponSelect_fnc_playChangeFiremodeSound;
|
@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* The player will select the specified weapon and change to the first additional muzzle. E.g. the grenade launcher of a assault rifle.
|
||||
*
|
||||
* Argument:
|
||||
* 0: A weapon (String)
|
||||
*
|
||||
* Return value:
|
||||
* None.
|
||||
*/
|
||||
|
||||
private ["_player", "_weapon", "_muzzles", "_count", "_index", "_muzzle"];
|
||||
|
||||
_player = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
|
||||
if (_weapon == "") exitWith {};
|
||||
|
||||
_muzzles = [_weapon] call AGM_WeaponSelect_fnc_getWeaponMuzzles;
|
||||
|
||||
if (currentWeapon _player != _weapon) exitWith {
|
||||
if (count _muzzles > 1) then {
|
||||
|
||||
// unlock safety
|
||||
/*if (_weapon in (_player getVariable ["AGM_SafeMode_safedWeapons", []])) exitWith {
|
||||
[_player, _weapon, _muzzles select 1] call AGM_SafeMode_fnc_unlockSafety;
|
||||
};*/
|
||||
|
||||
_player selectWeapon (_muzzles select 1);
|
||||
};
|
||||
};
|
||||
|
||||
_count = count _muzzles;
|
||||
_index = (_muzzles find currentMuzzle _player) + 1;
|
||||
if (_index > _count - 1) then {_index = 1};
|
||||
|
||||
_muzzle = _muzzles select _index;
|
||||
|
||||
_index = 0;
|
||||
while {
|
||||
_index < 100 && {currentMuzzle _player != _muzzle}
|
||||
} do {
|
||||
_player action ["SwitchWeapon", _player, _player, _index];
|
||||
_index = _index + 1;
|
||||
};
|
@ -1,37 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private ["_player", "_vehicle", "_index", "_turret", "_weapons", "_weapon"];
|
||||
|
||||
_player = _this select 0;
|
||||
_vehicle = _this select 1;
|
||||
_index = _this select 2;
|
||||
|
||||
_turret = [_player] call AGM_Core_fnc_getTurretIndex;
|
||||
|
||||
if (_turret isEqualTo [] && {_player == driver _vehicle}) then {
|
||||
_weapons = weapons _vehicle;
|
||||
if (_index > count _weapons - 1) exitWith {};
|
||||
|
||||
_weapon = _weapons select _index;
|
||||
|
||||
_index = 0;
|
||||
while {
|
||||
_index < 100 && {currentWeapon _vehicle != _weapon}
|
||||
} do {
|
||||
_player action ["SwitchWeapon", _vehicle, _player, _index];
|
||||
_index = _index + 1;
|
||||
};
|
||||
} else {
|
||||
_weapons = _vehicle weaponsTurret _turret;
|
||||
if (_index > count _weapons - 1) exitWith {};
|
||||
|
||||
_weapon = _weapons select _index;
|
||||
|
||||
_index = 0;
|
||||
while {
|
||||
_index < 100 && {_vehicle currentWeaponTurret _turret != _weapon}
|
||||
} do {
|
||||
_player action ["SwitchWeapon", _vehicle, _player, _index];
|
||||
_index = _index + 1;
|
||||
};
|
||||
};
|
@ -1,100 +0,0 @@
|
||||
/*
|
||||
* Author: CAA-Picard
|
||||
*
|
||||
* Select the next grenade muzzle to throw.
|
||||
*
|
||||
* Argument:
|
||||
* muzzle name
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
*/
|
||||
|
||||
private ["_player", "_muzzle"];
|
||||
|
||||
_player = _this select 0;
|
||||
_muzzle = _this select 1;
|
||||
|
||||
_uniformMags = getMagazineCargo uniformContainer _player;
|
||||
_vestMags = getMagazineCargo vestContainer _player;
|
||||
_backPackMags = getMagazineCargo backpackContainer _player;
|
||||
|
||||
_uniformMagsToRemove = [];
|
||||
_vestMagsToRemove = [];
|
||||
_backPackMagsToRemove = [];
|
||||
|
||||
_firstMagazine = "";
|
||||
|
||||
// Collect which magazines to remove
|
||||
_throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles");
|
||||
{
|
||||
_muzzleName = _x;
|
||||
_muzzleMagazines = getArray (configFile >> "CfgWeapons" >> "Throw" >> _muzzleName >> "magazines" );
|
||||
if (_muzzle != _muzzleName) then {
|
||||
{
|
||||
_index = (_uniformMags select 0) find _x;
|
||||
if (_index > -1) then {
|
||||
_uniformMagsToRemove = _uniformMagsToRemove + [[_x, (_uniformMags select 1) select _index]];
|
||||
};
|
||||
_index = (_vestMags select 0) find _x;
|
||||
if (_index > -1) then {
|
||||
_vestMagsToRemove = _vestMagsToRemove + [[_x, (_vestMags select 1) select _index]];
|
||||
};
|
||||
_index = (_backpackMags select 0) find _x;
|
||||
if (_index > -1) then {
|
||||
_backpackMagsToRemove = _backpackMagsToRemove + [[_x, (_backpackMags select 1) select _index]];
|
||||
};
|
||||
} forEach _muzzleMagazines;
|
||||
} else {
|
||||
{
|
||||
_index = (_uniformMags select 0) find _x;
|
||||
if (_index > -1) then {
|
||||
_firstMagazine = _x;
|
||||
};
|
||||
_index = (_vestMags select 0) find _x;
|
||||
if (_index > -1) then {
|
||||
_firstMagazine = _x;
|
||||
};
|
||||
_index = (_backpackMags select 0) find _x;
|
||||
if (_index > -1) then {
|
||||
_firstMagazine = _x;
|
||||
};
|
||||
} forEach _muzzleMagazines;
|
||||
};
|
||||
} forEach _throwMuzzleNames;
|
||||
|
||||
// Remove all magazines except those we are switching to --> this breaks the selector
|
||||
{
|
||||
for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do {
|
||||
_player removeItem (_x select 0);
|
||||
};
|
||||
} forEach _uniformMagsToRemove;
|
||||
{
|
||||
for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do {
|
||||
_player removeItem (_x select 0);
|
||||
};
|
||||
} forEach _vestMagsToRemove;
|
||||
{
|
||||
for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do {
|
||||
_player removeItem (_x select 0);
|
||||
};
|
||||
} forEach _backPackMagsToRemove;
|
||||
|
||||
// Readd magazines
|
||||
{
|
||||
for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do {
|
||||
_player addItemToUniform (_x select 0);
|
||||
};
|
||||
} forEach _uniformMagsToRemove;
|
||||
{
|
||||
for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do {
|
||||
_player addItemToVest (_x select 0);
|
||||
};
|
||||
} forEach _vestMagsToRemove;
|
||||
{
|
||||
for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do {
|
||||
_player addItemToBackpack (_x select 0);
|
||||
};
|
||||
} forEach _backPackMagsToRemove;
|
||||
|
@ -1,19 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private ["_unit", "_weapon", "_magazine"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
_magazine = _this select 5;
|
||||
|
||||
if (_weapon != "Throw") exitWith {};
|
||||
|
||||
private "_count";
|
||||
_count = {_x == _magazine} count magazines _unit;
|
||||
|
||||
[_magazine, _count] call AGM_WeaponSelect_fnc_displayGrenadeTypeAndNumber;
|
||||
|
||||
if (_count == 0) then {
|
||||
if (AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag) then {AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = ""} else {AGM_WeaponSelect_CurrentGrenadeMuzzleOther = ""};
|
||||
[uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount;
|
||||
};
|
@ -1,23 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private ["_dlg", "_show"];
|
||||
|
||||
_dlg = _this select 0;
|
||||
_show = _this select 1;
|
||||
|
||||
if (_show) then {
|
||||
private "_config";
|
||||
|
||||
_config = configFile >> "RscInGameUI" >> "RscUnitInfo" >> "WeaponInfoControlsGroupLeft" >> "controls" >> "CA_GrenadeCount";
|
||||
(_dlg displayCtrl 151) ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")];
|
||||
|
||||
_config = configFile >> "RscInGameUI" >> "RscUnitInfo" >> "WeaponInfoControlsGroupLeft" >> "controls" >> "CA_GrenadeType";
|
||||
(_dlg displayCtrl 152) ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")];
|
||||
|
||||
} else {
|
||||
(_dlg displayCtrl 151) ctrlSetPosition [0,0,0,0];
|
||||
(_dlg displayCtrl 152) ctrlSetPosition [0,0,0,0];
|
||||
};
|
||||
|
||||
(_dlg displayCtrl 151) ctrlCommit 0;
|
||||
(_dlg displayCtrl 152) ctrlCommit 0;
|
@ -1,25 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private ["_unit", "_id"];
|
||||
|
||||
_unit = _this select 0;
|
||||
|
||||
/*_id = [
|
||||
_unit,
|
||||
format ["<t color=""#FFFFFF"" >%1</t>", localize "STR_AGM_WeaponSelect_ReadyGrenade"],
|
||||
"Throw",
|
||||
AGM_WeaponSelect_fnc_actionThrowCondition,
|
||||
AGM_WeaponSelect_fnc_actionThrow,
|
||||
{true},
|
||||
{[_this select 1] call AGM_WeaponSelect_fnc_selectGrenadeAll},
|
||||
2
|
||||
] call AGM_Core_fnc_addActionMenuEventHandler;*/
|
||||
|
||||
_id = [
|
||||
_unit,
|
||||
"Throw",
|
||||
AGM_WeaponSelect_fnc_actionThrowCondition,
|
||||
AGM_WeaponSelect_fnc_actionThrow
|
||||
] call AGM_Core_fnc_addActionEventHandler;
|
||||
|
||||
_unit setVariable ["AGM_WeaponSelect_ThrowActionID", _id];
|
@ -4,13 +4,11 @@ class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {"ACE_IR_Strobe_Item"};
|
||||
requiredVersion = 0.60;
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common", "ace_interaction"};
|
||||
version = "0.95";
|
||||
versionStr = "0.95";
|
||||
versionAr[] = {0,95,0};
|
||||
author[] = {"KoffeinFlummi", "eRazeri", "CAA-Picard"};
|
||||
authorUrl = "https://github.com/KoffeinFlummi/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -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 {};
|
||||
@ -100,6 +99,14 @@ GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex);
|
||||
["playerVisionModeChanged", [ACE_player, _newPlayerVisionMode]] call FUNC(localEvent);
|
||||
};
|
||||
|
||||
// "inventoryDisplayChanged" event
|
||||
_newInventoryDisplayIsOpen = !(isNull findDisplay 602);
|
||||
if !(_newInventoryDisplayIsOpen isEqualTo GVAR(OldInventoryDisplayIsOpen)) then {
|
||||
// Raise ACE event locally
|
||||
GVAR(OldInventoryDisplayIsOpen) = _newInventoryDisplayIsOpen;
|
||||
["inventoryDisplayChanged", [ACE_player, _newInventoryDisplayIsOpen]] call FUNC(localEvent);
|
||||
};
|
||||
|
||||
// "zeusDisplayChanged" event
|
||||
_newZeusDisplayIsOpen = !(isNull findDisplay 312);
|
||||
if !(_newZeusDisplayIsOpen isEqualTo GVAR(OldZeusDisplayIsOpen)) then {
|
||||
|
@ -31,6 +31,7 @@ PREP(displayTextPicture);
|
||||
PREP(displayTextStructured);
|
||||
PREP(doAnimation);
|
||||
PREP(endRadioTransmission);
|
||||
PREP(execNextFrame);
|
||||
PREP(execPersistentFnc);
|
||||
PREP(execRemoteFnc);
|
||||
PREP(executePersistent);
|
||||
@ -119,6 +120,7 @@ PREP(toBitmask);
|
||||
PREP(toHex);
|
||||
PREP(toNumber);
|
||||
PREP(unmuteUnit);
|
||||
PREP(waitAndExecute);
|
||||
|
||||
// ACE_Debug
|
||||
PREP(exportConfig);
|
||||
|
34
addons/common/functions/fnc_execNextFrame.sqf
Normal file
34
addons/common/functions/fnc_execNextFrame.sqf
Normal file
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Author: CAA-Picard
|
||||
*
|
||||
* Executes a code on the next frame
|
||||
*
|
||||
* Argument:
|
||||
* 0: Code to execute (Code)
|
||||
* 1: Parameters to run the code with (Array)
|
||||
*
|
||||
* Return value:
|
||||
* PFH handler ID
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_2_PVT(_this,_func,_params);
|
||||
|
||||
[
|
||||
{
|
||||
EXPLODE_2_PVT(_this,_params,_pfhId);
|
||||
EXPLODE_2_PVT(_params,_delayedExecParams,_startFrame);
|
||||
EXPLODE_2_PVT(_delayedExecParams,_func,_funcParams);
|
||||
|
||||
// Exit if we are still on the same frame
|
||||
if (diag_frameno == _startFrame) exitWith {};
|
||||
|
||||
// Remove the PFH
|
||||
[_pfhId] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
// Execute the function
|
||||
_funcParams call _func;
|
||||
},
|
||||
_interval,
|
||||
[_this, diag_frameno]
|
||||
] call CBA_fnc_addPerFrameHandler
|
36
addons/common/functions/fnc_waitAndExecute.sqf
Normal file
36
addons/common/functions/fnc_waitAndExecute.sqf
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Author: CAA-Picard
|
||||
*
|
||||
* Executes a code once with a given game time delay, using a PFH
|
||||
*
|
||||
* Argument:
|
||||
* 0: Code to execute (Code)
|
||||
* 1: Parameters to run the code with (Array)
|
||||
* 2: Delay in seconds before executing the code (Number)
|
||||
* 3: Interval of time in which the execution is evaluated, 0 means every frame (Number)
|
||||
*
|
||||
* Return value:
|
||||
* PFH handler ID
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_4_PVT(_this,_func,_params,_delay,_interval);
|
||||
|
||||
[
|
||||
{
|
||||
EXPLODE_2_PVT(_this,_params,_pfhId);
|
||||
EXPLODE_2_PVT(_params,_delayedExecParams,_startTime);
|
||||
EXPLODE_3_PVT(_delayedExecParams,_func,_funcParams,_delay);
|
||||
|
||||
// Exit if the time was not reached yet
|
||||
if (time < _startTime + _delay) exitWith {};
|
||||
|
||||
// Remove the PFH
|
||||
[_pfhId] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
// Execute the function
|
||||
_funcParams call _func;
|
||||
},
|
||||
_interval,
|
||||
[_this, time]
|
||||
] call CBA_fnc_addPerFrameHandler
|
1
addons/difficulties/$PBOPREFIX$
Normal file
1
addons/difficulties/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\difficulties
|
33
addons/difficulties/CfgDifficulties.hpp
Normal file
33
addons/difficulties/CfgDifficulties.hpp
Normal file
@ -0,0 +1,33 @@
|
||||
|
||||
class CfgDifficulties {
|
||||
class Mercenary {
|
||||
class Flags {
|
||||
armor[] = {0,0};
|
||||
friendlyTag[] = {0,0};
|
||||
enemyTag[] = {0,0};
|
||||
mineTag[] = {0,0};
|
||||
hud[] = {0,1};//{1,1};
|
||||
hudPerm[] = {0,0};
|
||||
hudWp[] = {0,0};
|
||||
hudWpPerm[] = {0,0};
|
||||
autoSpot[] = {0,1};
|
||||
map[] = {0,0};
|
||||
weaponCursor[] = {0,1};//{1,1};
|
||||
autoGuideAT[] = {0,0};
|
||||
clockIndicator[] = {0,0};
|
||||
3rdPersonView[] = {0,0};
|
||||
autoAim[] = {0,0};
|
||||
unlimitedSaves[] = {0,0};
|
||||
deathMessages[] = {0,1};//{1,1};
|
||||
netStats[] = {0,1};//{1,1};
|
||||
vonID[] = {0,1};
|
||||
cameraShake[] = {1,0};
|
||||
hudGroupInfo[] = {0,0};
|
||||
extendetInfoType[] = {0,0};
|
||||
roughLanding[] = {0,0};
|
||||
windEnabled[] = {1,0};
|
||||
autoTrimEnabled[] = {0,0};
|
||||
stressDamageEnabled[] = {1,0};
|
||||
};
|
||||
};
|
||||
};
|
15
addons/difficulties/config.cpp
Normal file
15
addons/difficulties/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 "CfgDifficulties.hpp"
|
12
addons/difficulties/script_component.hpp
Normal file
12
addons/difficulties/script_component.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
#define COMPONENT difficulties
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_DIFFICULTIES
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_ENABLED_DIFFICULTIES
|
||||
#define DEBUG_SETTINGS DEBUG_ENABLED_DIFFICULTIES
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
@ -4,11 +4,11 @@ class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = 0.60;
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"commy2"};
|
||||
authorUrl = "https://github.com/commy2/";
|
||||
// VERSION_CONFIG @todo
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -4,13 +4,11 @@ class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {"ACE_Clacker", "ACE_DefusalKit", "ACE_M26_Clacker", "ACE_DeadManSwitch"};
|
||||
requiredVersion = 0.60;
|
||||
requiredAddons[] = {ace_common, ace_interaction};
|
||||
version = QUOTE(VERSION);
|
||||
versionStr = QUOTE(VERSION);
|
||||
versionAr[] = {VERSION_AR};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common", "ace_interaction"};
|
||||
author[] = {"Garth 'L-H' de Wet"};
|
||||
authorUrl = "http://garth.snakebiteink.co.za/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -16,22 +16,12 @@
|
||||
[_explosive, 10] call ACE_Explosives_fnc_startTimer;
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_2_PVT(_this,_explosive,_delay);
|
||||
|
||||
[{
|
||||
private ["_explosive", "_params", "_pfhId", "_placeTime", "_fuseTime"];
|
||||
_params = _this select 0;
|
||||
_pfhId = _this select 1;
|
||||
|
||||
_placeTime = _params select 1;
|
||||
_fuseTime = _params select 0 select 1;
|
||||
|
||||
// Skip first execution
|
||||
if (diag_tickTime < _placeTime + _fuseTime / 2) exitWith {};
|
||||
|
||||
_explosive = (_params select 0) select 0;
|
||||
_explosive = _this;
|
||||
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;
|
||||
}, _explosive, _delay, 0] call EFUNC(common,waitAndExecute);
|
@ -3,3 +3,76 @@
|
||||
GVAR(enabled) = True;
|
||||
GVAR(time) = 0;
|
||||
GVAR(position) = [0,0,0];
|
||||
|
||||
// Add keybinds
|
||||
["ACE3",
|
||||
localize "STR_ACE_FCS_LaseTarget",
|
||||
{
|
||||
// Conditions: canInteract
|
||||
_exceptions = [];
|
||||
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
||||
// Conditions: specific
|
||||
if !(!GVAR(enabled) && {call FUNC(canUseRangefinder) || FUNC(canUseFCS)}) exitWith {false};
|
||||
|
||||
// Statement
|
||||
[vehicle ACE_player] call FUNC(keyDown);
|
||||
true
|
||||
},
|
||||
[15, [false, false, false]],
|
||||
false,
|
||||
"keydown"
|
||||
] call cba_fnc_registerKeybind;
|
||||
|
||||
["ACE3",
|
||||
localize "STR_ACE_FCS_LaseTarget",
|
||||
{
|
||||
// Conditions: canInteract
|
||||
_exceptions = [];
|
||||
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
||||
// Conditions: specific
|
||||
if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false};
|
||||
|
||||
// Statement
|
||||
[vehicle ACE_player] call FUNC(keyUp);
|
||||
true
|
||||
},
|
||||
[15, [false, false, false]],
|
||||
false,
|
||||
"keyup"
|
||||
] call cba_fnc_registerKeybind;
|
||||
|
||||
["ACE3",
|
||||
localize "STR_ACE_FCS_AdjustRangeUp",
|
||||
{
|
||||
// Conditions: canInteract
|
||||
_exceptions = [];
|
||||
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
||||
// Conditions: specific
|
||||
if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
|
||||
|
||||
// Statement
|
||||
[vehicle ACE_player, 50] call FUNC(adjustRange);
|
||||
true
|
||||
},
|
||||
[201, [false, false, false]],
|
||||
false,
|
||||
"keydown"
|
||||
] call cba_fnc_registerKeybind;
|
||||
|
||||
["ACE3",
|
||||
localize "STR_ACE_FCS_AdjustRangeDown",
|
||||
{
|
||||
// Conditions: canInteract
|
||||
_exceptions = [];
|
||||
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
||||
// Conditions: specific
|
||||
if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false};
|
||||
|
||||
// Statement
|
||||
[vehicle ACE_player, -50] call FUNC(adjustRange);
|
||||
true
|
||||
},
|
||||
[209, [false, false, false]],
|
||||
false,
|
||||
"keydown"
|
||||
] call cba_fnc_registerKeybind;
|
||||
|
@ -4,47 +4,16 @@ class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = 0.60;
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {ace_common, ace_interaction};
|
||||
version = QUOTE(VERSION);
|
||||
versionStr = QUOTE(VERSION);
|
||||
versionAr[] = {VERSION_AR};
|
||||
author[] = {"KoffeinFlummi","BadGuy (simon84)"};
|
||||
authorUrl = "https://github.com/KoffeinFlummi/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
|
||||
class ACE_Default_Keys {
|
||||
class laseTarget {
|
||||
displayName = $STR_ACE_FCS_LaseTarget;
|
||||
condition = QUOTE(call FUNC(canUseRangefinder) || FUNC(canUseFCS));
|
||||
statement = QUOTE([_vehicle] call FUNC(keyDown));
|
||||
conditionUp = QUOTE(GVAR(enabled) && FUNC(canUseFCS));
|
||||
statementUp = QUOTE([_vehicle] call FUNC(keyUp));
|
||||
key = 15;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
};
|
||||
class adjustRangeUp {
|
||||
displayName = $STR_ACE_FCS_AdjustRangeUp;
|
||||
condition = QUOTE(call FUNC(canUseRangefinder) || FUNC(canUseFCS));
|
||||
statement = QUOTE([_vehicle, 50] call FUNC(adjustRange));
|
||||
key = 201;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
allowHolding = 1;
|
||||
};
|
||||
class adjustRangeDown: adjustRangeUp {
|
||||
displayName = $STR_ACE_FCS_AdjustRangeDown;
|
||||
statement = QUOTE([_vehicle, -50] call FUNC(adjustRange));
|
||||
key = 209;
|
||||
};
|
||||
};
|
||||
|
||||
class CfgVehicles {
|
||||
class All {
|
||||
class Turrets;
|
||||
|
@ -17,8 +17,6 @@ private ["_ammoType", "_viewDiff", "_posArrival", "_airFriction", "_timeToLive",
|
||||
_vehicle = _this select 0;
|
||||
_distance = call FUNC(getRange);
|
||||
|
||||
if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {};
|
||||
|
||||
_magazines = magazines _vehicle;
|
||||
|
||||
if (_distance == 0) then {
|
||||
|
@ -5,8 +5,8 @@ class CfgPatches {
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = { "A3_Misc_F", "A3_Weapons_F" };
|
||||
version = VERSION;
|
||||
author[] = {"Nou"};
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
|
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"
|
91
addons/gforces/functions/fnc_pfhUpdateGForces.sqf
Normal file
91
addons/gforces/functions/fnc_pfhUpdateGForces.sqf
Normal file
@ -0,0 +1,91 @@
|
||||
// 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 {};
|
||||
|
||||
if (isNull ACE_player) exitWith {};
|
||||
|
||||
if !(alive ACE_player) 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"
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user