CfgRecoils – ArmA: Armed Assault

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Some wiki formatting)
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:
'''Recoil sample'''
'''Recoil sample'''


class cfgRecoils
<syntaxhighlight lang="cpp">
{
class cfgRecoils
  class my_awesome_recoil
{
  {             //  x    y    a    b
class my_awesome_recoil
  muzzleOuter[] = { 0.3, 1.0, 0.3, 0.2 };
{
  kickBack[] = { 0.03, 0.06 };
muzzleOuter[] = { 0.3, 1.0, 0.3, 0.2 }; // x, y, a, b
  permanent = 0.1;
kickBack[] = { 0.03, 0.06 };
  temporary = 0.01;
permanent = 0.1;
  };
temporary = 0.01;
};
};
};
</syntaxhighlight>


'''Weapon sample'''
'''Weapon sample'''


class CfgWeapons
<syntaxhighlight lang="cpp">
{
class CfgWeapons
  class MyRifle
{
  {
class MyRifle
  recoil = "my_awesome_recoil";
{
  };
recoil = "my_awesome_recoil";
};
};
};
</syntaxhighlight>


'''Global config sample'''
'''Global config sample'''


class CfgWeaponHandling
<syntaxhighlight lang="cpp">
{
class CfgWeaponHandling
  class Recoil
{
  {
class Recoil
  kickVisual = 0.3; //multiplier for extra camera-only movement for weapon kickback
{
  impulseCoef = 1; //common coefficient for weapon-based recoil configuration values, increase to make all recoils stronger, decrease to make them all weaker
kickVisual = 0.3; // multiplier for extra camera-only movement for weapon kickback
  prone = 1.25; //coefficient of recoil forces while in prone (this is further multiplied by weapon resting coefficients)
impulseCoef = 1; // common coefficient for weapon-based recoil configuration values, increase to make all recoils stronger, decrease to make them all weaker
  };
prone = 1.25; // coefficient of recoil forces while in prone (this is further multiplied by weapon resting coefficients)
};
};
};
</syntaxhighlight>


'''Description'''
'''Description'''
Line 52: Line 58:
* would you like your weapon to kick back more ? Increase ''kickBack''.
* would you like your weapon to kick back more ? Increase ''kickBack''.
* and vice versa.
* and vice versa.


== Legacy Recoils ==
== Legacy Recoils ==


In an effort to ensure compatibility across mods here are the current recoil values used in ArmA (permission provided to list these by Maruk). By using these as a starting/reference point for your mods own recoils you will ensure that your mod can be used alongside other mods.
In an effort to ensure compatibility across mods here are the current recoil values used in ArmA (permission provided to list these by Maruk).
 
By using these as a starting/reference point for your mods own recoils you will ensure that your mod can be used alongside other mods.
[[A few things to note.]]
 
Recoil is defined as three numbers in a row indicating time taken,kick back,kick up. There can be a series of these recoils settings per weapon config.  


Recoil is defined by weapon and not per bullet.
'''A few things to note:'''


You can define a prone recoil to simulate the lower recoil of being prone and firing with a bipod/tripod support.
* Recoil is defined as three numbers in a row indicating: time taken, kick back, kick up. There can be a series of these recoils settings per weapon config.
* Recoil is defined by weapon and not per bullet.
* You can define a prone recoil to simulate the lower recoil of being prone and firing with a bipod/tripod support.


NOTE - as of beta patch the recoil values have changed and are mostly snappier and more responsive. I will update them here with actual numbers asap.  
{{Feature|informative|As of beta patch the recoil values have changed and are mostly snappier and more responsive. <!-- I will update them here with actual numbers asap. -->}}


----
<syntaxhighlight lang="cpp">
pistolBase[] = { 0,0,0, 0.080000,0.003000,0.020000, 0.050000,-0.003000,-0.033000, 0.050000,0,0 };


pistolBase[] =         {0,0,0, 0.080000,0.003000,0.020000,   0.050000,-0.003000,-0.033000, 0.050000,0,0};
subMachineGunBase[] = { 0,0,0, 0.060000,0.005000,0.005000, 0.050000,0,-0.020000, 0.060000,-0.005000,0.005000, 0.050000,0,0 };


subMachineGunBase[] =   {0,0,0, 0.060000,0.005000,0.005000,   0.050000,0,-0.020000,         0.060000,-0.005000,0.005000, 0.050000,0,0};
assaultRifleBase[] = { 0,0,0, 0.060000,0.010000,0.010000, 0.100000,0,-0.020000, 0.100000,-0.010000,0.010000, 0.050000,0,0 };


assaultRifleBase[] =   {0,0,0, 0.060000,0.010000,0.010000,   0.100000,0,-0.020000,          0.100000,-0.010000,0.010000,  0.050000,0,0};
machinegunBase[] = { 0,0,0, 0.080000,0.010000,0.040000, 0.050000,-0.003000,-0.010000, 0.200000,0,0 };


machinegunBase[] =     {0,0,0, 0.080000,0.010000,0.040000,   0.050000,-0.003000,-0.010000,  0.200000,0,0};
launcherBase[] = { 0,0,0, 0.200000,0,0.050000, 0.100000,0,0 };


launcherBase[] =       {0,0,0, 0.200000,0,0.050000,         0.100000,0,0};
AK74Recoil[] = { 0,0,0, 0.060000,0.010000,0.012000, 0.100000,0,-0.020000,0.100000, -0.010000,0.010000, 0.050000,0,0 };


AK74Recoil[] =         {0,0,0, 0.060000,0.010000,0.012000,   0.100000,0,-0.020000,0.100000, -0.010000,0.010000,0.050000,0,0};
M240Recoil[] = { 0,0,0, 0.080000,0.010000,0.050000, 0.050000,-0.003000,-0.008000, 0.200000,0,0 };


M240Recoil[] =         {0,0,0, 0.080000,0.010000,0.050000,   0.050000,-0.003000,-0.008000, 0.200000,0,0};
M240RecoilProne[] = { 0,0,0, 0.100000,0.003000,0.005000, 0.050000,-0.003000,-0.010000, 0.050000,0,0 };


M240RecoilProne[] =     {0,0,0, 0.100000,0.003000,0.005000,   0.050000,-0.003000,-0.010000, 0.050000,0,0};
M249Recoil[] = { 0,0,0, 0.070000,0.002000,0.010000, 0.035000,-0.002000,-0.020000, 0.050000,0,0 };


M249Recoil[] =         {0,0,0, 0.070000,0.002000,0.010000,   0.035000,-0.002000,-0.020000, 0.050000,0,0};
M249RecoilProne[] = { 0,0,0, 0.100000,0.003000,0.004000, 0.050000,-0.003000,-0.008000, 0.050000,0,0 };


M249RecoilProne[] =     {0,0,0, 0.100000,0.003000,0.004000,   0.050000,-0.003000,-0.008000, 0.050000,0,0};
M4Recoil[] = { 0,0,0, 0.060000,0.010000,0.010000, 0.100000,0,-0.018000, 0.100000,-0.010000,0.010000, 0.050000,0,0 };


M4Recoil[] =           {0,0,0, 0.060000,0.010000,0.010000,   0.100000,0,-0.018000,          0.100000,-0.010000,0.010000,     0.050000,0,0};
PKMRecoil[] = { 0,0,0, 0.100000,0.030000,0.040000, 0.050000,-0.030000,-0.080000, 0.050000,0,0 };


PKMRecoil[] =           {0,0,0, 0.100000,0.030000,0.040000,   0.050000,-0.030000,-0.080000, 0.050000,0,0};
PKMRecoilProne[] = { 0,0,0, 0.100000,0.003000,0.005000, 0.050000,-0.003000,-0.010000, 0.050000,0,0 };
</syntaxhighlight>


PKMRecoilProne[] =      {0,0,0,  0.100000,0.003000,0.005000,    0.050000,-0.003000,-0.010000, 0.050000,0,0};


[[Category:ArmA:_Addon_Configuration]]
{{GameCategory|arma1|Addon_Configuration}}

Latest revision as of 21:41, 23 April 2024

New Recoil

Recoil sample

class cfgRecoils
{
	class my_awesome_recoil
	{
		muzzleOuter[]	= { 0.3, 1.0, 0.3, 0.2 }; // x, y, a, b
		kickBack[]	= { 0.03, 0.06 };
		permanent	= 0.1;
		temporary	= 0.01;
	};
};

Weapon sample

class CfgWeapons
{
	class MyRifle
	{
		recoil = "my_awesome_recoil";
	};
};

Global config sample

class CfgWeaponHandling
{
	class Recoil
	{
		kickVisual	= 0.3;	// multiplier for extra camera-only movement for weapon kickback
		impulseCoef	= 1;	// common coefficient for weapon-based recoil configuration values, increase to make all recoils stronger, decrease to make them all weaker
		prone		= 1.25;	// coefficient of recoil forces while in prone (this is further multiplied by weapon resting coefficients)
	};
};

Description

  • Parameter muzzleOuter defines the possible area where the recoil would like to move the weapon's muzzle randomly at each shot. It is defined as ellipse with variables defining the (x = horizontal axis position, y = vertical axis position, a = horizontal magnitude, b = vertical magnitude); or, translated to the weapon's recoil movement behavior (how far to the right, how high up, how much horizontal deviation, how much vertical deviation).
  • Parameter kickBack defines the minimum and maximum of random interval for backward force applied over the arms and torso for each fired shot.
  • Remaining parameters define how much of the random muzzle displacement within the defined ellipse space is permanent (causing muzzle rise you should compensate for) and how much is temporary (causing temporal weapon rise up and down, thus causing the weapon to shake in your hands).

Camera shakes are derived from the overall magnitude of each recoil impulse forces.

Basic suggestions

  • would you like your weapon to kick more to the right ? Increase Horizontal Axis Position value of muzzleOuter.
  • would you like your weapon to kick more upwards ? Increase Vertical Axis Position value of muzzleOuter.
  • would you like your weapon to jump left and right more randomly ? Increase Horizontal Magnitude value of muzzleOuter.
  • would you like your weapon to jump up and down more randomly ? Increase Vertical Magnitude value of muzzleOuter.
  • would you like your weapon to climb up more ? Increase permanent.
  • would you like your weapon to shake more in your hands ? Increase temporary.
  • would you like your weapon to kick back more ? Increase kickBack.
  • and vice versa.


Legacy Recoils

In an effort to ensure compatibility across mods here are the current recoil values used in ArmA (permission provided to list these by Maruk). By using these as a starting/reference point for your mods own recoils you will ensure that your mod can be used alongside other mods.

A few things to note:

  • Recoil is defined as three numbers in a row indicating: time taken, kick back, kick up. There can be a series of these recoils settings per weapon config.
  • Recoil is defined by weapon and not per bullet.
  • You can define a prone recoil to simulate the lower recoil of being prone and firing with a bipod/tripod support.
As of beta patch the recoil values have changed and are mostly snappier and more responsive.
pistolBase[] =			{ 0,0,0, 0.080000,0.003000,0.020000,	0.050000,-0.003000,-0.033000,	0.050000,0,0 };

subMachineGunBase[] =	{ 0,0,0, 0.060000,0.005000,0.005000,	0.050000,0,-0.020000,			0.060000,-0.005000,0.005000,	0.050000,0,0 };

assaultRifleBase[] =	{ 0,0,0, 0.060000,0.010000,0.010000,	0.100000,0,-0.020000,			0.100000,-0.010000,0.010000,	0.050000,0,0 };

machinegunBase[] =		{ 0,0,0, 0.080000,0.010000,0.040000,	0.050000,-0.003000,-0.010000,	0.200000,0,0 };

launcherBase[] =		{ 0,0,0, 0.200000,0,0.050000,			0.100000,0,0 };

AK74Recoil[] =			{ 0,0,0, 0.060000,0.010000,0.012000,	0.100000,0,-0.020000,0.100000,	-0.010000,0.010000,				0.050000,0,0 };

M240Recoil[] =			{ 0,0,0, 0.080000,0.010000,0.050000,	0.050000,-0.003000,-0.008000,	0.200000,0,0 };

M240RecoilProne[] =		{ 0,0,0, 0.100000,0.003000,0.005000,	0.050000,-0.003000,-0.010000,	0.050000,0,0 };

M249Recoil[] =			{ 0,0,0, 0.070000,0.002000,0.010000,	0.035000,-0.002000,-0.020000,	0.050000,0,0 };

M249RecoilProne[] =		{ 0,0,0, 0.100000,0.003000,0.004000,	0.050000,-0.003000,-0.008000,	0.050000,0,0 };

M4Recoil[] =			{ 0,0,0, 0.060000,0.010000,0.010000,	0.100000,0,-0.018000,			0.100000,-0.010000,0.010000,	0.050000,0,0 };

PKMRecoil[] =			{ 0,0,0, 0.100000,0.030000,0.040000, 0.050000,-0.030000,-0.080000, 0.050000,0,0 };

PKMRecoilProne[] =		{ 0,0,0, 0.100000,0.003000,0.005000, 0.050000,-0.003000,-0.010000, 0.050000,0,0 };