Jump to content

Attach sound to an NIF?


DarkSpyda04

Recommended Posts

Certain NIF files such as fire for instance might start playing a sound when its animation is triggered even if no sounds were specified in the construction set. It's safe to assume then that these sounds are attached to the NIF itself. How would I go about doing this?

Link to comment
Share on other sites

I think the sounds are attached to the .kf files. Have you checked those out?

I googled "oblivion attach sound to kf" and results came up talking about "Text keys". Apparently, text keys are responsible for a great number of things including sounds.

 

http://www.truancyfactory.com/tutorials/oblivion/ob_animation_textKeys.html

 

This is something I'll have to play around with. The butterfly room's has an NiTextKeyExtraData numbered 537 which is found under the controller sequence and towards the bottom.

 

EDIT on 06/13/14 @ 6:37PM

 

I successfully changed the sound from "amb_butterflydissolve_2d" to "amb_chimes_hit_01". Funnily enough the underscores are removed when entering string data so "amb_butterflydissolve_2d" becomes "sound: AMBButterflyDissolve2D" and "amb_chimes_hit_01" becomes "sound: AMBChimesHit01".

 

The question becomes how it locates the sound file because both of these were located in a BSA archive. What if I wanted to play a sound in the Data\Sound\fx folder instead?

 

EDIT on 06/13/14 @ 7:30PM

 

Are there any user-created objects that emit a sound that I could look at?

Edited by DarkSpyda04
Link to comment
Share on other sites

Some of Stroti's resources have those (such as this one), but the sounds they point to aren't included in the plugins for some reason.

 

The reason that sound names lose the underscores in the .NIF is that the CS doesn't support underscores for object names. For a sound to work, the name of the sound in the .NIF has to be the same as the name of the sound in the CS, regardless of what the .wav file's name is. You can use a custom sound if you want to, but the sound has to be in the same plugin as the object you want to use it on. And you have to use the CS name for the sound, rather than the name of the .wav it points to.

 

This is because of the settings the CS specifies for a sound. A given .wav file might be two or three seconds long, but the game may require it to play on a loop (such as the sound effect for campfires). This would be setup in the CS. For an example, open the CS and look at any sound object that ends in LP (these are all set up as looping sounds). You can change the object name and remove the 'Loop' flag, but still utilize the same .wav file.

 

For instance, the CS sound object TrpScrapeStoneLP points to trp_IronScrapeStone_LP.wav. If you change the name in the CS to TrpIronScrapeStoneNoLoop (or anything else), you'll have to do the same in the .NIF to get it to play even though they both point to the same .wav file. And the .NIF that uses that sound name needs to be in the same plugin. If the .NIF is used in another plugin, the sound may not play (I'm not completely sure about that, as I haven't played around with it much).

Link to comment
Share on other sites

So basically the sound just has to be listed in "Sound Pick" in the CS for it to work. But how do you add sounds to "Sound Pick"? All of the WAV sounds listed in the GTAegard BSA archive also appear to be listed in the GTAesgard ESP so there must be a way.

 

Secondly, how do you create a BSA archive?

Edited by DarkSpyda04
Link to comment
Share on other sites

So basically the sound just has to be listed in "Sound Pick" in the CS for it to work. But how do you add sounds to "Sound Pick"? All of the WAV sounds listed in the GTAegard BSA archive also appear to be listed in the GTAesgard ESP so there must be a way.

 

Secondly, how do you create a BSA archive?

In order for Oblivion to read information from a non-vanilla BSA, an .esp has to accompany it. If you have Shivering Isles installed but only open the Oblivion.esm in the CS, you'll still find all of the resources for Shivering Isles. The Shivering Isles.esp is only there so the game itself can access the files in the SI BSAs. It's not necessary for a .wav file to be in a BSA for it to be used, much like it's not necessary for meshes or textures to be in BSAs in order for the game to use them.

 

As for adding a new sound, you do it the same way you'd add a mesh to the relevant subheading in the CS. The Sound subheading is located under the Miscellaneous heading. It's not even necessary to add a new .wav file if you want to use an existing one; just duplicate the existing entry, modify it as needed, & change the name. In my case, I wanted to use AyleidDisplay02AnimB from Stroti's resource I linked to earlier. I wanted to use a non-looping version of TrpScrapeStoneLP for the opening/closing sound of the mesh. I duplicated the entry in the CS, changed its EditorID to TrpScrapeStoneMH, modified the .Nif to point to that specific sound, saved it as a new mesh, then added it to the CS. No muss, no fuss.

 

If you have a custom .wav file you want to use, place it in the Sounds folder in you Oblivion/Data directory, then create a new Sound entry in the CS and select that particular .wav file. You can name the CS entry anything you want. Once you've given it a name in the CS, give that same name to the appropriate Text keys in the .NIF that will use it, then save that .NIF as a new mesh and add it to the CS. Note: every .NIF I've worked with in this way has had more than one Text Key that needed to be modified. There will be one Text Key per animation that needs to be changed. If two different animations are intended to use different sounds, then the different sounds must be entered in the appropriate Text Keys in the .NIF.

 

If you want to create a BSA archive of your own, BSA Commander is a good tool. Oblivion Mod Manager also has that capability, and I believe Wry Bash does too.

Link to comment
Share on other sites

That's pretty awesome, once the BSA archive is created, all files in the ESP read from both the archive and the folders so it's safe to remove either one. This is pretty cool.

 

I've managed to add a sound in the CS and then link the key notes in the NIF to it. I gave the NIF a Wilhelm scream and then tested it out in-game XD

 

That's about all I should need help with, unless you want to explain more about adding sounds in the CS and all the different settings you can use. For some reason the sound didn't work until I checked "2D sound" (no idea what that means).

Link to comment
Share on other sites

I really like the idea of a 3D sound. Rather than play at the same loudness from everywhere, it grows faint the further you are from the sound source. Why with something like this I can imagine the player walking through a pitch black house guided only by 3D sounds. That's something I might want to play around with.

 

If I haven't said it yet, thanks for all the help.

Link to comment
Share on other sites

I really like the idea of a 3D sound. Rather than play at the same loudness from everywhere, it grows faint the further you are from the sound source. Why with something like this I can imagine the player walking through a pitch black house guided only by 3D sounds. That's something I might want to play around with.

That sounds like it's be a lot of fun. I look forward to seeing what you come up with.

 

If I haven't said it yet, thanks for all the help.

You're welcome! :D I'm glad to help in any way I can.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...