Jump to content
bumgie

Static weapon recoils/ weapon shake

Recommended Posts

I currently am annoyed by the fact that all the static weapons are lifeless husks when fired. 

 

Is there any other way than scripting to add weponshake or recoil to static HMGs and GMGs?

 

I tried the following:

class CfgPatches {
        class afi_staticrecoil_fix {
                units[] = {};
                weapons[] = {};
                requiredAddons[] = {"A3_Weapons_F"};
                author="Bummeri";
        };
};


class cfgRecoils
{
        class recoil_default;
        class Bum_HMG_StaticRecoil: recoil_default
        {
            muzzleOuter[] = {0,1.0,1,1};
            kickBack[] = {0.3,0.5};
            permanent = 0.1;
            temporary = 0.5;
        };
};

class cfgWeapons
{
        class LMG_RCWS;
        class HMG_127: LMG_RCWS
        {

                recoil = "Bum_HMG_StaticRecoil";

        };
};

However it seems that the recoil class has no effect on static weapons.

Share this post


Link to post
Share on other sites

1. what type of weapons / hmg are you trying to use

   a. I ask this because: is it a gatling gun, or a 50mm or what

 

2. What are you looking for, like some dust thrown up in the air from the barrel or the camera actually shaking / vibrating when the gun is fired so kind of blurring the vision

 

possibly add a picture of the obj you are trying to bring to "life"

 

I may be able to help

Share this post


Link to post
Share on other sites

1. what type of weapons / hmg are you trying to use

   a. I ask this because: is it a gatling gun, or a 50mm or what

 

50 cal Heavy machine guns on mounts such as this:

web_s_12.7-ITKK-96.jpg?MOD=AJPERES&CACHE

 

Or Grenade machine guns on mounts such as this:

 

300px-HK_GMW.jpg

 

2. What are you looking for, like some dust thrown up in the air from the barrel or the camera actually shaking / vibrating when the gun is fired so kind of blurring the vision

 

possibly add a picture of the obj you are trying to bring to "life"

 

I may be able to help

 

 

I am actually wishing for something more along the lines of current recoil for small arms on Arma 3. So weapon shake and muzzle climb. Not so much cam shake as I already know how to do that. The static weapons usually transfer any forces from firing to the mount and the ground, so I dont want to use only camshake but to also affect the weapons aiming direction.

Share this post


Link to post
Share on other sites

I would think that itself is already inherited into static weapons, what weapon are you using to inherit from inside your code

 

if you dont mind, could you share some code?

 

or atleast what weapon you are inheriting from (i.e what weapon are you using from arma to refer to, to create your full addon)

Share this post


Link to post
Share on other sites

I have been waiting for someone to address this. I also think its a bit bothersome to fire the static and just have it , as  you said, lifeless. Come on Bohemia, make a patch.

Share this post


Link to post
Share on other sites

small arms recoils also has an animation defined for it, so it isn't only the config that drives those

Share this post


Link to post
Share on other sites

Static weapons are vehicles however, so recoil and the character animation for it is not possible.

 

The only method possible afaict is making the camera shake from firing stronger . This is only for the person using it though, it won't make the weapon kick for outside observers.

CamShake is defined in cfgAmmo in the classes: CamShakeFire, CamShakePlayerFire, CamShakeHit, CamShakeExplode. It only shakes your screen however, so if you shoot and wait until it stops shaking, you are still looking at the exact same spot - at least from what i remember.

 

You could maybe use normal animation class for the weapon that triggers when firing to kick back alittle, but that only works if you have access to the source model files, and it's not random.

 



 

Share this post


Link to post
Share on other sites

I too am interested in this issue as I am working on making a FLAK 88 addon. I am working with a Blender modeller who is rigging the barrel to reciprocate when firing to simulate the recoil and reloading of the AA platform. How will this affect or work in Arma 3?

Share this post


Link to post
Share on other sites

you can animate the recoil, no problem. It just wont have a gamplay effect - as in - after firing your crosshair doesnt point somewhere else. This is what the OP wanted to have.

you can see recoil animation on the armed offroad in vanilla. Howitzers also have it.

Share this post


Link to post
Share on other sites

I have the opposite problem - I am trying to REMOVE the player / fire camera shake from my helicopter mounted grenade launchers.

 

I have split the ammo for vehicles (_v is for vehicles) and removed player cam shake and made my static weapon (which i do want cam shake on) inherit from that, and then add cam shake to it.

 

I tried adding this to my ammo to wipe that class clean, but all my helis still fire with a co-pilot shaking about like a ragdoll...

        class CamShakeFire {};
        class CamShakePlayerFire {};

 

very strange i cant destroy that class - i even tried

        delete CamShakeFire;
        delete CamShakePlayerFire;

 

config:

 

	class Uns_G_40mm_HE_v: Uns_GrenadeBase
	{
		displayNameshort = "HE";
		explosionSoundEffect = "DefaultExplosion";
		simulation = "shotShell";
		model = "\A3\weapons_f\ammo\UGL_slug";
		hit = 80;
		indirectHit = 8;
		indirectHitRange = 6;
		visibleFire = 6;
		audibleFire = 6;
		visibleFireTime = 3;
		dangerRadiusHit = 60;
		suppressionRadiusHit = 24;
		explosive = 1;
		cost = 10;
		deflecting = 5;
		airFriction = -0.001;
		fuseDistance = 15;
		whistleDist = 16;
		typicalSpeed = 185;
		caliber = 2;
		soundHit1[] = {"A3\Sounds_F\arsenal\explosives\Grenades\Explosion_gng_grenades_01",3.1622777,1,1500};
		soundHit2[] = {"A3\Sounds_F\arsenal\explosives\Grenades\Explosion_gng_grenades_02",3.1622777,1,1500};
		soundHit3[] = {"A3\Sounds_F\arsenal\explosives\Grenades\Explosion_gng_grenades_03",3.1622777,1,1500};
		soundHit4[] = {"A3\Sounds_F\arsenal\explosives\Grenades\Explosion_gng_grenades_04",3.1622777,1,1500};
		multiSoundHit[] = {"soundHit1",0.25,"soundHit2",0.25,"soundHit3",0.25,"soundHit4",0.25};
		class CamShakeExplode
		{
			power = "(40*0.2)";
			duration = "((round (40^0.5))*0.2 max 0.2)";
			frequency = 20;
			distance = "((3 + 40^0.5)*8)";
		};
		class CamShakeHit
		{
			power = 20;
			duration = "((round (20^0.25))*0.2 max 0.2)";
			frequency = 20;
			distance = 1;
		};
		class CamShakeFire {};
		class CamShakePlayerFire {};
/*
		delete CamShakeFire;
		delete CamShakePlayerFire;
		class CamShakeFire{};
		class CamShakePlayerFire{};
		class CamShakeFire
		{
			power = "(0^0.25)";
			duration = "((round (0^0.5))*0.2 max 0.2)";
			frequency = 20;
			distance = "((0^0.5)*8)";
		};
		class CamShakePlayerFire
		{
			power = 0;
			duration = 0.1;
			frequency = 20;
			distance = 1;
		};
*/
		//ACE 3 Fragmentation implementation note: these values should be inert unless ACE 3 is active.
		ace_frag_enabled = 1;  // Enable fragmentation (0-disabled, 1-enabled)
        ace_frag_metal = 230;  // Amount of metal being fragmented (grams)
        ace_frag_charge = 185;  // Amount of explosive filler (grams) may need to reduce these valuse by major amounts. pretty sure that these values are for hand grenades...
        ace_frag_gurney_c = 2700;  // Gurney velocity constant for explosive type
        ace_frag_gurney_k = 3/5;  // Gurney shape factor. 3/5 for sphere (grenades) or plate (mines), and 1/2 for cylinders(bombs, rockets, and arty)
        ace_frag_classes[] = {"ACE_frag_medium_HD"};  // Type of fragments
        ace_frag_skip = 0;  // (Optional) Skip fragmentation for this ammo type (0-disabled, 1-enabled)
        ace_frag_force = 1;
	};
	class Uns_G_40mm_HE: Uns_G_40mm_HE_v
	{
		class CamShakeFire
		{
			power = "(0^0.25)";
			duration = "((round (0^0.5))*0.2 max 0.2)";
			frequency = 20;
			distance = "((0^0.5)*8)";
		};
		class CamShakePlayerFire
		{
			power = 0;
			duration = 0.1;
			frequency = 20;
			distance = 1;
		};
	};

 

 

Share this post


Link to post
Share on other sites

just to add :

making the values REALLY small - see below - also does nothing - still have a pilot and co-pilot shaking back and forth like they're being electrocuted

 

        class CamShakeFire
        {
            power = "(0^0.05)";
            duration = "((round (0^0.02))*0.2 max 0.02)";
            frequency = 0;
            distance = "((0^0.05)*1)";
        };
        class CamShakePlayerFire
        {
            power = 0;
            duration = 0.01;
            frequency = 0;
            distance = 0.1;
        };

 

Share this post


Link to post
Share on other sites

Sorry to necro a thread, new poster here...

I'm looking to modify a staticWeapon as well; I want to increase it's rotation max speed.

I've looked into and changed a few parameters already (animPeriod, maxHorizontalRotSpeed, inertia, dexterity), but none seem to change how sluggish the aim is moving.

Here's what I have so far:

Spoiler

class CfgPatches
{
   class M2_PEM
   {
       units[] = {};
       weapons[] = {"CUP_Vhmg_M2_static_PEM"};
       requiredVersion = 0.1;
       requiredAddons[] = {"CUP_Weapons_StaticWeapons","CUP_Creatures_StaticWeapons","CUP_Weapons_VehicleWeapons"};
   };
};

class CfgVehicles {
	class LandVehicle;
	class StaticWeapon: LandVehicle
	{
		class Turrets;
	};
	class StaticMGWeapon: StaticWeapon
	{
		class Turrets: Turrets
		{
			class MainTurret;
		};
		class AnimationSources;
		class CommanderOptics;
	};
	class CUP_M2StaticMG_base: StaticMGWeapon{};
	class CUP_M2StaticMG_PEM: CUP_M2StaticMG_base
	{
		displayName="M2 mod PEM";
		class Turrets: Turrets {

			class MainTurret: MainTurret {
				//body = "mainTurret";
				//gun = "mainGun";
				//body = "";
				//gun = "";
				//animationSourceBody = "";
				//animationSourceGun = "";
				stabilizedInAxes = 0;
				maxHorizontalRotSpeed = 50;
				maxVerticalRotSpeed = 50;
				weapons[] = {"CUP_Vhmg_M2_static_PEM"};
			};
		};
		
		
		class CommanderOptics: CommanderOptics
		{
			maxHorizontalRotSpeed = 50;
			maxVerticalRotSpeed = 50;
		};
		/*class AnimationSources: AnimationSources
		{

			class mainGun
			{
				source = "user";
				animperiod = 0;
			};
			class mainTurret: mainGun
			{
				animperiod = 0;
			};
		};*/
	};
	class CUP_B_M2StaticMG_PEM: CUP_M2StaticMG_PEM
	{
		author = "RT_PEM";
		dlc = "M2_PEM";
		scope = 2;
		scopeCurator = 2;
		side = 1;
		faction = "CUP_B_US_Army";
		crew = "CUP_B_US_Soldier";
		typicalCargo[] = {"CUP_B_US_Soldier"};
		editorPreview = "";
	};
};

class cfgWeapons {
	class HMG_M2;
	class CUP_Vhmg_M2_veh:HMG_M2{
		class manual;
	};
	class CUP_Vhmg_M2_static:CUP_Vhmg_M2_veh{};
	class CUP_Vhmg_M2_static_PEM:CUP_Vhmg_M2_static
	{
		displayName = "M2_PEM";
		inertia	= 0.1;
		dexterity = 5;
		class manual:manual
		{
			inertia	= 0.1;
			dexterity = 5;
		};
	};
};

 

Sorry if it seems obvious, I'm very new to modding.

Share this post


Link to post
Share on other sites
On 3/27/2017 at 3:13 PM, Dusty BAF said:

Sorry to necro a thread, new poster here...

I'm looking to modify a staticWeapon as well; I want to increase it's rotation max speed.

I've looked into and changed a few parameters already (animPeriod, maxHorizontalRotSpeed, inertia, dexterity), but none seem to change how sluggish the aim is moving.

Here's what I have so far:

  Hide contents


class CfgPatches
{
   class M2_PEM
   {
       units[] = {};
       weapons[] = {"CUP_Vhmg_M2_static_PEM"};
       requiredVersion = 0.1;
       requiredAddons[] = {"CUP_Weapons_StaticWeapons","CUP_Creatures_StaticWeapons","CUP_Weapons_VehicleWeapons"};
   };
};

class CfgVehicles {
	class LandVehicle;
	class StaticWeapon: LandVehicle
	{
		class Turrets;
	};
	class StaticMGWeapon: StaticWeapon
	{
		class Turrets: Turrets
		{
			class MainTurret;
		};
		class AnimationSources;
		class CommanderOptics;
	};
	class CUP_M2StaticMG_base: StaticMGWeapon{};
	class CUP_M2StaticMG_PEM: CUP_M2StaticMG_base
	{
		displayName="M2 mod PEM";
		class Turrets: Turrets {

			class MainTurret: MainTurret {
				//body = "mainTurret";
				//gun = "mainGun";
				//body = "";
				//gun = "";
				//animationSourceBody = "";
				//animationSourceGun = "";
				stabilizedInAxes = 0;
				maxHorizontalRotSpeed = 50;
				maxVerticalRotSpeed = 50;
				weapons[] = {"CUP_Vhmg_M2_static_PEM"};
			};
		};
		
		
		class CommanderOptics: CommanderOptics
		{
			maxHorizontalRotSpeed = 50;
			maxVerticalRotSpeed = 50;
		};
		/*class AnimationSources: AnimationSources
		{

			class mainGun
			{
				source = "user";
				animperiod = 0;
			};
			class mainTurret: mainGun
			{
				animperiod = 0;
			};
		};*/
	};
	class CUP_B_M2StaticMG_PEM: CUP_M2StaticMG_PEM
	{
		author = "RT_PEM";
		dlc = "M2_PEM";
		scope = 2;
		scopeCurator = 2;
		side = 1;
		faction = "CUP_B_US_Army";
		crew = "CUP_B_US_Soldier";
		typicalCargo[] = {"CUP_B_US_Soldier"};
		editorPreview = "";
	};
};

class cfgWeapons {
	class HMG_M2;
	class CUP_Vhmg_M2_veh:HMG_M2{
		class manual;
	};
	class CUP_Vhmg_M2_static:CUP_Vhmg_M2_veh{};
	class CUP_Vhmg_M2_static_PEM:CUP_Vhmg_M2_static
	{
		displayName = "M2_PEM";
		inertia	= 0.1;
		dexterity = 5;
		class manual:manual
		{
			inertia	= 0.1;
			dexterity = 5;
		};
	};
};

 

Sorry if it seems obvious, I'm very new to modding.

 

Should be maxHorizontalRotSpeed = "((360/X)/45)"; where X = time in seconds to turn 360°.

Could maybe be a problem with the inheriting class.
Are you sure the parameter has been changed? try to find it in the config reader when in an editor mission

Share this post


Link to post
Share on other sites

Thanks for getting back to me.

Yeh the 50 was a bit out of spite after trying a few "realistic" values...

The in-game config accurately shows the changes, i'm just unsure whether I'm hitting the right inherited class (hence the funky try outs with CderOptics, weapon manual, etc.).

Is there a hard-coded minimum value for Rotation speed on turrets? *Shrugs*

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×