Jump to content
Sign in to follow this  
champ-1

Vanilla weapon with moded magazine

Recommended Posts

I want to make one of the vanilla guns accept moded magazine. How do I do that without creating new gun?

Share this post


Link to post
Share on other sites

You need to make a stand alone addon that not only contains a cfgmagazines.hpp file to define your new magazines but a new cfgweapons file that has authority over the original game files to make the vanilla weapon able to use them.

Share this post


Link to post
Share on other sites

So I need to define every parameter of the vanilla weapon in that config? Or can I just make some sort of reference and overwrite original weapon chaning only 1 parameter I need?

Share this post


Link to post
Share on other sites

I assume you mean modified ammo, and not the mag model itself correct?

Share this post


Link to post
Share on other sites

Both ammo and magazine. Well I did that. Now I want that mag to fit in the vanilla rifle.

---------- Post added at 20:34 ---------- Previous post was at 20:30 ----------

Here's what I have:

class CfgPatches
{
class 127x108_HEAP
{
	units[] = {};
	weapons[] = {};
	magazines[] = {};
	requiredVersion = 0.1;
	requiredAddons[] = {"A3_Data_F","A3_Weapons_F"};
};
};
class CfgAmmo
{
class B_127x108_APDS;
class B_127x108_HEAP: B_127x108_APDS
{
	hit = 70;
	indirectHit=20;
	indirectHitRange=0.4;
	explosive=0.1;
	CraterEffects="ExploAmmoCrater";
	explosionEffects="ExploAmmoExplosion";
};
};
class CfgMagazines
{
class 5Rnd_127x108_APDS_Mag;
class 5Rnd_127x108_HEAP_Mag: 5Rnd_127x108_APDS_Mag
{
	ammo="B_127x108_HEAP";
	descriptionShort = "Caliber: 12.7x108 mm HEAP<br />Rounds: 5<br />Used in: GM6 Lynx";
	displayName = "12.7mm 5Rnd HEAP Mag";
	initSpeed = 820;
};
};

Share this post


Link to post
Share on other sites

you need to modify a weapon config, making it compatible with your mags

Share this post


Link to post
Share on other sites

Yeah, how? Any examples, please?

Share this post


Link to post
Share on other sites

It's be something like this

Its not accurate, I'm not at home with my Arma files.

config.cpp=

cfgpatches {
version number
requiredaddons = "the name of the weapon pbo that you are overriding"
};
#include cfgammo.hpp
#include cfgmagazines.hpp
#include cfgweapons.hpp

cfgammo.hpp

new ammo classes here

cfgmagazines.hpp

new magazine classes here

cfgweapons.hpp

class thebaseclasstheweaponinheritsfrom;
class thegunyouwanttomodify : thebaseclasstheweaponinheritsfrom 
{
magazines = "all the original vanilla magazines, your new magazine";
};

That's basically it.

Share this post


Link to post
Share on other sites

Thanks, man. But I figured it out on my own already.

Though I don't know the proper way to find a base class. I'm just scrolling config till I find something that fits. :D

Share this post


Link to post
Share on other sites

You can check stuff like that in the editor in the config viewer :P

Share this post


Link to post
Share on other sites

Yeah, that's what I'm doing. But it's not always all that obvious.

---------- Post added at 17:04 ---------- Previous post was at 16:13 ----------

Ohhh, soo slooooww...

cfg_par.jpg

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  

×