mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #271 from KoffeinFlummi/142resting
1.42 - Remove scripted weapon resting
This commit is contained in:
commit
3de3432664
@ -1,43 +0,0 @@
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit) );
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_FiredBis_EventHandlers {
|
||||
class CAManBase {
|
||||
class ADDON {
|
||||
clientFiredBis = QUOTE(if (_this select 0 == ACE_player) then {_this call FUNC(camShake); _this call FUNC(burstDispersion);};);
|
||||
};
|
||||
};
|
||||
class Tank {
|
||||
class ADDON {
|
||||
clientFiredBis = QUOTE(if (_this select 0 == vehicle ACE_player) then {_this call FUNC(camShake);};);
|
||||
};
|
||||
};
|
||||
class Car {
|
||||
class ADDON {
|
||||
clientFiredBis = QUOTE(if (_this select 0 == vehicle ACE_player) then {_this call FUNC(camShake);};);
|
||||
};
|
||||
};
|
||||
class Helicopter {
|
||||
class ADDON {
|
||||
clientFiredBis = QUOTE(if (_this select 0 == vehicle ACE_player) then {_this call FUNC(camShake);};);
|
||||
};
|
||||
};
|
||||
class Plane {
|
||||
class ADDON {
|
||||
clientFiredBis = QUOTE(if (_this select 0 == vehicle ACE_player) then {_this call FUNC(camShake);};);
|
||||
};
|
||||
};
|
||||
class Ship_F {
|
||||
class ADDON {
|
||||
clientFiredBis = QUOTE(if (_this select 0 == vehicle ACE_player) then {_this call FUNC(camShake);};);
|
||||
};
|
||||
};
|
||||
class StaticWeapon {
|
||||
class ADDON {
|
||||
clientFiredBis = QUOTE(if (_this select 0 == vehicle ACE_player) then {_this call FUNC(camShake);};);
|
||||
};
|
||||
};
|
||||
};
|
@ -1,8 +0,0 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(burstDispersion);
|
||||
PREP(camShake);
|
||||
|
||||
ADDON = true;
|
@ -6,14 +6,12 @@ class CfgPatches {
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"KoffeinFlummi", "TaoSensai", "commy2"};
|
||||
author[] = {"KoffeinFlummi","TaoSensai","commy2"};
|
||||
authorUrl = "https://github.com/Taosenai/tmr";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
|
||||
// DOC: http://forums.bistudio.com/showthread.php?94464-explaining-the-cfgRecoils-array
|
||||
class CfgRecoils {
|
||||
#define KICKBACK 0.07
|
||||
@ -114,17 +112,18 @@ class CfgRecoils {
|
||||
recoil_single_titan[] = {0,0,0};
|
||||
};
|
||||
|
||||
class CfgCameraShake {
|
||||
/*class CfgCameraShake {
|
||||
// Seems to be ignored by Arma
|
||||
defaultCaliberCoefWeaponFire = 0;
|
||||
};
|
||||
};*/
|
||||
|
||||
// Completely disable BI's camshake on fire.
|
||||
class CfgMovesBasic {
|
||||
/*class CfgMovesBasic {
|
||||
class Default {
|
||||
camShakeFire = 0;
|
||||
};
|
||||
};
|
||||
|
||||
class CfgMovesMaleSdr : CfgMovesBasic {
|
||||
class States {
|
||||
class AmovPercMstpSlowWrflDnon;
|
||||
@ -183,128 +182,4 @@ class CfgMovesMaleSdr : CfgMovesBasic {
|
||||
camShakeFire = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// Ammo
|
||||
class CfgAmmo {
|
||||
class MissileCore;
|
||||
class MissileBase: MissileCore {
|
||||
GVAR(shakeMultiplier) = 2;
|
||||
};
|
||||
|
||||
class BombCore;
|
||||
class LaserBombCore: BombCore {
|
||||
GVAR(shakeMultiplier) = 2;
|
||||
};
|
||||
class Bo_Mk82: BombCore {
|
||||
GVAR(shakeMultiplier) = 2;
|
||||
};
|
||||
|
||||
class RocketCore;
|
||||
class ArtilleryRocketCore: RocketCore {
|
||||
GVAR(shakeMultiplier) = 1.4;
|
||||
};
|
||||
class RocketBase: RocketCore {
|
||||
GVAR(shakeMultiplier) = 1.4;
|
||||
};
|
||||
|
||||
class BulletCore;
|
||||
class BulletBase: BulletCore {
|
||||
GVAR(shakeMultiplier) = 1;
|
||||
};
|
||||
|
||||
class ShotgunCore;
|
||||
class ShotgunBase: ShotgunCore {
|
||||
GVAR(shakeMultiplier) = 1.1;
|
||||
};
|
||||
|
||||
class ShellCore;
|
||||
class ShellBase: ShellCore {
|
||||
GVAR(shakeMultiplier) = 3;
|
||||
};
|
||||
|
||||
class SubmunitionCore;
|
||||
class SubmunitionBase: SubmunitionCore {
|
||||
GVAR(shakeMultiplier) = 3;
|
||||
};
|
||||
|
||||
class ShotDeployCore;
|
||||
class ShotDeployBase: ShotDeployCore {
|
||||
GVAR(shakeMultiplier) = 3;
|
||||
};
|
||||
};
|
||||
|
||||
// Weapons
|
||||
// 1. Set the recoil profiles for all fire modes.
|
||||
// 2. Set the shake multiplier. This determines the camshake for the weapon.
|
||||
// Ex: GVAR(shakeMultiplier) = 1; (disabled currently)
|
||||
|
||||
class CfgWeapons {
|
||||
class CannonCore;
|
||||
class autocannon_Base_F: CannonCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
class autocannon_35mm: CannonCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
class cannon_120mm: CannonCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
class mortar_155mm_AMOS: CannonCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
class mortar_82mm: CannonCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
|
||||
// No camshake for gatlings
|
||||
class gatling_20mm: CannonCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
class gatling_25mm: CannonCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
class gatling_30mm: CannonCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
|
||||
class MGunCore;
|
||||
class MGun: MGunCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
// No camshake for smoke launchers
|
||||
class SmokeLauncher: MGun {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
|
||||
// No camshake for coax machine guns
|
||||
class LMG_RCWS;
|
||||
class LMG_M200: LMG_RCWS {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
class LMG_coax: LMG_RCWS {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
class LMG_Minigun: LMG_RCWS {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
};
|
||||
|
||||
// Vehicles
|
||||
class CfgVehicles {
|
||||
class LandVehicle;
|
||||
class Tank: LandVehicle {
|
||||
GVAR(enableCamshake) = 1;
|
||||
};
|
||||
class Car: LandVehicle {
|
||||
GVAR(enableCamshake) = 1;
|
||||
};
|
||||
class StaticWeapon: LandVehicle {
|
||||
GVAR(enableCamshake) = 1;
|
||||
};
|
||||
|
||||
class Allvehicles;
|
||||
class Air: Allvehicles {
|
||||
GVAR(enableCamshake) = 1;
|
||||
};
|
||||
};
|
||||
};*/
|
||||
|
@ -1,62 +0,0 @@
|
||||
// TMR: Small Arms - Recoil initialization and functions
|
||||
// (C) 2013 Ryan Schultz. See LICENSE.
|
||||
// Edited for compatability in ACE by KoffeinFlummi
|
||||
// Edited by commy2
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_weapon", "_projectile"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
_projectile = _this select 6;
|
||||
|
||||
if (_weapon in ["Throw", "Put"]) exitWith {};
|
||||
|
||||
private ["_lastFired", "_burst"];
|
||||
|
||||
_lastFired = _unit getVariable [QUOTE(GVAR(lastFired)), -1];
|
||||
_burst = _unit getVariable [QUOTE(GVAR(burst)), 0];
|
||||
|
||||
if (time - _lastFired < 0.45) then {
|
||||
private "_startDisperse";
|
||||
_burst = _burst + 1;
|
||||
_unit setVariable [QUOTE(GVAR(burst)), _burst, false];
|
||||
|
||||
_startDisperse = [1, 3] select (cameraView == "GUNNER");
|
||||
|
||||
if (_burst > _startDisperse) then {
|
||||
// Reset burst size for calcs
|
||||
_burst = _burst - _startDisperse;
|
||||
|
||||
// Increase dispersion cap if player is not using sights
|
||||
_sightsBurst = [30, 0] select (cameraView == "GUNNER");
|
||||
|
||||
// Increase initial dispersion and cap if player is moving
|
||||
if (speed _unit > 0.5) then {
|
||||
_sightsBurst = 25;
|
||||
_burst = _burst + 15;
|
||||
};
|
||||
|
||||
// Maximum possible dispersion (without _sightsBurst mod)
|
||||
_maxBurst = 50;
|
||||
|
||||
if (_unit getVariable [QUOTE(EGVAR(resting,weaponRested)), false]) then {_maxBurst = 25};
|
||||
if (_unit getVariable [QUOTE(EGVAR(resting,bipodDeployed)), false]) then {_maxBurst = 18};
|
||||
|
||||
// Cap the dispersion
|
||||
_burst = (_burst min _maxBurst) + _sightsBurst;
|
||||
|
||||
// Add random variance
|
||||
_elevAngle = (_burst / 300) - random (_burst / 300) * 2;
|
||||
_travAngle = (_burst / 260) - random (_burst / 260) * 2;
|
||||
|
||||
[_projectile, _travAngle, _elevAngle] call EFUNC(common,changeProjectileDirection);
|
||||
};
|
||||
} else {
|
||||
|
||||
// Long enough delay, reset burst
|
||||
_unit setVariable [QUOTE(GVAR(burst)), 0, false];
|
||||
};
|
||||
|
||||
_unit setVariable [QUOTE(GVAR(lastFired)), time, false];
|
@ -1,61 +0,0 @@
|
||||
// TMR: Small Arms - Recoil initialization and functions
|
||||
// (C) 2013 Ryan Schultz. See LICENSE.
|
||||
// Edited for compatability in ACE by KoffeinFlummi
|
||||
// Edited by commy2
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define BASE_POWER 0.40
|
||||
#define BASE_TIME 0.19
|
||||
#define BASE_FREQ 13
|
||||
#define RECOIL_COEF 40
|
||||
|
||||
private ["_unit", "_weapon", "_muzzle", "_ammo"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
_muzzle = _this select 2;
|
||||
_ammo = _this select 4;
|
||||
|
||||
if (_weapon in [handgunWeapon _unit, "Throw", "Put"]) exitWith {};
|
||||
|
||||
private ["_powerMod", "_timeMod", "_freqMod", "_powerCoef"];
|
||||
|
||||
_powerMod = ([0, -0.1, -0.1, 0, -0.2] select (["STAND", "CROUCH", "PRONE", "UNDEFINED", ""] find stance _unit)) + ([0, -1, 0, -1] select (["INTERNAL", "EXTERNAL", "GUNNER", "GROUP"] find cameraView));
|
||||
_timeMod = 0;
|
||||
_freqMod = 0;
|
||||
|
||||
_powerCoef = 0;
|
||||
if (_unit != vehicle _unit) then {
|
||||
_powerCoef = getNumber (configFile >> "CfgWeapons" >> _weapon >> QUOTE(GVAR(shakeMultiplier)));
|
||||
_powerCoef = _powerCoef * getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(GVAR(shakeMultiplier)));
|
||||
} else {
|
||||
private ["_type", "_config", "_recoil"];
|
||||
|
||||
_type = ["recoil", "recoilProne"] select (stance _unit == "PRONE");
|
||||
|
||||
_config = configFile >> "CfgWeapons" >> _weapon;
|
||||
_recoil = if (_muzzle == _weapon) then {
|
||||
getText (_config >> _type)
|
||||
} else {
|
||||
getText (_config >> _muzzle >> _type)
|
||||
};
|
||||
|
||||
_recoil = getArray (configFile >> "CfgRecoils" >> _recoil);
|
||||
if (count _recoil < 2) exitWith {};
|
||||
|
||||
_powerCoef = _recoil select 1;
|
||||
_powerCoef = (call compile format ["%1", _powerCoef]) * RECOIL_COEF;
|
||||
};
|
||||
|
||||
if (_unit getVariable [QUOTE(EGVAR(resting,weaponRested)), false]) then {_powerMod = _powerMod - 0.07};
|
||||
if (_unit getVariable [QUOTE(EGVAR(resting,bipodDeployed)), false]) then {_powerMod = _powerMod - 0.11};
|
||||
|
||||
private "_camshake";
|
||||
_camshake = [
|
||||
_powerCoef * (BASE_POWER + _powerMod) max 0,
|
||||
BASE_TIME + _timeMod max 0,
|
||||
BASE_FREQ + _freqMod max 0
|
||||
];
|
||||
|
||||
addCamShake _camshake;
|
@ -1,12 +0,0 @@
|
||||
#define COMPONENT recoil
|
||||
#include "\z\ace\Addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_RECOIL
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_RECOIL
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_RECOIL
|
||||
#endif
|
||||
|
||||
#include "\z\ace\Addons\main\script_macros.hpp"
|
@ -1 +0,0 @@
|
||||
z\ace\addons\resting
|
@ -1,12 +0,0 @@
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE( call COMPILE_FILE(XEH_postInit) );
|
||||
};
|
||||
};
|
File diff suppressed because it is too large
Load Diff
@ -1,14 +0,0 @@
|
||||
class CfgSounds {
|
||||
class GVAR(rest)
|
||||
{
|
||||
name=QGVAR(rest);
|
||||
sound[]={QUOTE(PATHTOF(sounds\weaponrest_rest.wav)),1,1};
|
||||
titles[]={};
|
||||
};
|
||||
class GVAR(unrest)
|
||||
{
|
||||
name=QGVAR(unrest);
|
||||
sound[]={QUOTE(PATHTOF(sounds\weaponrest_unrest.wav)),1,1};
|
||||
titles[]={};
|
||||
};
|
||||
};
|
@ -1,22 +0,0 @@
|
||||
class CfgWeapons {
|
||||
class Rifle_Long_Base_F;
|
||||
class arifle_MX_Base_F;
|
||||
|
||||
class arifle_MX_SW_F : arifle_MX_Base_F {
|
||||
ACE_Bipod = 1;
|
||||
};
|
||||
|
||||
class LMG_Mk200_F : Rifle_Long_Base_F {
|
||||
ACE_Bipod = 1;
|
||||
};
|
||||
class LMG_Zafir_F: Rifle_Long_Base_F {
|
||||
ACE_Bipod = 1;
|
||||
};
|
||||
|
||||
class LRR_base_F : Rifle_Long_Base_F {
|
||||
ACE_Bipod = 1;
|
||||
};
|
||||
class GM6_base_F : Rifle_Long_Base_F {
|
||||
ACE_Bipod = 1;
|
||||
};
|
||||
};
|
@ -1,12 +0,0 @@
|
||||
ace_resting
|
||||
===========
|
||||
|
||||
Introduces weapon resting and bipod deployment, allowing the player to increase the stability of his weapon.
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
The people responsible for merging changes to this component or answering potential questions.
|
||||
|
||||
- [KoffeinFlummi](https://github.com/KoffeinFlummi)
|
||||
- [commy2](https://github.com/commy2)
|
@ -1,23 +0,0 @@
|
||||
// by esteldunedain
|
||||
#include "script_component.hpp"
|
||||
|
||||
if !(hasInterface) exitWith {};
|
||||
|
||||
// Add keybinds
|
||||
["ACE3", QGVAR(RestWeapon), localize "STR_ACE_Resting_RestWeapon",
|
||||
{
|
||||
// Conditions: canInteract
|
||||
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
// Conditions: specific
|
||||
if !([ACE_player] call EFUNC(common,canUseWeapon) &&
|
||||
{inputAction 'reloadMagazine' == 0} &&
|
||||
{!weaponLowered ACE_player} &&
|
||||
{speed ACE_player < 1}) exitWith {false};
|
||||
|
||||
// Statement
|
||||
[ACE_player, vehicle ACE_player, currentWeapon ACE_player] call FUNC(restWeapon);
|
||||
// Return false so it doesn't block other actions
|
||||
false
|
||||
},
|
||||
{false},
|
||||
[15, [false, false, false]], false] call cba_fnc_addKeybind;
|
@ -1,11 +0,0 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(getIntersection);
|
||||
PREP(hasBipod);
|
||||
PREP(pfhCheckRest);
|
||||
PREP(restWeapon);
|
||||
PREP(unRestWeapon);
|
||||
|
||||
ADDON = true;
|
@ -1,21 +0,0 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"KoffeinFlummi", "TaoSensai", "esteldunedain"};
|
||||
authorUrl = "https://github.com/KoffeinFlummi/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
|
||||
#include "CfgWeapons.hpp"
|
||||
|
||||
#include "CfgMoves.hpp"
|
||||
|
||||
#include "CfgSounds.hpp"
|
Binary file not shown.
@ -1,70 +0,0 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi, edited by commy2 and esteldunedain
|
||||
*
|
||||
* Prepares intersects
|
||||
*
|
||||
* Arguments:
|
||||
* 0: unit
|
||||
* 1: vehicle
|
||||
* 2: weapon
|
||||
*
|
||||
* Return Values:
|
||||
* [_intersectsMiddle, _intersectsLeft, _intersectsRight, _intersectsDown]
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_3_PVT(_this,_unit,_vehicle,_weapon);
|
||||
|
||||
private ["_weaponPos", "_weaponDir", "_weaponPosDown"];
|
||||
|
||||
_weaponPos = ATLtoASL (_unit modelToWorldVisual (_unit selectionPosition "RightHand"));
|
||||
_weaponDir = _unit weaponDirection _weapon;
|
||||
_weaponPosDown = _weaponPos vectorAdd [0,0,-MAXHEIGHT];
|
||||
|
||||
private ["_checkPosMiddle", "_checkPosLeft", "_checkPosRight", "_checkPosDown"];
|
||||
|
||||
_checkPosMiddle = [
|
||||
(_weaponPos select 0) + MAXDISTANCE * (_weaponDir select 0),
|
||||
(_weaponPos select 1) + MAXDISTANCE * (_weaponDir select 1),
|
||||
(_weaponPos select 2) + MAXDISTANCE * (_weaponDir select 2)
|
||||
];
|
||||
_checkPosLeft = [
|
||||
(_weaponPos select 0) + MAXDISTANCE * sin (((_weaponDir select 0) atan2 (_weaponDir select 1)) + 360 - MAXANGLE),
|
||||
(_weaponPos select 1) + MAXDISTANCE * cos (((_weaponDir select 0) atan2 (_weaponDir select 1)) + 360 - MAXANGLE),
|
||||
(_weaponPos select 2) + MAXDISTANCE * (_weaponDir select 2)
|
||||
];
|
||||
_checkPosRight = [
|
||||
(_weaponPos select 0) + MAXDISTANCE * sin (((_weaponDir select 0) atan2 (_weaponDir select 1)) + MAXANGLE),
|
||||
(_weaponPos select 1) + MAXDISTANCE * cos (((_weaponDir select 0) atan2 (_weaponDir select 1)) + MAXANGLE),
|
||||
(_weaponPos select 2) + MAXDISTANCE * (_weaponDir select 2)
|
||||
];
|
||||
_checkPosDown = [
|
||||
(_weaponPos select 0) + MAXDISTANCE * (_weaponDir select 0),
|
||||
(_weaponPos select 1) + MAXDISTANCE * (_weaponDir select 1),
|
||||
(_weaponPos select 2) + MAXDISTANCE * (_weaponDir select 2) - MAXHEIGHT
|
||||
];
|
||||
|
||||
/* UNCOMMENT THIS FOR DEBUGGING
|
||||
weaponPos = ASLtoATL _weaponPos;
|
||||
weaponPosDown = ASLtoATL _weaponPosDown;
|
||||
checkPosMiddle = ASLtoATL _checkPosMiddle;
|
||||
checkPosLeft = ASLtoATL _checkPosLeft;
|
||||
checkPosRight = ASLtoATL _checkPosRight;
|
||||
checkPosDown = ASLtoATL _checkPosDown;
|
||||
|
||||
onEachFrame {
|
||||
drawLine3D [weaponPos, checkPosMiddle, [1,0,0,1]];
|
||||
drawLine3D [weaponPos, checkPosLeft, [1,0,0,1]];
|
||||
drawLine3D [weaponPos, checkPosRight, [1,0,0,1]];
|
||||
drawLine3D [weaponPosDown, checkPosDown, [1,0,0,1]];
|
||||
};*/
|
||||
|
||||
private ["_intersectsMiddle", "_intersectsLeft", "_intersectsRight", "_intersectsDown"];
|
||||
|
||||
_intersectsMiddle = lineIntersects [_weaponPos, _checkPosMiddle];
|
||||
_intersectsLeft = lineIntersects [_weaponPos, _checkPosLeft];
|
||||
_intersectsRight = lineIntersects [_weaponPos, _checkPosRight];
|
||||
_intersectsDown = lineIntersects [_weaponPos, _checkPosDown] || {terrainIntersectASL [_weaponPosDown, _checkPosDown]};
|
||||
|
||||
[_intersectsMiddle, _intersectsLeft, _intersectsRight, _intersectsDown]
|
@ -1,22 +0,0 @@
|
||||
/*
|
||||
* Author: Commy2
|
||||
*
|
||||
* Check if the weapon has a bipod
|
||||
*
|
||||
* Arguments:
|
||||
* 0: weapon
|
||||
*
|
||||
* Return Values:
|
||||
* Boolean
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_1_PVT(_this,_weapon);
|
||||
|
||||
private ["_config"];
|
||||
_config = configFile >> "CfgWeapons" >> _weapon;
|
||||
|
||||
getNumber (_config >> "ACE_Bipod") == 1 ||
|
||||
getNumber (_config >> "AGM_Bipod") == 1 ||
|
||||
{getNumber (_config >> "tmr_autorest_deployable") == 1}
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi, edited by commy2 and esteldunedain
|
||||
*
|
||||
* PFH that check for player moving away, changing weapon, etc
|
||||
* and unrests the weapon if necessary
|
||||
*
|
||||
* Arguments:
|
||||
* 0: unit
|
||||
* 1: vehicle
|
||||
* 2: weapon
|
||||
* 3: rested position
|
||||
*
|
||||
* Return Values:
|
||||
* None
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_2_PVT(_this,_params,_pfhId);
|
||||
EXPLODE_4_PVT(_params,_unit,_vehicle,_weapon,_restedPosition);
|
||||
|
||||
if !(_unit getVariable ["ACE_weaponRested", false]) exitWith {
|
||||
[_pfhId] call cba_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
private ["_intersects"];
|
||||
_intersects = _params call FUNC(getIntersection);
|
||||
|
||||
if (
|
||||
_unit != ACE_player
|
||||
|| {_vehicle != vehicle _unit}
|
||||
|| {inputAction "reloadMagazine" != 0}
|
||||
|| {weaponLowered _unit}
|
||||
|| {speed _unit > 1}
|
||||
|| {currentWeapon _unit != _weapon}
|
||||
|| {getPosASL _unit distanceSqr _restedPosition > 1}
|
||||
|| {!(true in _intersects)}
|
||||
) exitWith {
|
||||
[_pfhId] call cba_fnc_removePerFrameHandler;
|
||||
[_unit, _vehicle, _weapon] call FUNC(unRestWeapon);
|
||||
};
|
@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi, edited by commy2 and esteldunedain
|
||||
*
|
||||
* Rests the player's weapon if possible.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Values:
|
||||
* None
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_3_PVT(_this,_unit,_vehicle,_weapon);
|
||||
|
||||
if (_weapon != primaryWeapon _unit) exitWith {};
|
||||
|
||||
if (_unit getVariable ["ACE_weaponRested", false]) exitWith {_this call FUNC(unRestWeapon)};
|
||||
|
||||
// exit if this is not an available animation
|
||||
if (!isClass (configFile >> "CfgMovesMaleSdr" >> "States" >> format ["%1_ace_deploy", animationState _unit])) exitWith {};
|
||||
|
||||
// CHECK FOR APPROPRIATE SURFACE
|
||||
private "_intersects";
|
||||
_intersects = _this call FUNC(getIntersection);
|
||||
|
||||
if (true in _intersects) then {
|
||||
_unit setVariable ["ACE_weaponRested", true];
|
||||
if (_unit == ACE_PLAYER) then {
|
||||
[QGVAR(bipodDeployed), true, QUOTE(PATHTOF(data\icons\icon_bipod.paa)), [1,1,1,1], -1] call EFUNC(common,displayIcon);
|
||||
};
|
||||
|
||||
private "_restedPosition";
|
||||
_restedPosition = getPosASL _unit;
|
||||
|
||||
// REST THE WEAPON
|
||||
addCamShake CAMSHAKE;
|
||||
playSound QGVAR(rest);
|
||||
|
||||
if ([_weapon] call FUNC(hasBipod) && {_intersects select 3}) then {
|
||||
_unit setVariable ["ACE_bipodDeployed", true];
|
||||
|
||||
_unit setUnitRecoilCoefficient (BIPODRECOIL * unitRecoilCoefficient _unit);
|
||||
//[_unit, format ["%1_ace_deploy", animationState _unit], 2] call EFUNC(common,doAnimation);
|
||||
_unit switchMove format ["%1_ace_deploy", animationState _unit];
|
||||
|
||||
private "_picture";
|
||||
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
[localize "STR_ACE_Resting_BipodDeployed", _picture] call EFUNC(common,displayTextPicture);
|
||||
|
||||
} else {
|
||||
_unit setVariable ["ACE_bipodDeployed", false];
|
||||
|
||||
_unit setUnitRecoilCoefficient (RESTEDRECOIL * unitRecoilCoefficient _unit);
|
||||
//[_unit, format ["%1_ace_rested", animationState _unit], 2] call EFUNC(common,doAnimation);
|
||||
_unit switchMove format ["%1_ace_rested", animationState _unit];
|
||||
|
||||
private "_picture";
|
||||
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
[localize "STR_ACE_Resting_WeaponRested", _picture] call EFUNC(common,displayTextPicture);
|
||||
};
|
||||
|
||||
// Launch a PFH to check for player moving away, changing weapon, etc
|
||||
[FUNC(pfhCheckRest), 0.2, [_unit, _vehicle, _weapon, _restedPosition] ] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi, edited by commy2 and esteldunedain
|
||||
*
|
||||
* Un Rests the player's weapon
|
||||
*
|
||||
* Arguments:
|
||||
* 0: unit
|
||||
* 1: vehicle
|
||||
* 2: weapon
|
||||
*
|
||||
* Return Values:
|
||||
* None
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_3_PVT(_this,_unit,_vehicle,_weapon);
|
||||
|
||||
addCamShake CAMSHAKE;
|
||||
|
||||
private "_animation";
|
||||
_animation = animationState _unit;
|
||||
|
||||
if (_unit getVariable ["ACE_bipodDeployed", false]) then {
|
||||
_unit setUnitRecoilCoefficient (unitRecoilCoefficient _unit / BIPODRECOIL);
|
||||
if (_animation find "_ace_deploy" != -1) then {
|
||||
//[_unit, [_animation, "_ace_deploy", ""] call CBA_fnc_replace, 2] call EFUNC(common,doAnimation);
|
||||
_unit switchMove ([_animation, "_ace_deploy", ""] call CBA_fnc_replace);
|
||||
};
|
||||
|
||||
private "_picture";
|
||||
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
[localize "STR_ACE_Resting_BipodUndeployed", _picture] call EFUNC(common,displayTextPicture);
|
||||
|
||||
} else {
|
||||
_unit setUnitRecoilCoefficient (unitRecoilCoefficient _unit / RESTEDRECOIL);
|
||||
if (_animation find "_ace_rested" != -1) then {
|
||||
//[_unit, [_animation, "_ace_rested", ""] call CBA_fnc_replace, 2] call EFUNC(common,doAnimation);
|
||||
_unit switchMove ([_animation, "_ace_rested", ""] call CBA_fnc_replace);
|
||||
};
|
||||
|
||||
private "_picture";
|
||||
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
[localize "STR_ACE_Resting_WeaponLifted", _picture] call EFUNC(common,displayTextPicture);
|
||||
};
|
||||
playSound QGVAR(unrest);
|
||||
|
||||
_unit setVariable ["ACE_weaponRested", false];
|
||||
_unit setVariable ["ACE_bipodDeployed", false];
|
||||
|
||||
if (_unit == ACE_PLAYER) then {
|
||||
[QGVAR(bipodDeployed), false, "", [1,1,1,1], -1] call EFUNC(common,displayIcon);
|
||||
};
|
@ -1 +0,0 @@
|
||||
#include "\z\ace\addons\resting\script_component.hpp"
|
@ -1,19 +0,0 @@
|
||||
#define COMPONENT resting
|
||||
#include "\z\ace\Addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_RESTING
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_RESTING
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_RESTING
|
||||
#endif
|
||||
|
||||
#include "\z\ace\Addons\main\script_macros.hpp"
|
||||
|
||||
#define RESTEDRECOIL 0.6
|
||||
#define BIPODRECOIL 0.3
|
||||
#define MAXDISTANCE 1
|
||||
#define MAXANGLE 15
|
||||
#define MAXHEIGHT 0.45
|
||||
#define CAMSHAKE [1,0.5,5]
|
Binary file not shown.
Binary file not shown.
@ -1,69 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="Resting">
|
||||
|
||||
<Key ID="STR_ACE_Resting_RestWeapon">
|
||||
<English>Rest Weapon</English>
|
||||
<German>Waffe auflegen</German>
|
||||
<Spanish>Apoyar el arma</Spanish>
|
||||
<Polish>Oprzyj broń</Polish>
|
||||
<Czech>Zapřít zbraň</Czech>
|
||||
<French>Appuyer l'arme</French>
|
||||
<Russian>Зафиксировать оружие</Russian>
|
||||
<Hungarian>Fegyver kitámasztása</Hungarian>
|
||||
<Portuguese>Apoiar Arma</Portuguese>
|
||||
<Italian>Appoggia l'arma</Italian>
|
||||
</Key>
|
||||
|
||||
<Key ID="STR_ACE_Resting_BipodDeployed">
|
||||
<English>Bipod deployed</English>
|
||||
<German>Zweibein ausgeklappt</German>
|
||||
<Spanish>Bípode desplegado</Spanish>
|
||||
<Polish>Dwójnóg rozstawiony</Polish>
|
||||
<Czech>Dvojnožka rozložena</Czech>
|
||||
<French>Bipied déployé</French>
|
||||
<Russian>Сошки установлены</Russian>
|
||||
<Hungarian>Állványon</Hungarian>
|
||||
<Portuguese>Bipé apoiado</Portuguese>
|
||||
<Italian>Bipiede appoggiato</Italian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Resting_WeaponRested">
|
||||
<English>Weapon rested</English>
|
||||
<German>Waffe aufgelegt</German>
|
||||
<Spanish>Arma apoyada</Spanish>
|
||||
<Polish>Broń oparta</Polish>
|
||||
<Czech>Zbraň zapřena</Czech>
|
||||
<French>Arme appuyée</French>
|
||||
<Russian>Оружие зафиксировано</Russian>
|
||||
<Hungarian>Fegyver kitámasztva</Hungarian>
|
||||
<Portuguese>Arma apoiada</Portuguese>
|
||||
<Italian>Arma appoggiata</Italian>
|
||||
</Key>
|
||||
|
||||
<Key ID="STR_ACE_Resting_BipodUndeployed">
|
||||
<English>Bipod undeployed</English>
|
||||
<German>Zweibein eingeklappt</German>
|
||||
<Spanish>Bípode plegado</Spanish>
|
||||
<Polish>Dwójnóg złożony</Polish>
|
||||
<Czech>Dvojnožka rozložena</Czech>
|
||||
<French>Bipied replié</French>
|
||||
<Russian>Сошки убраны</Russian>
|
||||
<Hungarian>Állvány csukva</Hungarian>
|
||||
<Portuguese>Bipé recolhido</Portuguese>
|
||||
<Italian>Bipiede richiuso</Italian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Resting_WeaponLifted">
|
||||
<English>Weapon lifted</English>
|
||||
<German>Waffe gehoben</German>
|
||||
<Spanish>Arma levantada</Spanish>
|
||||
<Polish>Broń podniesiona</Polish>
|
||||
<Czech>Zbraň zdvihnuta</Czech>
|
||||
<French>Arme relevée</French>
|
||||
<Russian>Оружие не зафиксировано</Russian>
|
||||
<Hungarian>Fegyver nincs támasztva</Hungarian>
|
||||
<Portuguese>Arma levantada</Portuguese>
|
||||
<Italian>Arma sollevata</Italian>
|
||||
</Key>
|
||||
|
||||
</Package>
|
||||
</Project>
|
Loading…
Reference in New Issue
Block a user