Jump to content
Sign in to follow this  
oyman

custom shells

Recommended Posts

I have some custom shells on my gun problem is that they dont eject crazy_o.gif

heres what I have for the code

in the cfg ammo part

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

class CfgAmmo

{

class Default {};

class BulletSingle: Default{};

class oyman_ntwBullet: BulletSingle

{

airLock=true;

hit=30; indirectHit=15; indirectHitRange=5;

explosive=1;

maxSpeed=2200;

minRange=1;

minRangeProbab=0.9000;

midRange=2000;

midRangeProbab=0.9000;

maxRange=2500;

maxRangeProbab=0.9000;

cost=2;

cartridge="oyman_ntwcart";

tracerColor[]={0,0,0,0};

};

};

its defined as my custom cartridge

and in the cfg vehicles section its defined like this

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

class oyman_ntwsoldier

{

all that other stuff

};

class Thing: All {};

class ThingEffect: Thing {};

class oyman_ntwcart: ThingEffect

{

model="\oyman_ntw\oyman_20shell.p3d";

displayName="20mm";

submerged=0;

submergeSpeed=0;

timeToLive=30.00;

disappearAtContact=1;

};

};

model paths are right but I still dont get a custom shell popping out sad_o.gif

Share this post


Link to post
Share on other sites

Did you remember to put the nabojnicestart and nabojniceend points in the memory lod for the gun model?

Share this post


Link to post
Share on other sites
Did you remember to put the nabojnicestart and nabojniceend points in the memory lod for the gun model?

yes, I did

Share this post


Link to post
Share on other sites

are you sure that your weapon uses your ammo? wink_o.gif

Share this post


Link to post
Share on other sites

Is it a fixed weapon, or small-arms? If a soldier is not carrying it, OFP does not create the shells. You'd have to use a script to do that.

Share this post


Link to post
Share on other sites
Is it a fixed weapon, or small-arms? If a soldier is not carrying it, OFP does not create the shells. You'd have to use a script to do that.

ya I know that, its a sniper rifle wink_o.gif

so there shouldnt be any problems

Share this post


Link to post
Share on other sites

Um, did you check your scope (eg: private, protected, public). I think the class ThingEffect is private, which means your casings are private too. Try making them protected.

Share this post


Link to post
Share on other sites

doh!, turns out i was missing a }; to close up the soldier part of the config

thanks guys wink_o.gif

Share this post


Link to post
Share on other sites

Heheh, it happens. If you haven't yet, try using something like notepad++... it will make sure your brackets line up ;)

Share this post


Link to post
Share on other sites
Heheh, it happens. If you haven't yet, try using something like notepad++... it will make sure your brackets line up ;)

yep, that's what i do, too. notepad++ is very comfortable for ofp scripting (without changing any options).

Share this post


Link to post
Share on other sites

I just tried notepad++ and I think it is very good, all cpp files open to notepad++ now wink_o.gif

thanks for the tip 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  

×