remove scripted recoil

This commit is contained in:
commy2 2015-04-04 20:02:02 +02:00
parent 8d0ee2d578
commit 55d7c0f0e6
6 changed files with 6 additions and 317 deletions

View File

@ -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);};);
};
};
};

View File

@ -1,8 +0,0 @@
#include "script_component.hpp"
ADDON = false;
PREP(burstDispersion);
PREP(camShake);
ADDON = true;

View File

@ -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;
};
};
};*/

View File

@ -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 (isWeaponRested _unit) then {_maxBurst = 25};
if (isWeaponDeployed _unit) 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];

View File

@ -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 (isWeaponRested _unit) then {_powerMod = _powerMod - 0.07};
if (isWeaponDeployed _unit) 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;

View File

@ -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"