Pillum 0 Posted February 20, 2007 I'm trying to modify the bullet impact sound, but it doesn't play in OPF... Somebody know wich part of config I have to change ? I want this sound on ground and building impact ... plz help ! Â Share this post Link to post Share on other sites
Macser_old 0 Posted February 23, 2007 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
Pillum 0 Posted February 23, 2007 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 ! Â Share this post Link to post Share on other sites
Macser_old 0 Posted February 23, 2007 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. Share this post Link to post Share on other sites
Pillum 0 Posted February 24, 2007 Ok,I'm no expert,but it looks like you need to put the exactlocation 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. thx, it didn't work either. so if some1 can help... Share this post Link to post Share on other sites
Macser_old 0 Posted March 9, 2007 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. Share this post Link to post Share on other sites
Pillum 0 Posted March 20, 2007 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. 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... Share this post Link to post Share on other sites
Macser_old 0 Posted March 20, 2007 <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 Share this post Link to post Share on other sites
Pillum 0 Posted March 20, 2007 Ok, I'm going to try this, And I anticipated the need of .ogg file, it was is original file type. Â thank, I'll give feedback on this later. Here is the new code sample, and it's not working...maybe I done something wrong 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... Share this post Link to post Share on other sites
Macser_old 0 Posted March 21, 2007 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
Pillum 0 Posted March 21, 2007 I get "invalid number in expression" code at the start of the game, but it run, and normal sound is playing. Share this post Link to post Share on other sites
canukausiuka 1 Posted March 21, 2007 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 Share this post Link to post Share on other sites
Pillum 0 Posted March 21, 2007 well, thank both of you. Â 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. Share this post Link to post Share on other sites
Macser_old 0 Posted March 21, 2007 Just as a matter of interest Pillum. Could you Pm me with the complete config? Not just the cfgAmmo section. Macser Share this post Link to post Share on other sites
Pillum 0 Posted March 25, 2007 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 ! Share this post Link to post Share on other sites