Author Topic: problem with weapon sounds...  (Read 783 times)

Legacy_Ubai

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
problem with weapon sounds...
« on: March 10, 2016, 03:47:10 am »


               

Hello,


 


I'm working on a non-replacing "ranged" weapon (based on some ideas from 4760 in the NWN2 forums) for a project and I've run across a weird issue. I've added a new melee weapon to baseitems.2da, but I have set its range to 30 meters. As far as the mechanics go, it works just fine and the model and everything work properly.


 


The problem I am having is with the sounds. I added a new row to weaponsounds.2da, but for some reason, the gun only makes a sound when it misses! Since the sounds play I know it isn't the sound files or the hak, but just to be safe I tired it using only built in sounds with the same result. I also made sure my override folder was empty.


 


I haven't been able to find much info on weaponsounds.2da on the web, is there some trick to it that I don't know about? Obviously the gun should go "boom" every time you fire it whether you hit, miss or bounce. Is there some easier way to do this?


 


If this works I hope to make it all into a hak file for both NWNs (1 and 2) that anyone can use. My focus will be on black powder weapons and reloading will be handled via scripting.


 


Thanks!


Matt



               
               

               
            

Legacy_Ubai

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
problem with weapon sounds...
« Reply #1 on: March 11, 2016, 01:44:33 am »


               

Victory! Well, sort of. '<img'> I couldn't figure out why it wasn't working, but then I realized that if it made noise on a miss I just needed to use the onHit item property and some tag based scripting to get the sound to play on a hit. After wrestling with playSound I finally made an .sef file that just plays the sound and then used ApplyEffectToLocation and voila, my hand cannon goes boom!


 


Now for the trickier problem of ammo usage, I'll need to find a way to decrease the player's ammo whether they hit or miss, preferably without using heartbeat scripts.



               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
problem with weapon sounds...
« Reply #2 on: March 11, 2016, 02:06:17 am »


               

Out of curiosity, did you look over the D20 gun system?  I can't remember if they addressed this or not.  Waaaay back in 2007, a guy named HorredThePlague sort of popped up out of nowhere and rewrote at least part of how the D20 gun system worked before disappearing back into the aether.  And from what I recall (it's been a long time), it was pretty comprehensive and might either A) shed some light on your issue, however dimly, or B) at least show you another way to go about acheiving what you want.  Can't make any promises, tho, and it requires a lot of reading between the lines and piecing things together.  The last time I personally mucked with it was about six years ago (when I retraced Horred's steps for my own perverse amusement) but I want to mutter something about making a new ammotype for the sounds.  I kind of cringe hoping I'm not pointing you in the wrong direction.


 


Anyway, if that's something you want to look into, you might want to either contact Vanya Mia on the NeverwinterVault in the D20 section, check out how the gun system works in D20 or (if it's still possible to get access) register on the old D20 forums and check out this thread by Horred.  If, for some reason, you become enamored of the D20 firearm system, I outlined a very rough history of it here.



               
               

               
            

Legacy_Ubai

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
problem with weapon sounds...
« Reply #3 on: March 11, 2016, 02:48:11 am »


               

Thanks for the links, I had forgotten about the d20 modern project! I'll snoop around a bit and see if inspiration strikes. '<img'>