Jump to content

Some tips for someone who just got into DST modding?

Recommended Posts

Hi, I've recently gotten into making a custom character for Don't Starve Together. I've done the basics like naming, custom sprites, but now comes the long and difficult part of coding. So I wanted to ask for some tips (we could call it essentials).

I'm quite capable of coding, but when I open files from other creators, it just feels like a complete mess to me and I'm not sure what I'm looking for.

So, if some of you were so kind to help me.
Things like, where to put what, what is the "language" of DST (I'm not talking about syntax, but how are events, items and so on called in Dont starve).
Also, what is possible to make? Can you make completely new powers? Custom animations, items, pets, enemies, items,...? Are there pages about this on this forum?

I know I'm probably asking too much too dumbly, but I'm a complete beginner in making mods. It actually feels like an impossible task, so any help would be much appreciated. 

Thank you.

Link to comment
Share on other sites

Mods are written in Lua, you probably already know that. There is a lot of different tutorials about a lot of different parts of modding.

For starters look through these posts:


For creating a custom character check out this post:


Getting to know your environment is key to understanding what you're doing. And the best place to get to know that is in the games code. In Don't Starve Together/data/databundles/scripts.zip there is a folder with all the of the games code (aside from the games engine). You can extract that folder onto your desktop or wherever you might want.

Here are the parts I find the most helpful to look through:

scripts/modutil.lua - Contains all of the functions added to the environment

scripts/constants.lua - Contains global variables

scripts/tuning.lua - Contains global variables used mainly as values for mobs

scripts/consolecommands.lua - Contains all of the console commands that you can use in-game

scripts/entityscript.lua - Is what every entity in the game is

scripts/prefab.lua - Entities are created from prefabs (located in scripts/prefabs/), more on that here:

scripts/component.lua - Most prefabs use components (located in scripts/components/), such as healthagelocomotor, a great documentation here:

(not for player characters) scripts/brain.lua - Mob prefabs use brains (located in scripts/brains/) to make mobs think, such as spiderbrain.lua, deerclopsbrain.lua

scripts/stategraph.lua - Entities might need a stategraph (a state manager). Contains everything a stategraph uses (things like EventHandler, State, ActionHandler)

scripts/actions.lua - Contains every action in the game (used in stategraphs), such as CHOP, PICK, WALKTO


Now, I know, all of this might look overwhelming at first. When creating something new try to find something that already exists that is similar to what you might want to code and learn from it. The files I mentioned above might not be the easiest to understand at first and that's why you shouldn't treat them as a study book but rather a reference when searching for an answer.

If you want to learn something about creating prefabs here are very basic prefabs that should help you:

scripts/prefabs/inv_rocks.lua - A simple inventory item prefab

scripts/prefabs/rabbit.lua - A fairly simple passive mob prefab

scripts/prefabs/spider.lua - A file containing multiple aggressive mobs' prefabs


As well as some components you might find useful:

scripts/components/health.lua sanity.lua hunger.lua - Components that manage health/sanity/hunger of an entity

scripts/components/combat.lua - A component that manages damaging entities

scripts/components/inventoryitem.lua - A component that manages holding entities in inventories

  • Thanks 1
  • Sanity 2
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

  • Create New...