Jump to content
Sign in to follow this  
toadball

cfgPatches & Magazine Error

Recommended Posts

Hi,

I've been working on a masada addon with Helping_Hand, dealing with the config side of things and have hit a brick wall.

Upon running a mission with the weapon added to a crate I get the following error:

Quote[/b] ]No entry "bin\config.bin/CfgPatches/HHx_Masada_BUIS.Units".

Sadly this is not all, having click the ok thing, I proceeded to try again and the test setup loaded fine, but the weapon would not accept the mags I specified.

the crate has the Masada and respective mag added like so:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addWeaponCargo ["HHx_Masada_BUIS",2]; this addMagazineCargo ["HHx_556_30_AK_Mag",24]

As I'm a new to config writing I'm rather lost as what to do, so any help would be great.

The weapon's config.cpp file is as such.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class CfgPatches {

class HHx_Masada_BUIS {

weapons[] = {"HHx_Masada_BUIS"};

};

};

class CfgSkeletons

{

class HHx_Masada_BUIS {

isDiscrete=0;

skeletonInherit="";

skeletonBones[]={"magazine", "","bolt", "","trigger", ""};

};

};

class CfgModels

{

class Default {

sections[] = {};

sectionsInherit="";

};

class Weapon: default {};

class HHx_Masada_BUIS: Weapon {

skeletonName="HHx_Masada_BUIS";

class Animations{

class reload_magazine {

type="hide";

source="reloadMagazine";

selection="magazine";

hidevalue=0.2;

};

class reload_magazine_release {

type="rotationZ";

source="reloadMagazine";

selection="magazine";

axis="magazine_axis";

minValue=0.1;

maxValue="1";

angle0="0";

angle1="rad -2";

};

class bolt {

type="translation";

source="reload";

selection="bolt";

axis="bolt_axis";

begin="bolt_axis_begin";

end="bolt_axis_end";

minValue=0;maxValue="1";

offset0="0";

offset1="1";

};

class trigger {

type="rotation";

source="reload";

selection="trigger";

begin="trigger_axis_begin";

end="trigger_axis_end";

minValue=0;

maxValue="1";

angle0="0";

angle1="rad 45";

};

};

sections[]={"zasleh"};

sectionsInherit="";

};

};

class CfgAmmo

{

class Default;

class BulletCore;

class BulletBase;

class HHx_556x45 : BulletBase

{

hit=12;

indirectHit=0;

indirectHitRange=0;

tracerColor[] = {0.80000, 0.20000, 0.00000, 0.90000};

tracerColorR[] = {0.00000, 0.00000, 0.00000, 0.00000};

visibleFire=18;

audibleFire=18;

visibleFireTime=3;

};

};

class CfgMagazines

{

class Default;

class CA_Magazine;

class HHx_556_30_AK_Mag : CA_Magazine

{

scope = 2;

value = 1;

useAction = 0;

useActionTitle = "";

displayName = "5.56mm x 45 30rd Mag";

ammo = "HHx_556x45";

initSpeed = 838;

count = 30;

selectionFireAnim = "zasleh";

};

};

class CfgWeapons {

/*extern*/ class M4A1;

class HHx_Masada_BUIS: M4A1 {

displayName = "Masada BUIS";

picture = "\HHx_Masada_BUIS\Data\weapon.paa";

model = "\HHx_Masada_BUIS\HHx_MASADA.p3d";

dexterity = 1.800000;

magazines = {"HHx_556_30_AK_Mag"};

};

};

};

Again, any help would be great and is always appreciated.

Regards,

Toad

Share this post


Link to post
Share on other sites

Shouldn’t cfgPatches be:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches

       {

       class HHx_Masada_BUIS

               {

               units[] = {};

               weapons[] = {"HHx_Masada_BUIS"};

               };

       };

?

Share this post


Link to post
Share on other sites

looks ok.

you better upload your test mission and config.

it looks like something else is the source.

Share this post


Link to post
Share on other sites

the error message says game cant' find 'units' entry in cfgPatches module, so try to declare it there, just like UNN said. And I'm not sure but it may cause error if the addon name is the same than the name given to the weapon, but if that works nevermind, i haven't tested that.

Share this post


Link to post
Share on other sites

Thanks for the help, UNN's snippet has fixed the error message I posted earlier just have to sort:

"magazines/ is not an array" error

Share this post


Link to post
Share on other sites
Thanks for the help, UNN's snippet has fixed the error message I posted earlier just have to sort:

"magazines/ is not an array" error

Some of the items are arrays. So you only have to define the magazines like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

dexterity = 1.800000;

magazines[] = {"HHx_556_30_AK_Mag"};

When you have the editing tools suite installed, you can locate a file P:\bin\config.cpp including the class CfgWeapons Default-class. This definition shows you which weapon's config items are arrays (e.g. sound and magazines and some more).

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgWeapons

{

access=1;

class Default

{

...

reloadTime=1.000000;

sound[]={ ... };

magazines[]={};

Share this post


Link to post
Share on other sites

ehhm.. true, it's a simple detail, in cfgWeapons, when you declare the magazines, do it as an array  tounge2.gif

magazines[]={"HHx_556_30_AK_Mag"};

I think it must be that. good luck with your project

Edit: sry for duplicate info, i'm too slow when writting from work

Share this post


Link to post
Share on other sites

Thanks again, learn somit new everyday lol.

We'll probably have the one variant out as a beta for Christmas or new years, we've still got one or two things to iron out smile_o.gif

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  

×