Jump to content
Sign in to follow this  
Pillum

Cfgammo - bullet impact sounds

Recommended Posts

I'm trying to modify the bullet impact sound, but it doesn't play in OPF... sad_o.gif

Somebody know wich part of config I have to change ?

I want this sound on ground and building impact ... plz help !  help.gif

confused_o.gif

Share this post


Link to post
Share on other sites

Do you have something like these lines in your CfgAmmo section?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hitGround[]={"soundHit1",0.330000,"soundHit2",0.330000,"soundHit3",0.330000};

hitBuilding[]={"soundHitBuilding1",0.500000,"soundHitBuilding2",0.500000};

Share this post


Link to post
Share on other sites
Do you have something like these lines in your CfgAmmo section?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hitGround[]={"soundHit1",0.330000,"soundHit2",0.330000,"soundHit3",0.330000};

hitBuilding[]={"soundHitBuilding1",0.500000,"soundHitBuilding2",0.500000};

yes, but I changed value of "soundhit" 1,2&3

Nothing happened.

Quote[/b] ] impactsound1[]={"\FallBmb\snd1.ogg",0.05,1};

impactsound2[]={"\FallBmb\snd1.ogg",0.05,1};

impactsound3[]={"\FallBmb\snd1.ogg",0.05,1};

soundHit[]={"impactsound1",50.000004,1};

soundHit1[]={"impactsound1",0.031623,1};

soundHit2[]={"impactsound2",0.031623,1};

soundHit3[]={"impactsound3",0.031623,1};

soundHitBuilding1[]={"impactsound1",0.031623,1};

soundHitBuilding2[]={"impactsound2",0.031623,1};

hitGround[]={"impactsound1",0.330000,"impactsound2",0.330000,"impactsound3&am

p;qu

ot;,0.330000};

hitBuilding[]={"impactsound1",0.500000,"impactsound2",0.500000};

here what it look like.

thx for you reply !  wink_o.gif

Share this post


Link to post
Share on other sites

Ok,I'm no expert,but it looks like you need to put the exact

location of your sounds in those lines.

Like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hitGround[]={"youraddon\sounds\impactsound1",0.330000};

Otherwise the engine will look in the BIS pbos for the sounds.Where it won't find them.

Hope that helps. smile_o.gif

Share this post


Link to post
Share on other sites
Ok,I'm no expert,but it looks like you need to put the exact

location of your sounds in those lines.

Like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hitGround[]={"youraddon\sounds\impactsound1",0.330000};

Otherwise the engine will look in the BIS pbos for the sounds.Where it won't find them.

Hope that helps. smile_o.gif

thx, it didn't work either.

so if some1 can help...

Share this post


Link to post
Share on other sites

Pillum,if you still haven't sorted that problem,post your Config.

Or tell us if you're getting any errors,and what they are.

For instance,are you hearing nothing,or just the normal sounds?

Are your sounds in stereo or mono?

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

hitGround[]={"impactsound1",0.330000,"impactsound2",0.330000,"impactsound3&am

p;qu

ot;,0.330000};

Btw,if those typos(3")are in your Cfg,that certainly will cause problems.Sorry I didn't reply earlier.

Been tryin to sort some problems of my own. wink_o.gif

Share this post


Link to post
Share on other sites
Pillum,if you still haven't sorted that problem,post your Config.

Btw,if those typos(3")are in your Cfg,that certainly will cause problems

thx for you reply, no I just heard the normal impact sound. sad_o.gif

So I'm gonna remove 3" from the config and try it again ?!?!?

I simply replaced the soundimpact value for my sound impact.

here is my code sample

class CfgAmmo

{

   class Default {};

class BulletSingle: Default{};

class BulletBurst: BulletSingle {};

...

{

airLock = 1;

hit = 7;

indirectHit = 1;

indirectHitRange = 0.100000;

minRange = 4;

minRangeProbab = 0.900000;

midRange = 200;

midRangeProbab = 0.500000;

maxRange = 500;

maxRangeProbab = 0.050000;

cost = 6;

soundHit4[]={"\fallBmb\snd1.wav",1,1};

hitGround[]={"soundHit4",0.330000,"soundHit4",0.330000,"soundHit1",0.330

000};

hitBuilding[]={"soundHit4",0.500000,"soundHit4",0.500000};

};

};

well, hope you can help me... smile_o.gif

Share this post


Link to post
Share on other sites

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

soundHit4[]={"\fallBmb\snd1.wav",1,1};

hitGround[]={"soundHit4",0.330000,"soundHit4",0.330000,"soundHit1",0.330000};

hitBuilding[]={"soundHit4",0.500000,"soundHit4",0.500000};

Ok,do you see what you did with "soundhit4[]"?

You gave the location of your custom sound.

You must do the same with ALL of your custom sounds.

For instance Here:

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

hitGround[]={"soundHit4",0.330000,"soundHit4",0.330000,"soundHit1",0.330000};

You're telling the game to use the original BIS sounds.

You need somethin like this:

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

hitGround[]={"\Myaddon\Mysound1.wav",0.330000,"\Myaddon\Mysound2.wav",0.330000,"\Myaddon\Mysound3.wav",0.330000};

So whenever you use your own sound,You must tell the

game exactly where your sounds are.

Of course,you don't have to use wavs.You can also

use ogg or wss.

Btw,if you're just changing the values beside the sound,that

won't make the sound,"different".It might only change volume.

Or possibly frequency.

Macser smile_o.gif

Share this post


Link to post
Share on other sites

Ok, I'm going to try this,

And I anticipated the need of .ogg file, it was is original file type.  wink_o.gif

thank, I'll give feedback on this later.

Here is the new code sample, and it's not working...maybe I done something wrong huh.gif

class BulletSingle: Default{};

class BulletBurst: BulletSingle {};

class Bullet7_6: BulletSingle {};

...

{

airLock = 1;

hit = 7;

indirectHit = 1;

indirectHitRange = 0.100000;

minRange = 4;

minRangeProbab = 0.900000;

midRange = 200;

midRangeProbab = 0.500000;

maxRange = 500;

maxRangeProbab = 0.050000;

cost = 6;

hitGround[]={"\fallBmb\snd1.ogg",0.330000,"\fallBmb\snd1.ogg",0.330000,"\fallBmb\snd1.ogg",0.330000};

hitBuilding[]={"\fallBmb\snd1.ogg",0.500000,"\fallBmb\snd1.ogg",0.500000};

};

};

The gun is working ingame, but the sound playing is the default one...

huh.gif

Share this post


Link to post
Share on other sites

Ok,try this.

Replace:

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

hitGround[]={"\fallBmb\snd1.ogg",0.330000,"\fallBmb\snd1.ogg",0.330000,"\fallBmb\snd1.ogg",0.330000};

hitBuilding[]={"\fallBmb\snd1.ogg",0.500000,"\fallBmb\snd1.ogg",0.500000};

With this:

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

soundHit1[]={"\fallBmb\snd1.ogg",0.330000,"\fallBmb\snd1.ogg",0.330000,"\fallBmb\snd1.ogg",0.330000};

soundHitBuilding1[]={"\fallBmb\snd1.ogg",0.500000,"\fallBmb\snd1.ogg",0.500000};

Then tell me what happens.

Share this post


Link to post
Share on other sites

I get "invalid number in expression" code at the start of the game, but it run, and normal sound is playing.

sad_o.gif

Share this post


Link to post
Share on other sites

It looks like you've only got one sound you are trying to make into the hit sound. If this is the case, you don't need to define hitSound1, hitSound2, hitSound3, etc., because there is only one sound.

Try this instead:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class BulletSingle: Default{};

class BulletBurst: BulletSingle {};

class Bullet7_6: BulletSingle {};

...

{

airLock = 1;

hit = 7;

indirectHit = 1;

indirectHitRange = 0.100000;

minRange = 4;

minRangeProbab = 0.900000;

midRange = 200;

midRangeProbab = 0.500000;

maxRange = 500;

maxRangeProbab = 0.050000;

cost = 6;

soundHit1[] = {"\fallBmb\snd1.ogg", 1.0, 1.0};

hitGround[] = {soundHit1, 1.0};

hitBuilding[] = {soundHit1, 1.0};

};

The way that OFP reads this is first we define what a single sound is (multiple sounds can be defined this way). That is this part:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">soundHit1[] = {"\fallBmb\snd1.ogg", 1.0, 1.0};soundHit1 is the name of this sound.

"\fallBmb\snd1.ogg" tells OFP where the sound file is located. Note that OFP is picky about sound formats.

1.0 Tells OFP how quickly to play the sound (1.0 is normal speed, 2.0 is 2x, 0.5 is 1/2 speed)

1.0 Tells OFP the volume of the sound (you'll have to play with this, or base it off a BIS value)

We can define several sounds this way. For instance, you could have a 2nd hit sound:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">soundHit2[] = {"\fallBmb\snd2.ogg", 1.0, 1.0};

The next thing OFP sees is the section defining which sounds apply to which impacts:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hitGround[] = {soundHit1, 1.0};In this case, there is only 1 sound, soundHit1. But if you had multiple sounds to consider, you'd need something like this:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hitGround[] = {soundHit1, 0.67, soundHit2, 0.33};soundHit1 tells OFP which sound (which we defined above) to use for this type of impact.

0.67 tells OFP how often to use this sound versus others in the list. In this case, soundHit1 will play 67% of the time, and soundHit2 will play 33% of the time. If you only have one sound, it should be 1.0, to play 100% of the time.

You can define the impact sounds for hitGround, hitMan, hitBuilding, and hitArmor.

Hope this helps clear that up some smile_o.gif

Share this post


Link to post
Share on other sites

well, thank both of you.  smile_o.gif

It didn't work, I'll try some things, but I don't think I will make it.

If it does work someday, I will upload code for every users to use it.

I keep an eye on that. thumbs-up.gif

Share this post


Link to post
Share on other sites

Just as a matter of interest Pillum.

Could you Pm me with the complete config?

Not just the cfgAmmo section.

Macser smile_o.gif

Share this post


Link to post
Share on other sites

we made it,

the problem was, after fixing some script parts, the .wav file wasn't set right, it's 16bit mono 22 ...(000+) Hz.

thx to macser ! wink_o.gif

yay.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  

×