Jump to content

[Tutorial] Custom character voice and items


K1NGT1GER609
 Share

Recommended Posts

So you want to implement a voice for your character mod or import sounds for your items? Then let’s get started, this tutorial was created on the bases of the old tutorial back in 2013 but with don’t starve together coming around it wasn’t really updated to say the least. So this guide will more or less will be an update compared to the previous guide and hopefully be re-edited when an update gives us something new. Before we start a few tools are needed to follow this guide:

What’s needed:

·         Don’t starve mod tools in steam (for FMOD Designer)

·         Notepad++ or some other coding api

·         Audacity (for this tutorial, you can use FMOD studio or some other audio editing program but it’s your job to know how to use it)

·         VLC media player (a converter from non mp3 to mp3 for audacity)

·         Some experience with dealing with sound files (mainly editing).

·         Highly recommended to view the getting stared: guides, tutorials and examples. Especially if you’re new to modding as this guide will require basic coding knowledge and patience.

·         Your own sound files for voice implementation/item sounds. Universally mp3 is used which is fine just one more conversion.

·         A sort of tool box from the last bullet in links.

·         Moderate modding experience for sounds on items as you’ll need to make decisions and this is where the files act more like a toolbox.

Links:

·         https://notepad-plus-plus.org/

·         https://www.audacityteam.org/download/

·         https://www.videolan.org/vlc/

·         https://forums.kleientertainment.com/topic/28021-getting-started-guides-tutorials-and-examples/

·         Where it originated from: http://forums.kleientertainment.com/topic/27803-tutorial-adding-custom-sound-to-your-custom-character/

·         https://forums.kleientertainment.com/files/file/1829-character-custom-voice-tutorial-and-custom-item-sounds/

Important numbers (all values come from wilson’s voice files):

·         A character’s talk voice will last on average 2 seconds, max 2.5 seconds. I don’t know how to extend the duration just saying it now. Recommended amount 7 sound files.

·         Emote voice averages 1.4 second. Recommended amount 1 sound file.

·         A yawn average 1 second. Recommended amount 1 sound file.

·         A hurt sound .5 second. Recommended amount 3 sound files.

·         A ghost sound 1 second average, 1.5 seconds max. Recommended amount 7 sound files.

·         A death voice 1.75 seconds. Recommended amount 1 sound file.

·         A pose 1.8 seconds. Recommended amount 1 sound file.

       A carol 13 seconds. Recommended amount 1 sound file.

·         A eye rub (also called sleepy emote) 0.6 seconds. Recommended amount 1 sound file.

       A sinking 2.8 seconds. Recommended amount 1 sound file

·         For a items it’s about 45 seconds max.

 

 

Video:

 

Character voice (if you have trouble know what to click refer to the pictures, green boxes = point of interest, yellow boxes =  important sections):

1.     Open the modmain and the first 20 lines should have all the lines of code for your character mod’s voice just replace all “characterprefab” with well your character’s name. If you’re doing don't starve only voice mod you can ignore lines 12-18 unless you plan to make it both don’t starve together and don’t starve compatible in the future.

2.      Next open the characterprefab file under scripts-prefabs there will be only be a single line to put into your character lua file. Line 3 is for dst, while line 7 is for don't starve but the note above should be taken into consideration.

3.      Alright disclaimer I don’t make custom music so you should have your own source of sounds to implement, most of my voices come from songs from the games I adapt my mods from. That out of the way open up audacity and vlc media player while you’re at it. If you already have your mp3’s ready go down to the next step, or if you have your .wav go to step 5. If you drag your sound file into audacity and get a window pop up then there’s a chance your file won’t come out as good as it should, then that’s why we have vlc media player open. Go to media-convert/save…-file-add…- and find your sound file in your computer. Select convert/save (not the drop down arrow) and a new window will open. Select the drop down arrow next to profile and find audio – MP3, next click browse to put your mp3 sound file, preferably a folder you won’t delete later and rename it to your meaningful name like character_talk1 and such (the name won’t matter). Then click start, if you have more files to convert this will become repetitive real quick as you don’t get all files you added converted in one go. So go back to the window where you add files, remove the top file you converted and keep going till you have all your mp3s set.

4.      Note: I’m not much of a sound/signals kind of guy so the next part will only mention bare bones basic options. Now with audacity drag your mp3 onto the grey area and two wavelengths will appear. Here you can edit your sound files by shrinking them, increase the gain by some # dB (units: decibels comes from signals classes), and importantly convert mp3 to wav files. Go down to “Basics and Tips for audacity” and read up on your controls and along that read up on “Important numbers”. If you’re a music/signals kind of person you can use the effect on your menu bar and use fade out on your last milliseconds (by holding click and highlighting the wavelength) of your sounds to avoid the sudden silence at the end of your character’s speech. For beginners you can do an alternative fade out in the next step when I mention optional. When you think you get the right sounds with the right length go to file-export-export as wav- go to where you put all your sound files and save.

5.      Let’s open up the characterprefab.fdp in the sound folder with fmod designer and check a few things. You can find fmod designer with directory: C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Mod Tools\mod_tools\FMOD_Designer once you get there use the application: fmod_designer (I’m saying this cause window 8 and above usually don’t know how to open applications any more, what happen to window 7 knowing what application was right for the job???). Alright once open you should go to events and from there open characters-characterprefab if it isn’t open, and click on the events (hurt,death_voice, etc) and go one by one to check for the following settings in the property-value table that’s on the far right hand side. Mode: 3d, 3D Rolloff: Linear, 3D Max Distance: 50. What does this do? We’ll it’s a common error in most mods that you can hear the character’s voice all throughout the world when they speak, with these options it’ll limit it to the maximum zoom out for your in-game camera. Optional (Recommended for beginners): set Fade out time: 150 to match the original’s character’s voice fading when their done speaking. Also it doesn’t sound good when your character’s voice goes dead silence in less than 0 seconds (or sounds that way).

eventmain.thumb.png.4f451ce3642853453d3d674041ebe721.png

6.      After you check that property-value table then let’s start renaming the characterprefab with your character’s name. Click characterprefab, from there look at the property-value table on the right hand side and there should be the option: name, user properties, notes. On name replace characterprefab with your character’s name. Alright once that’s done we got another characterprefab to rename, go to the banks and on the left hand side click characterprefab and look at the far right where the property-value table comes up again. Go to name and rename it to your character’s name, no other options shouldn’t need to be edited unless you know what you’re doing.

renameevents.thumb.png.babc979e43601382a7990c5cee586ae4.png

7.      Once that’s done I’ll say it now: IMPORTANT: Where you keep your sound files is where fmod designer will go to when you build the files, so places all the sound files in one place preferably somewhere you won’t mind them staying and won’t delete them. If you decide to re-edit the files in the future or the files didn’t come out the way to wanted and you delete them/move them, then you’ll have to either: put back the sound files where they were or redo the next step so cluttered desktops beware!

8.      Go back to events and click on an event (hurt, yawn, pose, talk_LP, etc), in the center of the window there will be a box titled playlist with rand and sound subtitles there you’ll drag your respective sound files into there. Like your three hurt sounds inside hurt, your seven talk sounds inside talk_LP, and so forth. Optional: You’re free to right click a wav sound and set percentage, to give the chance that sound will play, plus use lock percentage if needed but unlock them when you’re done. Once you filled the events with your wav files (if you used mp3 or another format the game won’t recognize it) press control+B and select the bank with your character’s name on it (aka check the checkbox) and click build and rebuild. If it fails there’s a chance you put a non-wav format file or a wav file is missing. Otherwise if successful it’ll say build took *some sort of time, probably less than a few seconds*. After that’s done keep your fdp file around in case you mess up or need to do re-editing, otherwise cut the fev and fsb files in the sound folder and put it into your mod. You should create a folder named sound in the main directory of your mod and put the fev and fsb files in there. After that that’s all the mod needs and test it out.

build.thumb.png.902fe08d586ec69c8cb583452eaecdb4.png

9.      If you don’t like the way they came out delete the bak file(if it exists), fev, and fsb and re-edit the sound file in audacity and redo step 8 till you’re happy with the way your character sounds.

Items sounds (refer to the pictures above if your lost, yellow boxes = important sections, green boxes = points of interest):

Note this section is meant for experienced modders as I briefly cover things that weren’t done in the character voice section. If you know how to put a voice for a character then this section is mainly the same and you’ll use the files like a tool box and use some of the lines you need and don’t use the ones you don’t need (like a restaurant menu, “omg there’s a lot of food!” waiter: “yeah just get the things you want, you don’t have to order it all”). If you want to start here just skim through steps 5 through 8 to get some idea of fmod designer otherwise I’ll briefly summarize.

1.      Let’s go to sounds-structureprefab.fdp, this file can be molded into whatever you like (weapon sounds, food sounds, armor sounds etc.) but lets go through some small details. Go to events, expand the folder named structure (if it isn’t expanded already) and click event1, under the playback options (next to playlist) the repeating loop has been selected to repeat a single sound indefinitely. You can select oneshot for it to play only once, scrolling down to the very bottom allows you to play the playlist at random, sequential (one after the other) or shuffle, you can also click allow repetition if you desire. Next look at the far right where it has the property-value table and see the following: mode:3d, 3D Rolloff: linear, 3D max distance: 50, and fade out time: 0. The first 2 mention is just setup, the max distance is your main focus, at 50 is about the radius that sound can be heard which is about how far you can zoom out your camera in-game. You can change it to your desired range, the fade out time is the time your sound starts to fade out (again doesn’t sound good when your item goes dead silent in 0 seconds), but if you’re doing repeating loop it probably won’t be needed just pointing it out. The other events are set to oneshot, but if you need more than 3 events then go to the structure folder on your left hand side, right click the folder and click add simple event and give it a name (don’t worry about the template option) once that happens redo the property on that event (mode,3D rolloff, etc.) and set it up to the previously mentioned or your sound will be heard worldwide in the game.

2.      Go to banks and select the folder structureprefab, there the property-value table will pop up again change the name as you wish. Notice in the center is where your filename (assuming you put it into the events playlist) with the directory of where it’s getting the sound file from, this should be noted if you comeback to re-edit it or make a mistake. The fmod designer will look at the same place to build the files and if you miss place it… well another headache will approach. So keep the folder somewhere it won’t bother you and you won’t mind it being there.

banks.thumb.png.d496d0c471244218c21a2bcf31d9ba0f.png

3.      Now then if your not working on structures, then go back to events and click the structure folder and change the name under the value table to whatever you like (if you haven’t already done it). Same goes for the events click it go to the property and value table and rename it. Go to the banks and click the folder and rename it. After that’s done go to the menu bar click file-save project as and rename your fdp file to whatever you’re working with. Save and click control+B, the build project will pop up and your renamed bank should be there and click the check box. The click build and rebuild and your done with fmod designer.

4.      Back to the file directory click on modmain, all you need is the assets on the bottom rename the structureprefab to your fsb and fev files (it should be the same as your fdp). And that’s all you need for your modmain, no remaping or extra code just cut it and put it to you modmain in your mod.

5.      Now go to scripts-prefabs and open up the prefab you’re working with, is it a armor? A structure? Or a weapon? Well open the one you need and there is your restaurant menu with few default sounds used commonly in those files. Its recommended to read the weaponprefab for one of the notes, otherwise notes have been added to tell more or less what it is. And that’s it for the most part.

 

 

Basics and Tips for audacity:
audacity.thumb.png.ee76097d919229062cf4adcb144b8060.png

1.      Your play back options and a record option if you have a microphone (it’s not needed for this guide just letting you know)

2.      Your play back level or volume, all you need to know is that you want to avoid getting high levels of volume indicated by the color system (green for acceptable, yellow for warning, and red for high feedback). So it’s recommended to stay in the green instead of blowing out your ears or more importantly other people's ears out at red.

3.      A quick menu for cut, copy, paste, trim audio, silence audio, undo and redo.  For trim audio your pretty much cutting off the highlighted part (refer to 7) of the sound file out and keeping only that highlighted part. For silence audio is to well silence the highlighted audio, pretty self-explanatory.

4.       Your zoom in, zoom out, fit selection, fit project in window, play at speed and playback speed. Fit selection zooms in to the highlighted section (7), and fit in project in window pretty much zoom out to fit the entire sound file.

5.      Raise the gain or volume of the sound file, scrolling to the left lowers the volume of the entire sound file and right does the opposite (again don’t blow up your ears). The R and L just shifts the volume to the left speaker and right speaker just like in your car radio settings.

6.      It’s a quick play section in which the name speaks for itself.

7.      The highlighted section is done by clicking and holding down right click on the wavelength to edit it by using the commands at 3, 4 and referenced at 8. Since you’ll be trying to match the numbers mentioned near the top the start and end of selection but you can change it by pressing the drop down arrow and using start and length of selection to save you some math work. The audio position isn’t too important just where the marker will start to play not much to say.

8.      The start time and end time of the highlighted (7) wavelength by default. You can edit by clicking the number place (ones, tens, hundredths, etc.) and typing it in. The drop down gives a variety of options but for the most part start and length of selection will be your go to option.

9.      This is a bit advanced for basic needs just match around 44100 hertz (if it isn’t there) to avoid some problems down the road. (I haven’t tried lower or higher that much but using default isn’t a bad idea).

 

·         Tip editing (8) the start time will affect the end time making it annoying if you’re trying to move up the wavelength

·         Pressing file-new is a good way to paste wavelengths that were copyed/cut but beware after constantly using file it’ll crash later down the road.

·         The quick play (6) will play automatically, just a head up.

·         Effect on the menu bar has a variety of options in modifying your sound file, the fade out is a option that can be used multiple times to make sounds gradually go to silence vs dead silence right away. Otherwise the other options are bit too advance for me to speak of.

·         When saving a edit metadata tags window will pop up for the most part it’s not very important and doesn’t require any options to be edited. Just a fancy way of organizing in short, press ok is all you need.

·     Rebuilding creates a fev file so if you're wondering where it is, you forgot to rebuild.

 

If there’s any mistakes or steps I missed comment below and I’ll make the necessary changes. Changes to the thread may/will be made especially that DST is still developing and chances are more character sounds will be implemented.

Edited by K1NGT1GER609
Added sinking time amount
  • Thanks 2
Link to comment
Share on other sites

I would like to thank you for making this tutorial.. It has been very very helpful in what I am modding on. I have searched for hours about modding with sound effects and your tutorial is the only one that actually works for me and solved my problem.

Thank you very very much! :)

Link to comment
Share on other sites

@Pinkamena11FazP The characterprefab.fdp is from the last link near the top of the guide (https://forums.kleientertainment.com/files/file/1829-character-custom-voice-tutorial-and-custom-item-sounds/), when you click on it there will be a download option to download the tool box and it'll have the fdp in the sound folder. The crashing on the other hand I don't know what exactly is the problem, your free to post you files/problems for don't starve together: https://forums.kleientertainment.com/forums/forum/79-dont-starve-together-mods-and-tools/ or for don't starve (https://forums.kleientertainment.com/forums/forum/26-dont-starve-mods-and-tools/). I could personally try to fix you mod if its simple but I think you'll get faster help in those forums.

 

 

Link to comment
Share on other sites

quick question im trying to swap wilson's voice to wendy but in scripts i only can change the speech while in sounds if i copy and paste wilson's files into wendy's then she's completely muted. Is there some sort of file that direct the voice to be used by certain character, cause technically it should work but instead of wilson sound it's nothing.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...