This is a guide for my extended sample character mod.
Provided by Sabeku.
What You Need
Extended sample character mod. You can get it here: http://forums.kleientertainment.com/files/file/950-extended-sample-character/ There's separate version for single player and multiplayer. Also on the Steam Workshop. Don't Starve/Reign of Giants version. Don't Starve Together version. Shipwrecked version.
Don't Starve Mod Tools in Steam. (See below)
An image editor with transparency support, such as Paint.NET, GIMP, or Photoshop. Basically anything that isn't Microsoft Paint.
A text editor. Notepad++ or Sublime Text 3 is recommended.
TEX Tools, to convert image files ignored by the compiler. (The mod icon) http://forums.kleientertainment.com/index.php?/files/file/73-matts-tools/
Where to get the Mod Tools
Games > Tools > Don't Starve Mod Tools
Installing the Mod
Check this thread for instructions on installing the mod: http://forums.kleientertainment.com/topic/29657-how-to-install-and-use-mods/
Editing the mod's info
Open modinfo.lua with your text editor. This is the information displayed in the Mods screen. This is pretty straightforward, so you shouldn't have much of a problem here.
Renaming the character
You probably have an amazing new name for your character, so you probably want to change the template's name to that. Let's walk through what has to be renamed.
In Notepad++, press Ctrl + Shift + F to open the Find in Files dialog.
There are two ways the character is named, all lowercase (esctemplate) and all uppercase (ESCTEMPLATE). The capitalization is important! Set Directory to the location of your mod, and check the Match Case checkbox. Replace esctemplate with yourcharacter, and ESCTEMPLATE with YOURCHARACTER.
Open modmain.lua with your text editor.
We should already see your character's name since we used Find in Files. So now, you can go through and change the strings such as your character's title, quote, and description.
Next, go to scripts\speech_esctemplate.lua. Change the file name to speech_[your character's name].lua. If you want to change your character's speech, this is what you'll edit.
By default, this includes Wilson's lines for Base Don't Starve. If you want to use a different character's speech file as a base, get it from dont_starve\data\scripts.
If you have Reign of Giants, it is highly suggested you use a speech file for that instead. Get it from dont_starve\data\DLC0001\scripts.
Next, go to scripts\prefabs\esctemplate.lua. Change esctemplate.lua to [your character's name].lua. Open it.
Just like in modmain.lua, replace all instances of esctemplate with your character's name.
Let's change your character's voice. Find the line inst.soundsname = "willow". Replace willow with the character's voice you want to use. The voices available are wilson, willow, wolfgang, wendy, wx78, wickerbottom, woodie, maxwell, wathgrithr, and webber.
Now on to renaming the rest of the files.
In the bigportraits and images folders, there are many .png, .tex, and .xml files. We want to change the name of the .png files to replace esctemplate with your characters names. While you can change the names of the .tex and .xml files, it's not necessary since the compiler will rebuild these files, so you can actually delete these and let them re-appear with your character's name when compiling.
Go to the exported folder. There are two or three folders, esctemplate, esctemplate_cleared, and if you're modding DST, ghost_esctemplate_build. For now, you can ignore esctemplate_cleared (if you want) since that's only there for reference, but you should rename the other two to your character's name, and also the .scml files inside them.
Finally, let's go to the anim folder.
You'll see one or two .zip files, esctemplate.zip, and if you're modding DST, ghost_esctemplate_build.zip. These aren't quite easy to rename, since it requires also changing the name within build.bin to work. But you don't need to. The contents of the exported folder will compile into this folder, so you can just delete these. New ones will appear, already renamed to your character's name.
Now our character should be fully renamed. It's a good idea to test the mod at this point to see if we've done this correctly.
Compiling the mod will convert your .png files to .tex and .xml files, and your .scml to .zip files in the anim folder. This is usually done automatically, since the autocompiler launches whenever you start Don't Starve, as long as you have the mod tools installed.
Alternatively you can force-run the compiler by running Steam\steamapps\common\Don't Starve Mod Tools\mod_tools\autocompiler.exe.
If you need it, there's another way to compile the Spriter project by using scml.exe in the mod_tools folder directly. Start your Command Prompt, and drag the path of scml.exe, the path to your .scml file, and the path to your mod folder.
It should look something like this:
Png files that aren't in the exported folder can be converted in a similar way, but using png.exe instead.
If everything ran smoothly, we can work on the art next.
DST Big Portraits and Names Additional Instructions
These directions need to be followed in the DST of the template or the mod will crash. This may have to be repeated after editing either of the files involved:
After you compile bigportraits/[character]_none.png and images/names_[character].png, you will need to edit the resulting .xml in a text editor.
In bigportraits/[character]_none.xml, change the Element name to "[character]_none_oval.tex". (Do not change the Texture filename).
In images/names_[character].png, change the Element name to "[character].tex". (Do not change the Texture filename).
Remember, you need an image editor with transparency support!
For Don't Starve Together, here's a useful tutorial/template for making the big portrait by @Fidooop.
All edits to images will automatically compile except for modicon.png. This is what we need TEX Tools for. If you decide to draw a new modicon, use TEXCreator to convert from .png to .tex.
The images in the bigportraits and images folders are meant to be automatically compiled by the autocompiler. You can also use png.exe in the mod_tools folder if you wish to do it yourself.
Though, if you wish to use TEXTools for these instead, convert the .tex files to png first rather than using the ones provided. This is to avoid crashing caused by textures that don't have dimensions of the power of 2.
Now let's take a closer look at how to draw our character's in-game art. Your character's art is in all the folders within the exported folder. Open the .scml with Spriter, which comes with Don't Starve Mod Tools. You can preview the changes you make by opening this. This will save you time as opposed to opening Don't Starve every time you make a change.
The template provided includes all animatable parts (or symbols), but it's likely the character you wish to make doesn't need a certain symbol, such as hairpigtails, tail, and/or skirt. Rather than having to edit the .scml to remove these, you can clear out the .png files of these symbols. This is why I included the folder esctemplate_cleared. You can simply replace a symbol with one of these cleared version to "remove" it.
Information on faces used can be found here.
Try not to change the dimensions of any part, unless you absolutely know what your doing. Changing the dimensions (length and width) of the images will require editing the .scml as well, which includes updating the length and width of a part, and also having to recalculate pivots using this complicated equation if resized from the center of the image:
NewPivot = (OldLength*OldPivot+((NewLength-OldLength)/2))/NewLength
Additionally, this will make updating to future versions of the template a bit more inconvenient.
Don't forget to compile your mod to see the changes.
Note: If uploading to Steam Workshop, this step is not necessary if you choose not to upload redundant files.
If you've finally completed your mod, and want to release it to the public without taking up any unnecessary file space, you may want to remove some of your extra work files. (Though, if you like the clutter, you don't have to do any of this!)
Please back up your mod before deleting anything!
The entire exported folder can be removed, since everything compiles into the anims folder.
All .png files can be removed, since all image data is stored as .tex and .xml files. This includes the ones in the bigportraits and images folders, and also modicon.png.
Do not remove anything else.
If problems arise, check your log to see what the error is. For Don't Starve, this is located in Documents\Klei\DoNotStarve\log.txt. For Don't Starve Together, this is located in Documents\Klei\DoNotStarveTogether\client_log.txt
In DST, make sure you didn't skip the additional steps for big portraits and names.
This is the basics for using this template. I hope this tutorial was helpful.