I want to play the game with a character I made myself!
Don't Starve has built-in support for creating character MODs, making it a relatively easy game to mod. If you can draw, it's fun to give it a try.
However, it is slightly complicated (・ω・)
and I tend to forget how to do it if I take a break... so I've decided to record it as a personal memo.
Installing Don't Starve Mod Tools
These are the necessary tools for creating MODs.
You should be able to find "Don't Starve Mod Tools" in the list of tools in your library, so right-click it and install it.
Downloading Extended Sample Character DST
This MOD serves as a template for creation.
In short, you can complete your MOD by rewriting these files!
(Updates stopped on June 9, 2020, so it cannot be fully compatible with the latest version. However, using this template is the standard approach.)
After subscribing to the above MOD, launch Don't Starve once.
(Don't forget, as the files won't be created in the mods folder unless you launch it!)
Close the launched Don't Starve and check your PC's mods folder. If you save it in a super irregular location like I do, it's hard to find! So, here is an easy way to find it.
It should open like this. Open the "mods" folder inside, and look for "workshop-361202313". (It should be easy to find as it will likely have the most recent update date.) This is the MOD you just subscribed to.
Let's rewrite it for your own use
To be able to recover if an error occurs, keep that folder as a backup, create a copy, and rewrite that one instead.
◩ Deleting tex, xml, and zip format filesDelete all tex, xml, and zip format files contained within the folder (including subfolders) without leaving any behind. It is fine to delete them as they will be newly created after you build your mod.
◩ Changing folder and file namesFirst, change the name of the copied folder to something easy for you to understand. "myMOD" or anything else is fine as long as you understand it (however, do not use Japanese names).
Also, as part of the modification including all subfolders, change all files containing the name "esctemplate" to a different name. (esctemplate is just a sample name)
The ◎ parts are the areas to change. It is easier to understand if you use the character name of that MOD.
Since I am creating a character named Ishigami this time, I am replacing it with isigami.
After this, we will open the files and make corrections inside them.
◩ Rewriting modinfo.lua (MOD description)You can open it with a text editor without any issues. The parts to correct are as follows. Be careful not to accidentally delete the double quotation marks (").
name = "(MOD名)" description = "(説明文)" author = "(作者名)" version = "(バージョン)" 解りやすく自分の番号にしていい
① Rewrite all of certain words inside.
Open it with a text editor and use the replace all function to change the parts that say "esctemplate" and "ESCTEMPLATE" to your desired name.
To replace, open it with ctrl+H, and in the settings section, check "Match case". Change lowercase to lowercase and uppercase to uppercase. Be careful, as leaving even one will cause an error!
From here on, I will refer to "esctemplate" as "◎◎◎◎" and "ESCTEMPLATE" as "".
② Rewrite the character description. The parts that seem necessary to correct are as follows.
Note that the code below has already been replaced with ◎◎◎◎, so be careful not to copy and paste the whole thing.
The parts enclosed in "" are the areas to be corrected.
-- The character select screen lines
STRINGS.CHARACTER_TITLES.◎◎◎◎ = "(MOD名)"
STRINGS.CHARACTER_NAMES.◎◎◎◎ = "(キャラの名前)"
STRINGS.CHARACTER_DESCRIPTIONS.◎◎◎◎ = "(パーク1) \n(パーク2) \n*(パーク3)"
STRINGS.CHARACTER_QUOTES.◎◎◎◎ = "\"(簡易解説)\""
STRINGS.CHARACTER_SURVIVABILITY.◎◎◎◎ = "(生存難易度)"
-- Add mod character to mod character list. Also specify a gender. Possible genders are MALE, FEMALE, ROBOT, NEUTRAL, and PLURAL.
AddModCharacter("◎◎◎◎", "(性別)", skin_modes)Perks are the traits written in the description. \n (or ¥n) is a line break. For gender, choose from MALE, FEMALE, ROBOT, NEUTRAL, etc.
◩ Rewriting scripts/speech_◎◎◎◎.lua (Character dialogue)① Update the internal data to the latest version.
This file handles the dialogue section.
This template is old and does not support content updated after June 2020. It won't cause an error if you don't replace it, but if you want to support all dialogue, you need to replace it with the latest content.
We will find the file that corresponds to the current dialogue.
The folder above is the main game data, not a MOD, so handle it with care.
Copy "scripts.zip" from the zip files inside to somewhere appropriate like your desktop, and extract it.
Then, many speech_〇〇〇.lua files will appear. 〇〇〇 is the official character name. These are the files that handle the dialogue for each official character.
Move the speech_〇〇〇.lua of a character with a personality similar to the one you want to create to the same folder as speech_◎◎◎◎.lua, and replace speech_◎◎◎◎.lua with it.
③ Now, it's time for the hellish translation work.
The parts inside the double quotation marks (") are the dialogue. Translate these parts and rewrite them into dialogue suitable for your character! Do your best while making full use of tools like ChatGPT.
If you don't know which item the dialogue corresponds to, try referring to the URL below ( ˘ω˘ )
If you feel like giving up, change the following part in modmain.lua
-- Custom speech strings STRINGS.CHARACTERS. = require "speech_◎◎◎◎"
Change "speech_◎◎◎◎" to the name of an official character like "speech_wilson", and it should use that character's dialogue. If you have a Japanese translation MOD installed, you might not even have to go through the trouble of translating it yourself.
◩ Rewrite scripts/prefabs/◎◎◎◎.lua (basic character stats)① Rewrite the internal content.
Make it match the name you replaced earlier using global replace.
Also, open it in a text editor and use global replace to change the parts that say "esctemplate" and "ESCTEMPLATE" to your desired name.
② Set stats and special skills.
❖ Basic stat values
-- Your character's stats TUNING.ESCTEMPLATE_HEALTH = 150 TUNING.ESCTEMPLATE_HUNGER = 150 TUNING.ESCTEMPLATE_SANITY = 200
In the state above, HP is 150, Hunger is 150, and Sanity is 200.
Change these values to ones that suit your character.
❖ Setting starting inventory
-- Custom starting inventory TUNING.GAMEMODE_STARTING_ITEMS.DEFAULT.ESCTEMPLATE = "flint", "flint", "twigs", "twigs",
In the state above, the starting inventory will contain 2 flints and 2 twigs. Change this if you want to modify it. For item names, the wiki list I mentioned in the dialogue section earlier should be useful.
❖ Setting character voice
-- choose which sounds this character will play inst.soundsname = "willow"
You can set the character's voice. By default, it is Willow's voice. You will likely choose from the official characters' voices.
If you are only making corrections, the above is sufficient, but if you want to make special settings, add the following code.
Actually, it's been a while since I made a MOD, so my memory is a bit fuzzy... ( ˘ω˘ )
I apologize if this is incorrect, but I will write down an example.
I think it's probably best to add it under local master_postinit = function(inst).
❖ Setting movement speed
inst.components.locomotor.walkspeed =7 inst.components.locomotor.runspeed =8
This is the walking speed. Try setting it to your preferred value.
The setting above is slightly faster than normal.
❖ Changing action speed
inst.components.workmultiplier:AddMultiplier(ACTIONS.CHOP, 1.5, inst) inst.components.workmultiplier:AddMultiplier(ACTIONS.MINE, 1.5, inst) inst.components.workmultiplier:AddMultiplier(ACTIONS.HAMMER, 1.5, inst)
This changes the speed when chopping, digging, or using a hammer.
This feels like 1.5 times the speed.
❖ Sanity recovery aura
inst:AddComponent("sanityaura")
inst.components.sanityaura.aura = TUNING.SANITYAURA_SMALLEmits a Sanity recovery aura like Glommer.
It seems you can choose the type from TINY, SMALL, LARGE, and HUGE (Glommer is TINY).
The above is set to SMALL.
❖ Crafting bonus
inst.components.builder.science_bonus = 1
science_bonus = 1
Did you know that the official character Wickerbottom is knowledgeable and can craft items that require a Science Machine from the start? This has the same effect.
inst.components.builder.science_bonus = 100 inst.components.builder.magic_bonus = 100 inst.components.builder.ancient_bonus = 100 inst.components.builder.shadow_bonus = 100
If you set everything to 100 like this, all recipes will be unlocked.
❖ Unlocking only some recipes
local structures = "healingsalve", "bandage", "lifeinjector" for i=1, #structures do inst.components.builder:UnlockRecipe(structures[i]) end
I have unlocked the crafting for three items: "healingsalve", "bandage", and "lifeinjector".
This can be used if you want to set it up so that Ishigami, being a doctor, knows how to make medicine, bandages, etc., from the start.
❖ Mild SAN Drain
inst.components.sanity.night_drain_mult =.80
I have reduced the SAN drain at night to 0.8 to make it slightly milder.
inst.components.sanity.neg_aura_mult =.80
I have mitigated the SAN drain received from monsters and the like.
inst.components.sanity:AddSanityAuraImmunity("ghost")
inst.components.sanity:SetPlayerGhostImmunity(true)I have exempted the SAN drain from ghosts.
For this part, I referred to Wendy in the prefabs folder within scripts.zip. In short, it's Wendy's ghost immunity effect.
If you are good at programming, I think you can do various other things too!
◩ Rewriting scripts/prefabs/◎◎◎◎_none.luaMake it the same as the name you replaced earlier using global replace.
Open it with a text editor and use global replace to change the parts inside that are "esctemplate" or "ESCTEMPLATE" to your desired name.
Let's change the images too
Finally, let's change all the png images. Give it your all!
It is best to refer to the following for the portrait background and name images.
◩ Check the display with Don't Starve Mod ToolsThere are scml files in each folder within "exported", so let's try launching them. If you are asked which app to use to open them, setting it to Spriter.exe will make it easier to launch the tool.
I already configured these settings a while ago, so honestly, I've forgotten what the default state is. If you couldn't set it to Spriter.exe, launch "Don't Starve Mod Tools" from your "Library" and start it using Launch Spriter.
It should open if you select the scml file via "File" -> "Open Spriter Project".
With this, you can check positions and such to a certain extent!
How is it? Were you able to prepare everything?
Creating mods is tough, isn't it? I'm already pretty exhausted just from writing this record.
Finally, time to assemble!!
Once finished, before launching Don't Starve... copy modicon.png into a subfolder instead of leaving it in the root directory. It's fine; a little extra data won't cause any errors. It's just a little bit of good luck charm.
When you launch it, Don't Starve Mod Tools will compile the data you created. If it throws an error, let's squash the cause.
If it appears in the mod list like this, you're good to go!
What? The modicon isn't showing up?
Perhaps because it's in the root directory, for some reason it won't create it automatically.
So, please check the modicon you copied into the subfolder as a good luck charm earlier. If you take the tex and xml files created there and overwrite the ones in the root, it will display properly.
The text and starting inventory are also reflected!
What? The name part looks weird? I didn't bother making an image for the name because it's a hassle... and only I use it anyway... ( ˘ω˘ ) How to fix it is written in the notes (updated v1.2.4) inside the images folder, so please read the translation and fix it.
That's all for how to make Don't Starve mods.
Details are explained in the video below (though it is in English...)