Litlej86 Posted December 16, 2018 Share Posted December 16, 2018 Can anyone tell me what i need to get started? I am literally trying to learn and modify a few items and create very simple items. The items already exist in the game i just need to port them over from shipwrecked to DST. I just need cactus armor. Link to comment Share on other sites More sharing options...
Ultroman Posted December 16, 2018 Share Posted December 16, 2018 (edited) Of course, starting with a LUA crash course is a good thing to do. Notice that there are elaborating guides on the left side of the site. Good sources for learning are the API wiki and the API examples. The Guides thread and the Getting Started With Modding thread are also full of good information. Get yourself Notepad++. It's a great text editor, with many nice functions. For example, CTRL+SHIFT+F lets you search for text in all files within a folder, which is SUPER useful for finding out where things are used in the game files. It also has syntax highlighting for LUA files, which makes them infinitely easier to read. If it doesn't detect the language as LUA automatically, you can just go to the "Language" menu at the top and choose it. Really, the best way to learn, is to look at how simple mods are made. You can take a look at my Metabolizer mod. It's insanely simple, and the first one I did. It just changes a tuning-variable. These are variables set in the tuning.lua file, and are used all over the game code. It's damages for weapons, health for creatures, sanity cost of things etc. That mod will let you see very clearly how to set up the modinfo.lua file, how to add a simple setting to the mod, and how to read it in the modmain.lua file. If you want to look at the game files, go to your game folder, and find the "databundles" folder in the "data" folder (steamapps\common\Don't Starve Together\data\databundles). Find and extract the "scripts.zip" file somewhere on your harddrive. This contains the code for all the prefabs (monsters, items, players etc.), and all the components used for these prefabs (health, sanity, hunger, combat, edible, lootdropper etc.), brains (AI) and stategraphs (behavior and actions) and everything else. All things in the game are simple entities, with components on them which are updated or called by the game, to update their status or let them react in some way. These components include the movement, loot-drops, being able to freeze or catch fire, and even BEING a fire, or having an inventory, being edible, emitting light, having a set number of uses etc. Much is done using events called in these components when things happen, like the "death" event which is called by anything with the health-component when it dies. You can listen for these events, and if you've registered to listen for an event, you can have the game run a custom piece of code when it happens. Anyway, you're looking to make an item mod, so after you've learned the basics of what makes up a mod, e.g. from the Metabolizer mod, find an item mod that adds just one simple item, like this one. Look how that's done. Then you can start to take a look at that big mod you want to copy the Cactus Armor from, and see if you can Frankenstein your own mod with just the Cactus Armor in it, using the code and files from it. Good luck! Edited December 16, 2018 by Ultroman Link to comment Share on other sites More sharing options...
Litlej86 Posted December 18, 2018 Author Share Posted December 18, 2018 where do i even find the mods to start modifications? Link to comment Share on other sites More sharing options...
Ultroman Posted December 18, 2018 Share Posted December 18, 2018 On the Steam Workshop. The game downloads the mods to the mods-folder in your game files. Look at the URL at the top of Steam when you're looking at a mod. It will have the mod id, which is also used in the folder names for the mods. Link to comment Share on other sites More sharing options...
Litlej86 Posted December 18, 2018 Author Share Posted December 18, 2018 thanks I seriously cant find the location. I subscribed mods on steam. I cant locate them to pull code to transfer. I found an armor mod to modify but cant find coding for the cactus armor itself because i dont have access to any mod with the cactus armor. I am i just dumb am i missing something? do these mods actually not download? cannot i not access them? Link to comment Share on other sites More sharing options...
Litlej86 Posted December 18, 2018 Author Share Posted December 18, 2018 nevermind mod complete i think i need to upload it now Link to comment Share on other sites More sharing options...
Litlej86 Posted December 18, 2018 Author Share Posted December 18, 2018 Its official i quit lol. Link to comment Share on other sites More sharing options...
Ultroman Posted December 18, 2018 Share Posted December 18, 2018 What happened? Go to your Steam directory. steamapps/common/Don't Starve Together/mods Did you upload it? Link to comment Share on other sites More sharing options...
Litlej86 Posted December 18, 2018 Author Share Posted December 18, 2018 i did but it wont populate when i play. i need the mane script when you open the mod folder once that is built i should be ok. i lied im still trying lol Link to comment Share on other sites More sharing options...
Ultroman Posted December 18, 2018 Share Posted December 18, 2018 It won't populate? You mean it doesn't download the mod? Sometimes it takes up to 2 minutes before mine show up. It takes quite a while for it to update the mod-list. Link to comment Share on other sites More sharing options...
Litlej86 Posted December 18, 2018 Author Share Posted December 18, 2018 I was missing the whole main script in the file. I am building it now using a thorn armor mad i found of steam. I am building building the recipe i hope it works this time. I just uploaded it. I am going to test it now. Link to comment Share on other sites More sharing options...
BakaSchwarz Posted December 18, 2018 Share Posted December 18, 2018 I wish you the best of luck and don't give up! You can do it if you try long enough. A lot of DST modding (and programming in general) is trying over and over again and debugging errors. It can be frustrating, but it will pay off in the end. Link to comment Share on other sites More sharing options...
Ultroman Posted December 18, 2018 Share Posted December 18, 2018 Does it work, then? Seriously anxious now Link to comment Share on other sites More sharing options...
Litlej86 Posted December 18, 2018 Author Share Posted December 18, 2018 i messed up a few lines of text fixing it now Link to comment Share on other sites More sharing options...
BakaSchwarz Posted December 18, 2018 Share Posted December 18, 2018 Yeah, seems like a typo. What really grinds my gears is that you always need to restart the whole game when something crashes. A debug mode would be awesome... Link to comment Share on other sites More sharing options...
Ultroman Posted December 18, 2018 Share Posted December 18, 2018 Attach a zip of your mod if you want help with this. Link to comment Share on other sites More sharing options...
Litlej86 Posted December 18, 2018 Author Share Posted December 18, 2018 i was copying existing code from the other mod i think i have way to much code in the script that isnt needed amor_cactus - Copy.7z Link to comment Share on other sites More sharing options...
Litlej86 Posted December 18, 2018 Author Share Posted December 18, 2018 i just realized it didnt save any of the changes i made to the script. time to start over. here is my most updated i pulled the script from shipwrecked to make it easy but i know there is an issue somewhere but its off to work. amor_cactus.7z Link to comment Share on other sites More sharing options...
Ultroman Posted December 18, 2018 Share Posted December 18, 2018 (edited) 1 hour ago, Litlej86 said: i pulled the script from shipwrecked to make it easy but i know there is an issue somewhere but its off to work. I could imagine. You can't just copy a whole item over from Don't Starve. Luckily this one should be sort of easy. Fixed it. armor_cactus.lua modmain.lua Edited December 18, 2018 by Ultroman Link to comment Share on other sites More sharing options...
Litlej86 Posted December 18, 2018 Author Share Posted December 18, 2018 how far off was i? lol Link to comment Share on other sites More sharing options...
Ultroman Posted December 18, 2018 Share Posted December 18, 2018 Changes: - Added the networking stuff. - Changed the foleysound path, because the path you had was for sounds in DS, and they've changed it for DST. I also changed the foleysound to use the sound for the log armor, since the one your code was referring to does not exist in DST. You can change it to whatever sound you want. Perhaps the same one the grass armor uses? - I also made it play a sound when you block something with the armor. Copied the one from the log armor. Again, you can look at the grass armor or any of the other armors, to see which sound they use, and use one of them instead. Or you can go get the sounds used in the other mods, and add them to this mod. - I added the missing TUNING variables, with the values they had in Shipwrecked. (0.8 or 80% absorption, 450 "health" and 17 damage). - Removed unneeded lines in modmain, but added some other ones. Be careful, though. Because your recipe requires a "needlespear" which is only available in your mods "Tropical Adventures" or "More items and whatever", your mod actually requires one of those mods. That is something you have to inform your users of, and you can actually add a dependency to your mod on Steam. Tell your wife that you did it all. You deserve it Link to comment Share on other sites More sharing options...
Litlej86 Posted December 18, 2018 Author Share Posted December 18, 2018 thanks alot Link to comment Share on other sites More sharing options...
Ultroman Posted December 18, 2018 Share Posted December 18, 2018 I HAVE TESTED NOTHIIIIING!!!! Link to comment Share on other sites More sharing options...
Litlej86 Posted December 18, 2018 Author Share Posted December 18, 2018 i will change the recipe to use cactus flesh instead of spikes due to dependency. thank yuou so much. I learned alot from this little adventure lol ohh i will test and fix thanks though lol doesnt work lol i will try again later Link to comment Share on other sites More sharing options...
Ultroman Posted December 18, 2018 Share Posted December 18, 2018 That's good! It's always good to learn something new. Especially programming!! I've been modding for quite a while, so I have some little cheats I use to make things go faster. I always keep a full copy of all the script folders from all the game versions (DS, RoG, SW, DST, HAMLET), from the last time I updated my mods. Then, whenever they update the game, I can cheat by using Beyond Compare to compare all the files and folders side by side, and see exactly which files were changed, and which lines were changed. This helps A LOT, because I know I've only changed stuff in very few files, so I mostly keep an eye on those. Also, getting familiar with Notepad++, especially taking advantage of its side by side functionality (e.g. right-click a tab and select "Move to other view") is just priceless, so you can have your code on one side, and look at the game code next to it. Anyway, happy gaming! There is no cactus flesh to be had in DST. There are only cactus, oasis_cactus and cactus_flower. 1 Link to comment 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