Author Topic: HELP? How do I get a weapon do use a different sound?  (Read 584 times)

Legacy_Michael_Patty

  • Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
HELP? How do I get a weapon do use a different sound?
« on: September 02, 2010, 06:00:40 am »


               I have a weapon that I have custom models for, which I have overwritten a couple of the crossbow part slots with. Works pretty well, except for sound. The problem is that if I change the sound that the bolts make (ammunitiontypes.2da), or change the ammo type that the weapon uses to a custom ammo (baseitems.2da), then I end up changing the sound that ALL crossbows use.

Is there a way to have two weapons with the same base item use two different sounds when they fire?

This one has me stumped.

I've even considered blanking out the normal sound for the ammunition and scripting a sound, but I have no idea what event could be used for this (OnHit wouldn't work, since it would only fire the sound when the weapon actually hit, leaving it strangely quiet when it misses).

Anyone have a solution?

Michael
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
HELP? How do I get a weapon do use a different sound?
« Reply #1 on: September 02, 2010, 07:14:07 am »


               weaponsounds.2da
               
               

               
            

Legacy_Michael_Patty

  • Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
HELP? How do I get a weapon do use a different sound?
« Reply #2 on: September 02, 2010, 04:18:39 pm »


               I should have known it would be yet ANOTHER 2da. Thanks, ShaDoOow. I'll see if I can get it fixed with that 2da.
               
               

               
            

Legacy_Invisig0th

  • Sr. Member
  • ****
  • Posts: 279
  • Karma: +0/-0
HELP? How do I get a weapon do use a different sound?
« Reply #3 on: September 02, 2010, 04:18:42 pm »


               

Michael_Patty wrote...
Is there a way to have two weapons with the same base item use two different sounds when they fire?

No. Each entry in baseitems.2da maps to one and only one set of sounds, and one and only one type of ammo.

Unfortunately, NWN's implementation of ranged weapons and ammo is terribly limited. You literally cannot add additional ranged weapons which work properly, and many other aspects of the existing ranged weapons are either hard coded or severely limited. Those limitations will prevent you from doing what you want to do here.  If you could add an additional, new ranged weapon type with custom ammo you could do something like what you have described above. But that's not possible in this game engine. I wish I had better news for you, but there it is.

I've even considered blanking out the normal sound for the ammunition and scripting a sound, but I have no idea what event could be used for this

You can easily remove the sounds using weaponsounds.2da, but no event occurs when the weapon is fired which could be used for adding the firing sounds back in with scripting. All you accomplish there is removing sounds from all weapons of that type. So that is not actually a solution here.

For a detailed blow-by-blow account of  someone doing something similar, you may want to read my thread regarding attempts to implement laser guns on the old NWN Forums. That thread touches on several of the same exact issues you raised here, because I was trying to do something very similar with one of my attempted solutions.

Hope this helps!
               
               

               


                     Modifié par Invisig0th, 02 septembre 2010 - 03:48 .
                     
                  


            

Legacy_Michael_Patty

  • Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
HELP? How do I get a weapon do use a different sound?
« Reply #4 on: September 02, 2010, 06:43:00 pm »


               Thanks for the info, Invisig0th. That was very interesting reading. Your trials sound much like my own. Wish I'd have found that earlier.

I was wondering... did you ever try editing the weaponsounds.2da to get the sound right? This was suggested to me by ShaDoOoW  in the first respone to my OP, and when I first looked at this 2da I could not think of how it could help, since it handles the IMPACT sounds the weapons make.

But on further consideration, I realized that there is no reason that I couldn't join two sounds together in a sound editor, and have them apply on impact. I then silence the crossbow ammo so that it won't make a sound itself.
Completed, the weaponsounds.2da would have a custom entry (or overwrite an existing one).

Using your lasers as an example....

(bear with my crude attempts to describe sounds with words)
Leather0-1 would use a "ZZZZZZap" + "thunk" combined sound file
Chain0-1 would use a "ZZZZZap" + "krink" combined sound file
Plate0-1 would use the same as chain
(and so on, including the miss columns, which would use a ""ZZZap" + "crack" sound or something)

Is there any reason this would NOT work? I am interested to know if you tried this route, and if so, what your results were?

Michael

p.s. Bear in mind that I have NOT tried this. It's purely theorizing.
               
               

               


                     Modifié par Michael_Patty, 02 septembre 2010 - 05:45 .
                     
                  


            

Legacy_Invisig0th

  • Sr. Member
  • ****
  • Posts: 279
  • Karma: +0/-0
HELP? How do I get a weapon do use a different sound?
« Reply #5 on: September 02, 2010, 07:22:47 pm »


               

Michael_Patty wrote...
I was wondering... did you ever try editing the weaponsounds.2da to get the sound right? This was suggested to me by ShaDoOoW  in the first respone to my OP, and when I first looked at this 2da I could not think of how it could help, since it handles the IMPACT sounds the weapons make.

But on further consideration, I realized that there is no reason that I couldn't join two sounds together in a sound editor, and have them apply on impact. I then silence the crossbow ammo so that it won't make a sound itself.
Completed, the weaponsounds.2da would have a custom entry (or overwrite an existing one).

No, that's still not going to do what you want. All weapons of that base item type will make various sounds based on the value specified in the WeaponMatType column cross referenced with the material of the target. Moving the ammo sound into the weapon sounds doesn't really gain you anything there. You still end up with only one set of weapon sounds per base item, and those same sounds will be used for every single weapon of that type. Your custom crossbow will still sound exactly like any other crossbows of that type.

You can only reference one set of weapon sounds and one type of ammo with each entry in baseitems.2da, and all weapons of that base type will use those same sounds and ammo. And in the case of ranged weapons specifically, you also cannot add another new entry to baseitems.2da and have it work normally. So unfortunately there really is no way to do what you are trying to do due to engine limitations.
               
               

               


                     Modifié par Invisig0th, 02 septembre 2010 - 06:40 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
HELP? How do I get a weapon do use a different sound?
« Reply #6 on: September 02, 2010, 07:35:28 pm »


               But combining one other sound into sound used for one item could work, couldn't it?
               
               

               
            

Legacy_Invisig0th

  • Sr. Member
  • ****
  • Posts: 279
  • Karma: +0/-0
HELP? How do I get a weapon do use a different sound?
« Reply #7 on: September 02, 2010, 07:41:06 pm »


               It is difficult to understand what you are asking here.

One might indeed be able combine the two sounds into one, but that is pointless because it does not solve the problem.  It makes no difference if you use the seperate ammo sound or try to combine both in one sound file. You only get one weapon sound and one (optional) ammo sound for each weapon & target material combination. The problem is that the resulting sound(s) will be the same whether you are using a standard Bioware crossbow or the new one. That is the exact opposite of what was requested here.

So no, it does not work. Nothing you have suggested will actually do what was described in the first post. Changes to weapontypes.2da will not solve the problem.
               
               

               


                     Modifié par Invisig0th, 02 septembre 2010 - 07:31 .
                     
                  


            

Legacy_Michael_Patty

  • Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
HELP? How do I get a weapon do use a different sound?
« Reply #8 on: September 03, 2010, 06:33:28 pm »


               Well, I finally got what I wanted. Well, sort of. Thanks, Invisigoth, and thanks ShaDoOoW.

What I actually ended up with was a complete custom replacement of the Heavy Crossbow (I gave my players BACK the heavy crossbow - sort of - by replacing some of the light crossbow icons and models with heavy crossbow icons and models, then giving the item a free property that gives them some extra piercing damage; not perfect, but it works).

As to the sound, I discovered that this is dependent on the replacement weapon pointing to the custom ammo in the Ranged Weapon column of the baseitems.2da. Both the weapon AND the ammo (why? I don't know) have to have the right reference line in the Ammo Type column of the baseitems2da. This, of course, has to have a custom entry in the ammunitiontypes.2da to point to.

But if you do all this, then the custom weapon sound fires if the right ammo is used. Interestingly, it can still use any bolt related ammunition, and in fact, the game will automatically try to automatically reload with such ammunition if it is available in the PC's inventory once the equipped custom ammo runs out. I'll have to script around that little problem.

Anyhow, this solved the problem to MY requirements. Not sure how helpful it is to you though, Invisigoth, as you wanted to preserve ALL the weapons intact. You are probably right about that being impossible.

Oh, and an interesting note during developing this, the reason I had to make a completely custom weapon (using "wbwzh" as the type instead of "wbwxh" for crossbow) is that if I just overwrite the heavy crossbow models and icons with replacements, the icons only work in the Toolset. When the icon is viewed in the game, it inexplicably shows the original crossbow icon. This was very wierd, and I can only assume that the game engine was not looking for the TGA files in the hak first, as it should, but instead went directly to the official game resources. However, if you create a completely custom set of models and icons, it works fine. This really isn't as difficult as it sounds, since it's mostly just a matter of renaming files.

Anyhow, thanks again for all your help. This forum (sorry, "social networking site") has the best crew of people around.  '<img'>
               
               

               


                     Modifié par Michael_Patty, 03 septembre 2010 - 05:34 .