toddpool Posted August 21, 2025 Share Posted August 21, 2025 I had an idea for a character mod where they could kinda tame animals and get extra benefits from them. For example, if they tamed rabbits, they'd gain sanity passively when around them, and if they tamed hounds, they could be used like guard dogs or even sniff out specific resources when given one of said resource. They could even befriend seasonal giants temporarily and ride them around like a super powered beefalo. I literally have no coding knowledge at all, so 'just learn lua' doesn't really seem to work for me. It's like trying to learn old English without even knowing modern English, bad analogy but you (hopefully) get what I mean. I just need some help being pointed in the right direction, since any kind of perk I try to add to my character usually ends in the server or entire game just crashing, probably just because I'm writing code without fully understanding how it works. Any help would be massively appreciated. Link to comment https://forums.kleientertainment.com/forums/topic/167662-does-anyone-know-if-it-would-be-possible-to-make-a-custom-character-be-able-to-tame-animals-like-how-wurt-and-webber-can-tame-mermsspiders/ Share on other sites More sharing options...
FerniFrenito Posted August 22, 2025 Share Posted August 22, 2025 Yes, it would be possible to do what you're suggesting. It could be done with something called "brains." You can see the code in "brain.lua" or in the brain of the mob you want to control. I think your mod is fun; if you'd like, I can help you do it. Don't worry about the game crashing. That's normal. You can't break it, and if you can't break it, why worry? Just learn from each bug. 1 Link to comment https://forums.kleientertainment.com/forums/topic/167662-does-anyone-know-if-it-would-be-possible-to-make-a-custom-character-be-able-to-tame-animals-like-how-wurt-and-webber-can-tame-mermsspiders/#findComment-1832496 Share on other sites More sharing options...
toddpool Posted August 22, 2025 Author Share Posted August 22, 2025 1 hour ago, FerniFrenito said: Yes, it would be possible to do what you're suggesting. It could be done with something called "brains." You can see the code in "brain.lua" or in the brain of the mob you want to control. I think your mod is fun; if you'd like, I can help you do it. Don't worry about the game crashing. That's normal. You can't break it, and if you can't break it, why worry? Just learn from each bug. Thank you for the advice, but I have a few questions. 1. What kind of code would I have to add to the mob's brain.lua file for it to be tameable? 2. Do I have to add the mob's brain.lua file into my character mods script folder? 3. How do I add other things, like custom items and food? Like for example, I wanted to give the character a machete type weapon that could also be used to harvest resources more efficiently. 4. How do I understand the games code better? Because at the moment I cannot read it and understand anything. 5. What code goes where? Like what sections of the character's prefab file do I write certain lines of code. All help is massively appreciated. It's really only the coding I'm struggling to understand. The art and brainstorming ideas just comes to me naturally. Link to comment https://forums.kleientertainment.com/forums/topic/167662-does-anyone-know-if-it-would-be-possible-to-make-a-custom-character-be-able-to-tame-animals-like-how-wurt-and-webber-can-tame-mermsspiders/#findComment-1832500 Share on other sites More sharing options...
FerniFrenito Posted August 22, 2025 Share Posted August 22, 2025 1. That depends on the mob. For example, Hounds have a function to follow a leader. I assume they don't target the leader. This way, you could get them to follow you and, when you take damage, have them attack the one who damaged you (like Abigail). 2. No, the brain.lua file is a game file itself, you don't have to add it, just import it into your code if necessary and use the functions it has. 3. You can achieve this with prefabs. Technically, you can create any object you want without any limitations thanks to our access to the game's source code. The best way to learn is to download another mod that implements something similar to what you're looking for and see how the creator did it. To get you started with prefabs, I recommend this mod: Sword MOD for DST. It goes without saying that mods are installed in one of these two folders: "C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Together\mods" or "C:\Program Files (x86)\Steam\steamapps\workshop\content\322330" 4. You can search for a GitHub that contains the game's code. Most of it seems to be from modders, but at least I've never had any problems getting the code from there. I personally use Jupitersh since it's very well-updated. 5. That's the hardest part to understand at first, but it seems I've got it, so I'll share my perspective (although I don't know if it's true). Apparently, the game behaves as if your mods folder were inside the game's root folder, so it searches for things as if it were searching for them itself. For example, if you want to make a prefab, you have to put things in scripts/prefabs; if you want to put your animations, you have to put them in "exported" and the game will automatically create a folder called "anims," and so on with most things. 1 Link to comment https://forums.kleientertainment.com/forums/topic/167662-does-anyone-know-if-it-would-be-possible-to-make-a-custom-character-be-able-to-tame-animals-like-how-wurt-and-webber-can-tame-mermsspiders/#findComment-1832528 Share on other sites More sharing options...
toddpool Posted August 22, 2025 Author Share Posted August 22, 2025 2 hours ago, FerniFrenito said: 1. That depends on the mob. For example, Hounds have a function to follow a leader. I assume they don't target the leader. This way, you could get them to follow you and, when you take damage, have them attack the one who damaged you (like Abigail). 2. No, the brain.lua file is a game file itself, you don't have to add it, just import it into your code if necessary and use the functions it has. 3. You can achieve this with prefabs. Technically, you can create any object you want without any limitations thanks to our access to the game's source code. The best way to learn is to download another mod that implements something similar to what you're looking for and see how the creator did it. To get you started with prefabs, I recommend this mod: Sword MOD for DST. It goes without saying that mods are installed in one of these two folders: "C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Together\mods" or "C:\Program Files (x86)\Steam\steamapps\workshop\content\322330" 4. You can search for a GitHub that contains the game's code. Most of it seems to be from modders, but at least I've never had any problems getting the code from there. I personally use Jupitersh since it's very well-updated. 5. That's the hardest part to understand at first, but it seems I've got it, so I'll share my perspective (although I don't know if it's true). Apparently, the game behaves as if your mods folder were inside the game's root folder, so it searches for things as if it were searching for them itself. For example, if you want to make a prefab, you have to put things in scripts/prefabs; if you want to put your animations, you have to put them in "exported" and the game will automatically create a folder called "anims," and so on with most things. How do enable that function? And how do functions work in general? Every tutorial for modding I've seen doesn't really mention what functions are, how to use them, and how they work. What part of the code would I have to import it into? I already know where to find the game code, I just meant I didn't really know how to read it. I know each item and entity has it's own lua file but it's just the code itself I don't know ow it works. It's all just so confusing trying to code without knowing what anything means or does, I appreciate the help though. Link to comment https://forums.kleientertainment.com/forums/topic/167662-does-anyone-know-if-it-would-be-possible-to-make-a-custom-character-be-able-to-tame-animals-like-how-wurt-and-webber-can-tame-mermsspiders/#findComment-1832542 Share on other sites More sharing options...
FerniFrenito Posted August 22, 2025 Share Posted August 22, 2025 2 hours ago, toddpool said: How do enable that function? And how do functions work in general? Every tutorial for modding I've seen doesn't really mention what functions are, how to use them, and how they work. What part of the code would I have to import it into? I already know where to find the game code, I just meant I didn't really know how to read it. I know each item and entity has it's own lua file but it's just the code itself I don't know ow it works. It's all just so confusing trying to code without knowing what anything means or does, I appreciate the help though. First, I recommend learning programming because making a mod for DST breaks down into two worlds: what you can do with the Lua programming language and what you can do with what's already in the game. I recommend using an AI to guide you through the programming language (because, at least to me, the Lua documentation has always seemed awful) and using GitHub to see what's already in the game. You can tell the AI to explain what each thing does in general and thus gradually understand the game code. I can't explain everything you need to know about the language because it's a lot, but I will tell you some important things: When you declare a variable as "local," it will only exist until the "end" that indicates the end of the block. local my_class = Class(other_class, function() local counter = 0 while (counter < 10) do counter = counter + 1 local hello_world = "Hello world " print(hello_world) -- print hello world print(counter) -- print actual counter value end print(hello_world) -- Error, hello_world doesn't exist here print(counter) -- print counter value after the while loop (print 10) end) When you call a function like this: object:function(arg1, arg2) the function actually receives three parameters: self, arg1, and arg2, where "self" contains "object" (the one that called the function). In Lua, files can return an object or a function, which is why many files in the game return a function, a class, an instance of a class, or even an array. So, to implement code you need and don't have anything that can call it, you use: local my_call = requires "path/of/file" And if it's a .lua file, you shouldn't put .lua in the path. 2 Link to comment https://forums.kleientertainment.com/forums/topic/167662-does-anyone-know-if-it-would-be-possible-to-make-a-custom-character-be-able-to-tame-animals-like-how-wurt-and-webber-can-tame-mermsspiders/#findComment-1832562 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now