Jump to content
br_ac_army1

Weapon doesn't want to fire at bigger distances

Recommended Posts

I am trying to create a weapon based on ADR-97 TR and using 25 mm HE shells (inherited from 40 mm HE). Everything is okay but when I try to put a bigger distance (500m, 1000m, 2000m for example), the weapon just fires without changes. However, it worked for everything else.

What should I do?

My config.cpp: https://www.dropbox.com/s/ho5aw314uqv6d7s/config.cpp?dl=0

CfgAmmo:
 

class G_40mm_HEDPUC: G_40mm_HE
	{
		hit = 630;
		indirectHit = 30;
		indirectHitRange = 10;
		warheadName = "HEDPUC";
		explosive = 0.8;
		caliber = 5;
	};
	class G_25mm_HEDPUC_special: G_40mm_HEDPUC
	{
		hit = 720;
		indirectHit = 25;
		indirectHitRange = 7;
		warheadName = "HEDPUC";
		explosive = 0.3;
		caliber = 4;
		typicalSpeed = 750;
		maxSpeed = 1000;
		thrust = 35;
		thrustTime = 15;
		tracerScale = 3.0;
		tracerStartTime = 0.05;
		tracerEndTime = 12;
		timeToLive = 60;
	};

CfgMagazines:
 

class 12Rnd_25mm_SMG_03: 50Rnd_570x28_SMG_03
	{
		displayName = "50rnd 25 mm ADR-97 Magazine (U)";
		ammo = "G_25mm_HEDPUC_special";
		count = 15;
		mass = 20;
		initSpeed = 750;
	};

CfgWeapons:
 

class SMG_03_TR_cheat: SMG_03_TR_khaki
	{
		baseWeapon = "SMG_03_TR_cheat";
		displayName = "ADR-97 TR 5.7 mm (Upgraded)";
		magazines[] = {"75Rnd_570x28_SMG_03","50Rnd_570x28_SMG_03"};
		muzzles[] = {"this"};
		modes[] = {"SingleB","FullAutoB"};
		recoil = "recoil_empty_c";
		class Single;
		class FullAuto;
		class SingleB: Single
		{
			reloadTime = 0.05;
			dispersion = 0.00007;
		};
		class FullAutoB: FullAuto
		{
			reloadTime = 0.05;
			dispersion = 0.00007;
		};
		class WeaponSlotsInfo
		{
			class CowsSlot: CowsSlot_Rail_Boost
			{
				iconPosition[] = {0.4,0.3};
				iconScale = 0.2;
			};
			class PointerSlot: PointerSlot_Rail
			{
				iconPosition[] = {0.33,0.37};
				iconScale = 0.25;
			};
			class MuzzleSlot: MuzzleSlot_57
			{
				iconPosition[] = {0.0,0.5};
				iconScale = 0.25;
			};
			mass = 52;
			allowedSlots[] = {901,801,701};
		};
	};
	class SMG_03_TR_cheat_25mm: SMG_03_TR_cheat
	{
		baseWeapon = "SMG_03_TR_cheat_25mm";
		displayName = "ADR-97 GL 25 mm (Upgraded)";
		magazines[] = {"12Rnd_25mm_SMG_03"};
		muzzles[] = {"this"};
		modes[] = {"SingleB"};
		recoil = "recoil_empty_c";
		initSpeed = -0.5;
		maxZeroing = 2400;
		class SingleB: SingleB
		{
			reloadTime = 0.25;
			dispersion = 0.00004;
		};
		class WeaponSlotsInfo
		{
			class CowsSlot: CowsSlot_Rail_Boost
			{
				iconPosition[] = {0.4,0.3};
				iconScale = 0.2;
			};
			class PointerSlot: PointerSlot_Rail
			{
				iconPosition[] = {0.33,0.37};
				iconScale = 0.25;
			};
			class MuzzleSlot{};
			mass = 55;
			allowedSlots[] = {901,801,701};
		};
	};

 

Share this post


Link to post
Share on other sites
Quote

[...]but when I try to put a bigger distance (500m, 1000m, 2000m for example), the weapon just fires without changes[...]

What do you mean "try to put a bigger distance"?

Do you mean changing the zeroing of the weapon? If so the reason that isn't working is because you haven't altered any code referring to zeroing...

		discreteDistance[] = {100,200,300,400,500,600,700,800};
		discreteDistanceInitIndex = 2;

The first line defining distances at which the weapon can be zeroed, and the second line being the starting/default zero range of the weapon, taken from the line above it with the first entry being 0 (so in the above example 0 = 100, 1 = 200, 2 = 300 etc.)

Share this post


Link to post
Share on other sites
On 10/7/2023 at 12:19 AM, Jackal326 said:

What do you mean "try to put a bigger distance"?

Do you mean changing the zeroing of the weapon? If so the reason that isn't working is because you haven't altered any code referring to zeroing...


		discreteDistance[] = {100,200,300,400,500,600,700,800};
		discreteDistanceInitIndex = 2;

The first line defining distances at which the weapon can be zeroed, and the second line being the starting/default zero range of the weapon, taken from the line above it with the first entry being 0 (so in the above example 0 = 100, 1 = 200, 2 = 300 etc.)

I added the discreteDistance and discreteDistanceInitIndex variables. It helped me to solve a problem with ASP-1 Kir (I made a 127x108mm variant of it, but it couldn't fire further than 1400m). However, I had put these strings to my ADR-97, but nothing changed.

I have a theory that the problem is in the ammo, because I have .338 variant of ADR-97 TR where I wrote maxzeroing = 1600, and it works nice for all ranges. I suppose that bullets can tune to some range automatically and shells can't. I ran out of ideas

Share this post


Link to post
Share on other sites
3 hours ago, br_ac_army1 said:

I have a theory that the problem is in the ammo, because I have .338 variant of ADR-97 TR where I wrote maxzeroing = 1600, and it works nice for all ranges. I suppose that bullets can tune to some range automatically and shells can't. I ran out of ideas

You might be right, I've never played around with configurating custom 40mm or similar so I couldn't speak to whether or not that is the case 🤷‍♂️

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

×