Jump to content

Where to start with modding?

Recommended Posts

I have played Don't Starve for a long time, and now I want to make some of my own content. 


I have some experience with Lua, mainly with the LOVE 2d base.


I would eventually like to get around to making every type of possible mod, such as interface, itemarrow-10x10.png, mobs, characters, and other things like that. 


If you would be kind enough, I would like you to help a person. To make mods. I just need a starting point, and a guideline, and how certain things work.


~Thankarrow-10x10.png you


-Doc Scratch (edgy5)

Link to comment
Share on other sites

I'd recommend starting with the Extended Character Template by Dleowolf.  That's where I started!


Making a custom character feels like a good way to start out, since you can immediately test it out by controlling the character directly when you start up the game.


Start by just subscribing to the mod and starting it up, then 1 step at a time, make adjustments and see what happens.  Here's something I recommend.


In the modmain.lua of the Extended Character Template put this at the bottom

--[ [GLOBAL.CHEATS_ENABLED = trueGLOBAL.require( 'debugkeys' )--]]

I have these in any mod that I'm actively working on, the -[ [ can get the space removed to comment them out when you want them turned off.


The main debug key you want to work with is CTRL + R.  Which will reload all of your edited lua scripts so you can see their changes immediately, this way you can see when a change you made causes a lua error to occur as well.




Another great way to get into modding is through using console.


With the way lua works, you can make changes through the console and actually create a mod entirely through using console commands while in game (some limitations apply)



The best way to figure things out is to read existing code and use it as examples, read the code and find out whats going on and why it works.  And when it stops working, read the error that is given when the game stops, the error will tell you exactly which line in which lua file is causing the error, as well as telling you what the error is so you can go and fix it.


Most importantly, ask us whenever you feel stuck, the community here is great and there is alot of senior members who are here day in and day out passing along helpful tips and even providing code that you can not only use for your mod, but you can also study it and use it as an example to figure out how to make things on your own.



I started with the character template because I wanted to make a character, and the template really simplify's everything I needed to do.


For everything else, there's this right here.



By the way, when I started modding, I started modding in Don't Starve Together, which has some different things to keep in mind.  You can start anywhere you wish, but in my opinion converting don't starve together mod's into don't starve regular mods are alot easier than the reverse, since don't starve together has stuff that needs to only happen on the server and not the client, while others can happen on both.  


If you don't think your ever going to be interested in multiplayer then don't worry about it, but if you think you might in the future I'd suggest learning from there first.

Link to comment
Share on other sites

Interfaces in this game are handled by widgets. Usually those widgets are pre-arranged in screens, that can easily be called from somewhere then.


Prefabs (Pre-fabricated) are templates for instances and can take a wide range of properties with little limitation and much flexibility. Mandrakes are scenery objects, creatures and items, all of that in a single prefab.

Link to comment
Share on other sites

- look for simplex's posts on this forum

- view source code of other mods, especially mentioned simplex :-), some parts can blow your mind if you are not Lua expert

- read lua source code, how it starts, what is called during start and when.

you will do it anyway if you going to do someyhing more than copypaste character with changed attributes.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

  • Create New...