Jump to content
Sign in to follow this  
Nicoman35

Trying to make a rearm addon, config help needed

Recommended Posts

Hello guys. 

As stated in the title, I would like to make a rearm script for MK6 mortars. I know these can be rearmed, when an ammo truck or another similar service vehicle is in vicinity. But I would like to be able to rearm the mortar from an ACE 82 mm ammo crate. These crates contain a limited number of rounds. My idea: Add an action menu entry, where you can rearm the mortar from these crates.

Now the mortar is counted as a vehicle, and vehicle magazines cannot be refilled with an exact amount of rounds. So, I thought I would define my own magazines for the mortars in the config. Problem: I cannot reload the mortar with these magazines. So, there must be a flaw inside the config. Here is my config. Can you guys point me where the error might be?
 

class CfgPatches 
{
	class NIC_MK6_mortar 
	{
		units[]				= {};
		weapons[]= {"NIC_mortar_82mm"};
		requiredVersion		= 1;
		requiredAddons[]	= {};
		magazines[]=
		{
			"NIC_2Rnd_82mm_Mo_HE",
			"NIC_3Rnd_82mm_Mo_HE",
			"NIC_4Rnd_82mm_Mo_HE",
			"NIC_5Rnd_82mm_Mo_HE",
			"NIC_6Rnd_82mm_Mo_HE",
			"NIC_7Rnd_82mm_Mo_HE",
			"NIC_2Rnd_82mm_Mo_Smoke",
			"NIC_3Rnd_82mm_Mo_Smoke",
			"NIC_4Rnd_82mm_Mo_Smoke",
			"NIC_5Rnd_82mm_Mo_Smoke",
			"NIC_6Rnd_82mm_Mo_Smoke",
			"NIC_7Rnd_82mm_Mo_Smoke",
			"NIC_2Rnd_82mm_Mo_Illum",
			"NIC_3Rnd_82mm_Mo_Illum",
			"NIC_4Rnd_82mm_Mo_Illum",
			"NIC_5Rnd_82mm_Mo_Illum",
			"NIC_6Rnd_82mm_Mo_Illum",
			"NIC_7Rnd_82mm_Mo_Illum"
		};
	};
};
class CfgFunctions 
{
	class NIC 
	{
		class base 
		{
			class InitFlightHeight 
			{
				preInit = 1;
				file="\NIC_rearm_MK6\scripts\init.sqf";
			};
		};
	};
};

class CfgWeapons
{
	class CannonCore;
	class mortar_82mm: CannonCore {};
	class NIC_mortar_82mm: mortar_82mm
	{
		author="NIC";
		magazines[]=
		{
			"ACE_1Rnd_82mm_Mo_HE",
			"ACE_1Rnd_82mm_Mo_Smoke",
			"ACE_1Rnd_82mm_Mo_Illum",
			"NIC_2Rnd_82mm_Mo_HE",
			"NIC_3Rnd_82mm_Mo_HE",
			"NIC_4Rnd_82mm_Mo_HE",
			"NIC_5Rnd_82mm_Mo_HE",
			"NIC_6Rnd_82mm_Mo_HE",
			"NIC_7Rnd_82mm_Mo_HE",
			"NIC_2Rnd_82mm_Mo_Smoke",
			"NIC_3Rnd_82mm_Mo_Smoke",
			"NIC_4Rnd_82mm_Mo_Smoke",
			"NIC_5Rnd_82mm_Mo_Smoke",
			"NIC_6Rnd_82mm_Mo_Smoke",
			"NIC_7Rnd_82mm_Mo_Smoke",
			"NIC_2Rnd_82mm_Mo_Illum",
			"NIC_3Rnd_82mm_Mo_Illum",
			"NIC_4Rnd_82mm_Mo_Illum",
			"NIC_5Rnd_82mm_Mo_Illum",
			"NIC_6Rnd_82mm_Mo_Illum",
			"NIC_7Rnd_82mm_Mo_Illum",
			"8Rnd_82mm_Mo_shells",
			"8Rnd_82mm_Mo_Smoke_white",
			"8Rnd_82mm_Mo_Flare_white"
		};
	};
};
class cfgMagazines 
{
	class 8Rnd_82mm_Mo_shells;
	class NIC_2Rnd_82mm_Mo_HE: 8Rnd_82mm_Mo_shells 
	{
		count=2;
		author="NIC";
	};
	class NIC_3Rnd_82mm_Mo_HE: NIC_2Rnd_82mm_Mo_HE 
	{
		count=3;
	};
		class NIC_4Rnd_82mm_Mo_HE: NIC_2Rnd_82mm_Mo_HE 
	{
		count=4;
	};
		class NIC_5Rnd_82mm_Mo_HE: NIC_2Rnd_82mm_Mo_HE 
	{
		count=5;
	};
		class NIC_6Rnd_82mm_Mo_HE: NIC_2Rnd_82mm_Mo_HE 
	{
		count=6;
	};
	class NIC_7Rnd_82mm_Mo_HE: NIC_2Rnd_82mm_Mo_HE 
	{
		count=7;
	};
	class 8Rnd_82mm_Mo_Smoke_white;
	class NIC_2Rnd_82mm_Mo_Smoke: 8Rnd_82mm_Mo_Smoke_white 
	{
		count=2;
		author="NIC";
	};
		class NIC_3Rnd_82mm_Mo_Smoke: NIC_2Rnd_82mm_Mo_Smoke 
	{
		count=3;
	};
		class NIC_4Rnd_82mm_Mo_Smoke: NIC_2Rnd_82mm_Mo_Smoke 
	{
		count=4;
	};
		class NIC_5Rnd_82mm_Mo_Smoke: NIC_2Rnd_82mm_Mo_Smoke 
	{
		count=5;
	};
		class NIC_6Rnd_82mm_Mo_Smoke: NIC_2Rnd_82mm_Mo_Smoke 
	{
		count=6;
	};
		class NIC_7Rnd_82mm_Mo_Smoke: NIC_2Rnd_82mm_Mo_Smoke 
	{
		count=7;
	};
	class 8Rnd_82mm_Mo_Flare_white;
	class NIC_2Rnd_82mm_Mo_Illum: 8Rnd_82mm_Mo_Flare_white 
	{
		count=2;
		author="NIC";
	};
	class NIC_3Rnd_82mm_Mo_Illum: NIC_2Rnd_82mm_Mo_Illum 
	{
		count=3;
	};
	class NIC_4Rnd_82mm_Mo_Illum: NIC_2Rnd_82mm_Mo_Illum 
	{
		count=4;
	};
	class NIC_5Rnd_82mm_Mo_Illum: NIC_2Rnd_82mm_Mo_Illum 
	{
		count=5;
	};
	class NIC_6Rnd_82mm_Mo_Illum: NIC_2Rnd_82mm_Mo_Illum 
	{
		count=6;
	};
	class NIC_7Rnd_82mm_Mo_Illum: NIC_2Rnd_82mm_Mo_Illum 
	{
		count=7;
	};
};

Regards

 

EDIT

 

NVM, Solved the issue. Config is correct. I just interchanged 'weapon' with 'vehicle' I tried to create the weapon, while you have to create the vehicle, then change the weapon ON the vehicle. Sorry for inconvenience.

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
Sign in to follow this  

×