Jump to content
Sign in to follow this  
EricJ

Custom Satchel Charges

Recommended Posts

I've been trying to make up a Breaching charge for a weapons pack, as well as one for the XDF weapons pack. Problem is, I get it configged right (i.e. it shows up how it's supposed to, but when I try to place it on the ground, it doesn't work:

Quote[/b] ]

CfgAmmo:

class M38Charge: PipeBomb

{

hit=600;indirectHit=1;indirectHitRange=1;

minRange=1;minRangeProbab=0.30;

midRange=2;midRangeProbab=0.55;

maxRange=4;maxRangeProbab=0.00;

cost=40;

model=satchel.p3d;

visibleFire=2;

audibleFire=0.25;

visibleFireTime=0;

picture="\M4-16C\inv\m16Mag.paa";

};

CfgWeapons:

class M38A1 : Default

{

//--

scopeWeapon = private;

scopeMagazine = public;

enableAttack = true;

valueMagazine = 5;

magazineType = 1 * WeaponSlotItem;

ammo=M38Charge;

displayName=Wall Breaching Charge;

displayNameMagazine=Wall Breaching Charge;

shortNameMagazine=Breaching Charge;

count=1;

initSpeed=0;

maxLeadSpeed=0;

showEmpty = false;

useAction = true;

useActionTitle = Set Breaching Charge;

sound[]={People\gravel_L,db-70,1};

magazines[] = {this};

/*

magazines[] = {this};

modes[] = {this, TouchOff};

class TouchOff : Default

{

ammo = "";

displayName="Touch Off";

reloadTime=0.0;

sound[]={,0,1};

magazines[] = {};

useAction = true;

useActionTitle = "Touch Off Breaching Charge(s)";

};

*/

};

Like I said, there's no errors, just it won't place it on the ground so I can use it.

Share this post


Link to post
Share on other sites

Thanks, could you just send the config rather than me having to download 116MB to look at a vastly smaller file?

Share this post


Link to post
Share on other sites

SFP mod?

Share this post


Link to post
Share on other sites

Swedish Forces Pack

yes, they have a couple of custom satchel/breaching charges...

Share this post


Link to post
Share on other sites

Ahh thanks wink_o.gif

Share this post


Link to post
Share on other sites

I fear that OFP doesn't like entirely new weapon class. As it must be done with the throw and several kind of grenades.

First, as it concerns satchel charge, instead of basing it on default class, base it on the pipebomb class.

Second, a satchel can be used if the soldier has the weapon "Put". Inside the "Put" weapon, your weapon can't be defined as possible magazine for this weapon :

Quote[/b] ]

class Put : Default

{

//--

scopeWeapon = protected;

scopeMagazine = private;

valueWeapon = 0;

weaponType = WeaponNoSlot;

displayName=$STR_DN_PUT;

sound[]={,db-70,1};

reloadSound[]={,db-70,1};

canLock=LockNo;

enableAttack=false;

optics = false;

primary=false;

showEmpty = false;

magazines[] = {TimeBomb, PipeBomb, Mine, MineE};

canDrop = false;

};

So you should create a weapon as Put2 for exemple :

Quote[/b] ]

class Put : Default{};

class Put2 : Put

{

//--

scopeWeapon = protected;

scopeMagazine = private;

valueWeapon = 0;

weaponType = WeaponNoSlot;

displayName=$STR_DN_PUT;

sound[]={,db-70,1};

reloadSound[]={,db-70,1};

canLock=LockNo;

enableAttack=false;

optics = false;

primary=false;

showEmpty = false;

magazines[] = {"TimeBomb","PipeBomb","M38A1","Mine","MineE"};

canDrop = false;

};

This way, your soldier should be able to use all OFP satchels, mine, and your weapon...

Well I hope so icon_rolleyes.gif

Share this post


Link to post
Share on other sites

Thanks smile_o.gif, then I'm assuming my actual weapon's classname should be, and this is what I did:

Quote[/b] ]

class cfgWeapons

{

class Default {};

class MGun: Default {};

class Riffle: MGun {};

class M16: Riffle {};

class M4 : Riffle{};

class AK47: Riffle {};

class AK74: Riffle {};

class MachineGun7_6: MGun {};

class MachineGun7_6Manual: MachineGun7_6 {};

class Put: Default {};

class Put2 : Put

{

//--

scopeWeapon = protected;

scopeMagazine = private;

valueWeapon = 0;

weaponType = WeaponNoSlot;

displayName=$STR_DN_PUT;

sound[]={,db-70,1};

reloadSound[]={,db-70,1};

canLock=LockNo;

enableAttack=false;

optics = false;

primary=false;

showEmpty = false;

magazines[] = {"TimeBomb","PipeBomb","M38A1","Mine","MineE&

amp;

quot;};

canDrop = false;

};

class Pipebomb: Put2{};

class M38A1 : Pipebomb

{

//--

scopeWeapon = private;

scopeMagazine = public;

enableAttack = true;

valueMagazine = 5;

magazineType = 1 * WeaponSlotItem;

ammo=M38Charge;

displayName=Wall Breaching Charge;

displayNameMagazine=Wall Breaching Charge;

shortNameMagazine=Breaching Charge;

count=1;

initSpeed=0;

maxLeadSpeed=0;

showEmpty = false;

useAction = true;

useActionTitle = Set Breaching Charge;

sound[]={People\gravel_L,db-70,1};

magazines[] = {this};

/*

magazines[] = {this};

modes[] = {this, TouchOff};

class TouchOff : Default

{

ammo = "";

displayName="Touch Off";

reloadTime=0.0;

sound[]={,0,1};

magazines[] = {};

useAction = true;

useActionTitle = "Touch Off Breaching Charge(s)";

};

*/

};

Share this post


Link to post
Share on other sites

Most important, does it work ?

Don't forget to add ind your soldier's configVehicle : wink_o.gif

weapons[]={M16, Put2, DefaultManWeapons};

or

weapons[]={M16, Throw, Put2};

Share this post


Link to post
Share on other sites

Nope still the same old thing, I can access it in the menu, but still can't place it. But will add those lines..

Share this post


Link to post
Share on other sites

WOOOHOOOO I have got it!  Thanks for referrring the mods, though I finaly downloaded SFP4 and did some code-bashing.. how it works, I don't know, but it worked! And of course thanks SPQR

Now that I got it working, do I have to only specify "ej_put" for all my units, or can I have it to where anybody can pick them up and use them?

Share this post


Link to post
Share on other sites
Now that I got it working, do I have to only specify "ej_put" for all my units, or can I have it to where anybody can pick them up and use them?

AFAIK, only units with the "EJ_Put" 'weapon' will be able to correctly use your custom satchel, much in the same way only SFP units can use the SFP charges.

Share this post


Link to post
Share on other sites

Ahh gotcha, though through testing if I add 'this addweapon "ej_put" it doesn't seem to affect anything, or allows it to work. I still need to refine it but so far that looks like the course of action right now.

Share this post


Link to post
Share on other sites

gun39.jpg

gun38.jpg

gun40.jpg

And now works 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  

×