Search the Community
Showing results for tags 'tutorial'.
-
Hello. I have learned how to use Ktools by accident. Maybe I am so bad at everything that I didn't find solution for my issue in main Ktools topic, or whatever. If you have the same problem you probably click "krane.exe" twice and nothing happens. You can use Krane to decompile "anim.zip" into folders with images and .scml file from Spriter. Tutorial Part 1. Extract files from "ktools-4.4.4-win32.zip" to desktop. It should create folder called "ktools-4.4.4", rename it to "ktools". It must look like this after opening. Part 2. Open path marked with red color (your game directory) and follow up to anim folder. It will be full of .zip files. Let's find an "axe" for instance. Then open it ... ...and copy all 3 file types into your "ktools" folder in the desktop. Part 3. Press Windows (key on your keyboard) + R, then type "cmd" (console should pop up) Type "cd desktop/ktools", press "Enter" key Type "krane anim.bin build.bin name" [name -> name of folder you want your files to be decompiled into] After while you will see this Part 4. Open "ktools" folder and your "name" folder will be waiting for you. Open it. You will see .scml file and folder. That's it. I hope someone might find it useful. New community members for instance, without knowledge and experience in all this stuff. (I can't delete this picture below. Just ignore it.)
-
Hi everyone, a few years back I had written a tutorial on creating custom skins for modded characters. Today that tutorial becomes deprecated as the Revamped Modded Skins API created by me and some others makes its release. This API will make it easy to add both skins for characters and items/structures. I’m very happy to present this new API to you all and I hope you enjoy it too, as it comes with custom art for new rarities, frames, and even a custom skin unlockable system for modded skins. This will be a multi-tutorial post, so be sure to check out the table of contents and find what you’re looking for! Thank you @Fidooop, @Cunning fox, and @Dudedude for helping to develop the API and having me hop on board. Here is the API related to the topic! Modded Skins [API] Table of Contents: Creating Custom Skins for Modded Characters Creating Custom Skins for Modded Items Miscellaneous Adding an event icon to your custom skin Making a Modded Skin Lockable Setting Custom Offset/Scale for Clean Sweeper effects Compatibility with Mods in Menu Resources Some quick important notes: All of the skin id’s(aka the names of the skins in the code) you choose for your skin should start with “ms_”. For example, an appropriately named skin would be “ms_whimsy_victorian”. (The default ‘_none’ skin is excluded from this rule, however) This tutorial will assume you have your skin assets ready to go if you’ve created a modded item/character before. If not and you are completely unaware on how to create items and character builds in the first place, it is likely you’re not ready for this tutorial yet. I’ll be using my friends character mod as an example throughout the tutorial :), @-Variant, love u bb. Creating Custom Skins For Modded Characters Creating Custom Skins For Modded Items/Structures Miscellaneous Resources And also! Let me know when you've got a mod compatible with the API! So that I may add it to the collection of API compatible mods :>
- 109 replies
-
- 19
-
-
-
-
-
-
-
-
This is a guide for creating a simple music mod using TheScraps' tutorial mod for looping working music and Klei's Official Music Mod tutorial. (This mod is for anyone who is either confused or want to know how to make music mods.) What you will need: A text editor. (Possibly Notepad ++, but sometimes it could be down. So, look for an alternative you can't use or access the website.) Don't Starve Mod Tools (Download through Steam. Directions below.) TheScraps' tutorial mod (Might need WinRAR if you aren't able to open .rar files) Klei's Official Music Mod tutorial (Workshop mod or through the forums.) Audio that you would want to use (More info below.) Location for Mod Tools Click Library, then click Tools. Then find Don't Starve Mod Tools and download the files. Making your FMOD Project: When you open the tools, you are prompted with this message: Select the Launch FMOD Designer option from the list. When it launches it will be a blank project. The next part is simple. All you need to do is download the two mod tutorials. Once that is done, you will want to open the project data for Klei's mod. The file location should be in your steamapps/common/dont_starve/mods/workshop-180938116/sound_source For people who do not own Don't Starve: For people who do not own Don't Starve, they will have to go to their Music Mod Tutorial page. It's similar to TheScraps' mod tutorial. Just open the zip and extract. Next, you should open the .fdp and you'll be greeted with this screen: Once you are there, you should begin by deleting the gramaphone_... events (Except the gramaphone_ragtime) Once you have deleted the gramaphone_... events, add an event called jukebox. Then, delete music_dusk_stinger crazy and music_test_parm. (Look at the image from above about the gramaphone events.) Now for the next part. You have to copy and paste these events as follows: music_danger music_epicfight music_work These musics have Autumn, Winter, Spring, and Summer alternatives. (Autumn uses the music_work, music_epicfight, and music_danger events.) The procedure goes as follows: First, you must copy and paste the events three times for the music_danger and music_epicfight. For the music_work, you must copy the event eleven times. Then you must rename the event to the following for each copy: music_danger_winter music_danger_spring music_danger_summer For music_epicfight: music_epicfight_winter music_epicfight_spring music_epicfight_summer For music_work: music_work_dusk music_work_night music_work_winter music_work_winter_dusk music_work_winter_night music_work_spring music_work_spring_dusk music_work_spring_night music_work_summer music_work_summer_dusk music_work_summer_night Now, that you have renamed all these tracks, the next part is replacing audio. The way to replacing audio is that you must right click on the audio clip which is called, /none, and click Replace sound... Then click Add sound file... Then look for the file location for your audio and add it into the sound. Then, select it and click OK. (You can do this for all audio in here, except for jukebox.) For jukebox: Then, add your sounds from your file location. Finally, go to your Banks. From there, you can try to use this compression method. If it doesn't work for you, try changing the Compression. Make sure you save your project always because occasionally the app crashed randomly. (It could be caused by anything.) Now, there are some other audios you can add to these, such as DST_theme_portaled, which is used for the lobby. Just copy and paste the music_FE for it. I will leave my whole list of events for reference: Now, you must Build the music_mod.fsb and music_mod.fev. Use Ctrl-B to build the project. The building will take a while to complete (Based upon on what extension you used for the music. .mp3, .ogg, etc.) (.ogg is the best in my opinion.) When it is done, it should be located in a folder called sounds, where ever you saved the project. If you cannot find the folder then build again, but before you do it, click Output >> Put .fsb and .fev in a folder called sounds in your Mod's folder. Making the script: For this one, I'll just give you a already created modmain.lua (file at the end) so I don't have to explain every single detail. (It's really late the time I'm posting this.) If you want me to explain this procedure, comment and I'll reply. In TheScraps' mod, he includes a scripts folder. Copy that folder and place it into your mod's folder. Finally, copy the modinfo.lua file into the folder and edit it. (Note: This is my mod info.) What you will want to do is rename anything that is in the quotes to whatever is needs to be named. (forumthread = "" is used if your mod is a Workshop item.) DO NOT mess with anything under configuration_options. The title says it all. Finally, you can boot up your game and test out your mod from the client mods section. If any of you have any problems with this tutorial, please leave a comment and explain your problem. I hope this helped anyone in need. Sorry if I rushed the end of this tutorial. It was around 3:00 am when I finished writing this. Thanks. modmain.lua (IGNORE THESE LAST PICTURES. I COULD NOT REMOVE THEM.)
-
Hello and hi! I haven't seen a lot of tutorials on the subject of creating custom mobs, outside of some really old mod-tutorials by Cheerio (I think), like explaining brains, behaviours in-depth. So, here I go, making this tutorial for beginners trying to create their own mob. First of all I would like to say that creating an entirely unique mob takes time, and by unique I mean a mob with a unique mechanic, attack, behaviour etc. as it requires you to create a more complex brain, possibly a new component or a behaviour, and that takes time. In this tutorial I'll be focusing on a simple mob, without any special qualities. Worry not however as this does not mean that this tutorial won't cover much. There is a lot to cover. Notice: I've never modded in Don't Starve specifically, only Don't Starve Together so if what I'm about to present doesn't work in Don't Starve, know that you've been warned. Let's start with a quick summary: 1. What to expect? 2. What is a prefab? 3. What is a brain? 4. What is a stategraph? 5. Behaviours? Don't we already have a brain? 6. A component. 7. Creating a prefab for a mob. 8. Creating a brain. 9. Creating a stategraph. - - - - - - - And that's all! You can now spawn your mob in-game with either the console or the Too Many Items Plus mod. But wait! Why is it called MISSING NAME? That's because you have to add the appropriate strings into the strings table in modmain.lua: GLOBAL.STRINGS.NAMES.CUSTOMMOB = "Custom Mob" GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.CUSTOMMOB = "..." GLOBAL.STRINGS.CHARACTERS.WILLOW.DESCRIBE.CUSTOMMOB = "..." GLOBAL.STRINGS.CHARACTERS.WOLFGANG.DESCRIBE.CUSTOMMOB = "..." GLOBAL.STRINGS.CHARACTERS.WENDY.DESCRIBE.CUSTOMMOB = "..." GLOBAL.STRINGS.CHARACTERS.WX78.DESCRIBE.CUSTOMMOB = "..." GLOBAL.STRINGS.CHARACTERS.WICKERBOTTOM.DESCRIBE.CUSTOMMOB = "..." GLOBAL.STRINGS.CHARACTERS.WOODIE.DESCRIBE = "..." GLOBAL.STRINGS.CHARACTERS.WAXWELL.DESCRIBE = "..." GLOBAL.STRINGS.CHARACTERS.WATHGRITHR.DESCRIBE = "..." GLOBAL.STRINGS.CHARACTERS.WEBBER.DESCRIBE = "..." GLOBAL.STRINGS.CHARACTERS.WINONA.DESCRIBE = "..." GLOBAL.STRINGS.CHARACTERS.WARLY.DESCRIBE = "..." GLOBAL.STRINGS.CHARACTERS.WORTOX.DESCRIBE = "..." GLOBAL.STRINGS.CHARACTERS.WORMWOOD.DESCRIBE = "..." GLOBAL.STRINGS.CHARACTERS.WURT.DESCRIBE = "..." GLOBAL.STRINGS.CHARACTERS.WALTER.DESCRIBE = "..." GLOBAL.STRINGS.CHARACTERS.WANDA.DESCRIBE = "..." NAMES for the mob name and the rest, each for one character. The dots are a placeholder. And now you're done! You can play around with the brain, components, maybe behaviours, and create a more complex creature. Looking through the code of already existing creatures is a very good practice. It will help you discover new ways you could code your mob. - - - - - - -
-
Getting Started: Guides, Tutorials and Examples So you want to create a mod for Don't Starve. That's awesome! Hopefully this collection of guides, tutorials and examples will help you on your quest. Just remember that modding is all about getting your hands dirty. Oftentimes you will have to figure out things for yourself. So dive in, give it a go and when get stuck, the forums are your friend. But most of all, make sure to have fun and please share your creations with the rest of us! Getting Started: How To: Install and Use Mods by CheerioBefore you Begin! by tehMugwumpModding Etiquettte by JanHTroubleshooting by tehMugwumpMod API Updates: API 6 and Post-Reign of Giants Modding (including new important pieces of modinfo.lua) by SethRArt:Using Extended Sample Character Template by DleowolfThe Artist's Guide To Character/item Modding by TheDanaAddamsA Simple Guide to Spriter by TheDanaAddamsDana's Tips for Mod Art by TheDanaAddamsA No-Talent-Hack's Guide to Art by NycidianOfficial Spriter Tutorials by BrashMonkeySpriter Source Assets by CheerioSpriter Example: Equippable Item by CheerioSpriter Example: Hat by CheerioCreating a "Handslot-Equippable-Item" from Scratch by MalacathMinimap Icon Sample by MalacathMaking a Custom Set Piece by JackSlenderEasy Character Art Tutorial by Cheerio2D Animation at Klei by Jeff Agala and Aaron BouthillierCreatures:Creature Mod Tutorial 1 - Creating a Mod by CheerioCreature Mod Tutorial 2 - Spawning a Creature by CheerioCreature Mod Tutorial 3 - Importing Animation by CheerioCreature Mod Tutorial 4 - Locomotion by CheerioCreature Mod Tutorial 5 - Stategraphs by CheerioCreature Mod Tutorial 6 - Brains by CheerioCreature Mod Tutorial 7 - Importing Sound by CheerioCreature Mod Tutorial 8 - World Spawning by CheerioScripting:Intro to Programming by Khan AcademyWots the Diff?? Prefabs, Components, Stategraphs, and Brains by IpsquiggleAPI Examples by IpsquiggleSample Mods by IpsquiggleScripting with Sublime by CheerioTips for Scripts by CheerioProfiling by CheerioEngine Architecture by KevinExample: Follow the Leader by CheerioCode Tips and Tricks by squeekSharing your Mod:Steam Workshop Uploader by IpsquigglePosting and Downloading Mods by moistedparanoiaSound:Sound Mod Tutorial by Cheerio Music Mod Tutorial by CheerioAdding Custom Sound to Your Custom Character by MalacathTranslation:Creating a translation using the PO Format by BigfootLanguage Sample Mod by IpsquiggleMisc:Asset Tools by IpsquiggleMod Tools Github Repo With Source by CheerioDownload Mod Tools for Windows by Cheerio
-
Here's my collection of good threads/posts with great content, either explanations or code snippets. You will also find many other tutorials by following the links in the Forum Subsections paragraph below to the other tutorial collections on the forum. I keep adding to this list in a text file on my computer anyway, so I might as well keep the list here for everyone to peruse. Klei ppl: It would be awesome if this could be put in a state where it did not get archived, so I can keep updating it. UPDATE: Thanks for the pin, @JoeW! >> Link to the Newcomer Intro Post << The Newcomer Intro Post has a lot of basic information you need to start modding, plus a bunch of great tips, for example about how to debug your mods and how to search the forum effectively. Also contains links to various other resources, some similar to this thread, where you can find even more great information, albeit most of it is older than most of the things in this post, but there is still a lot of great information to find. If you're making your first player character, start by looking at the first 4-7 links in the "Player Character Stuff" section below AFTER you've been through the newcomer post. 2021 update: It has come to my attention, that the tutorials are slowly being lost to automatic archiving on the forums. Since only pinned posts and those in the "Tutorials and Guides" section seem to stay alive, I'll start converting the scattered posts into actual tutorial threads, starting with the oldest ones. Many of them need a dusting, anyway. Forum Subsections DS "Tutorials and Guides" Section DST "Tutorials and Guides" Section Link to Recezib's excellent "Guide to getting started with modding for DST (and a bit for DS, as well)" post, similar to the newcomer post, but with MANY more details. I can't guarantee that all the information in there is up-to-date, though, since the post is from December 2014 and links to other posts just as old. Link to Cheerio's old, but still good, "Guide to getting started with modding for DS" post, again similar to the newcomer post, but with many more details. I can't guarantee that all the information in there is up-to-date, though, since the post is from 2013 and links to other posts just as old. General Stuff Modinfo Guide Modicons Explanation of events and event parameters (by Serpens) Custom events Exporting music Original Music Mod tutorial (Here's a post where some person helps another person who is having trouble with this tutorial) Check if world has caves Saving and loading data for a prefab Make prefab a light source AoE Damage / Explosion Guide to differences between DS and DST modding and converting mods between the games Player Character Stuff Big Book On Character Creation - (full guide to creating a character mod for DST, written by user C_Thun) Extended Character Template Extended Character Template Fixes Extended Character Template "Remaster" (an updated guide to the Extended Character Template; I have not tried this one) Guide for character modding on Mac Making Custom Skins for Modded Characters Reskinning and Animation Guide (full guide to making a mod that reskins a monster; great source for anything with textures; redirects to a Steam Community post) Custom Character Sounds Player starting items Making basic perks (most of them are for DS only; 40+ different ones; haven't tested them, personally, but they seem legit) Making buffs (simple buff framework with examples incl. movement speed, max-health increase and damage modifier) Using the sanityaura component Affecting sanity in a dynamic way, using a custom sanity rate function and e.g. listeners Auras (can be added to any entity; the example is written for custom entities, but can be changed to be added to non-custom entities) Sanity gain or drain when around another character or certain entities (the example is a character prefab, but it can be changed to any prefab / tags you want) Custom Sleeping Stats For A Character Character transformation / beast-form Levelling system Crafting and Food Stuff Making a recipe character-specific. Also duplicating crafting recipes, plus other stuff How Cookpot Recipes Work Fun With Food (shows several different ways of changing the way food works, also character-specific changes) Item Stuff Make it so no one else can pick up a custom item (like Thor's hammer) Make an armor have 100% damage absorption against certain mobs Life-steal Creating HANDS item from scratch [Template/Tutorial] Custom crafting tab and items How to make Drying Racks
-
I. Introduction As we all know, Don't Starve(DS) and Don't Starve Together(DST) animations are composed of 3 parts, each being separated: anim.bin, build.bin and atlas-0.tex. But it is very usual than the layers in anim.bin does not match those in build.bin and atlas-0.tex. While there is no immediate tool to solve this problem, there are two indirect methods. II. Tools 1.autocompiler.exe It can be found in Don't Starve Mod Tools. You can find it in Steam's library or Github (maybe not up to date) or this forums. All other tools can be found here (my platform is Windows 10 x64, I have only tested them myself): https://forums.kleientertainment.com/forums/topic/142963-tool-some-animation-tools 2.Klei Anim You need animc.exe and animd.exe. There is an alternative in case you can't run the two applications. For decompiling, use python2 script deanim.py and debuild.py. For compiling, use enanim.py. However, the author of these scripts did not write a compiler for build.xml, the work is then done by buildanimation.py at C:\Steam\steamapps\common\Don't Starve Mod Tools\mod_tools\tools\scripts\. Python2 is already included in Don't Starve Mod Tools. 3.Notepad A text editor of any kind, like Notepad++, Notepad3, VS Code. 4.Ktools You need krane.exe to extract animation. 5.TEX tool or something that can view atlas-0.tex, not necessary. 6.Spriter III. Find Files In DST, most animation files are in C:\Steam\steamapps\common\Don't Starve Together\data\anim\, the same with DS. There are two exceptions with DST, DLC contents go to \anim\dynamic\ and \databundles\anim_dynamic.zip\anim\dynamic\. Most DLC contents are encrypted into an unextractable file *.dyn, but non-DLC contents are just an archive renamed to *.dyn. Therefore, wilson.dyn(aka. wilson.zip) can be extracted into some atlas-0.tex while wanda.dyn can't. There are some simple rules to name a file. The most obvious way to name a file is to name it the same as its prefab, like spider.zip. Next there can be some suffix like spider_basic.zip, spider_build.zip, spider_wolf_build.zip. Otherwise you can just open scripts\prefabs\*.lua to see how many animation files are registered, and the same with every other related prefabs. This may not be enough sometimes. IV. Decompile build.bin Extract each of *.zip to a folder, for each build.bin, decompile it into build.xml. Open build.xml and you see a lot of <Symbol> like Your task is to collect these <Symbol> from all the build.xml. If <Symbol> name collides, you can decide on your own which image you want to see according to those atlas-0.tex. Say you get a new build.xml loaded with all <Symbol>, and a <Atlas name="atlas-0.tex" />(This is required for krane.exe to proceed without error). Compile this xml into bin file. Now you get a new build.bin. If you use animc.exe just compile it together with any anim.xml. If you use buildanimation.py, make sure you do it correctly because I didn't try that way. V. Extract Images krane.exe demands anim.bin, build.bin and atlas-0.tex, so you need to fulfill it in order to get all images. The only thing you need to ensure is that anim.bin covers all layers in build.bin. Any of such anim.bin is capable. Or you can easily decompile and edit anim.xml and compile to create one. Say you have every atlas extracted. Now gather all image folders. VI. Extract Animation krane.exe demands anim.bin, build.bin and atlas-0.tex, so you need to fulfill it in order to get all animations. Use new build.bin that contains all layers. Use any atlas-0.tex. Say you get many *.scml, gather them (and rename them). VII. Clean Workspace In the above two steps krane.exe has generated many unwanted files. Just delete them. VIII. View them in Spriter Open *.scml in Spriter. Method2: IV. Extract Image krane.exe demands anim.bin, build.bin and atlas-0.tex, so you need to fulfill it in order to get all animations. The only thing you need to ensure is that anim.bin covers all layers in build.bin. Any of such anim.bin is capable. Or you can easily decompile and edit anim.xml and compile to create one. V. Gather Images Say you have many Spriter projects, open *.scml and gather <folder>. If folder name collides, you can decide on your own which image you want to see according to those images. Make sure <folder>'s id is unique. Meanwhile, gather images according to folder name. VI. Compile to build.bin Say you have a scml file with all folders included. Use autocompiler.exe to compile the Spriter project into a zip with anim.bin, build.bin and atlas-0.tex. VII. Extract Animation The new build.bin and atlas-0.tex contains all layers. Use them to extract anim.bin via krane.exe. VIII. View them in Spriter Open *.scml in Spriter.
-
General advices Need help? Be helpful! Add as much info and code as possible: too often do people omit modmain.lua and modinfo.lua or reduce the crash log to the last line. Upload the files you're working with. Link the guides and tools you're using whenever possible. Detail the steps you're following. Don't make people guess what you're doing. Be specific! Is it a crash? A new feature you want? Porting from DS? Trouble with animation? State it in the title so people who know about it can see it right away. "Help with my character" means essentially nothing since characters can do pretty much anything. Don't be a jerk. Being nice is usually a good way to get people to help you. Search the log for error. One of the first step when you have a problem with a mod is to take a look at the log. When a crash occurs, the log could provide you useful informations about what is wrong. You could find the log in C:\Users\YOURUSERNAME\Documents\Klei\DoNotStarveTogetherANewReignBeta (If you are in the beta branch) Or C:\Users\YOURUSERNAME\Documents\Klei\DoNotStarveTogether (classic branch) Usually, informations will be in the "client_log.txt" Sometimes, a crash will happen server-side, so you must look at the server log. Search in C:\Users\YOURUSERNAME\Documents\Klei\DoNotStarveTogetherANewReignBeta\Cluster_1\Master With "DoNotStarveTogetherANewReignBeta" your current branch, "Cluster_1" your current save, "Master" if the crash happen on surface, and "Caves" if the crash happen on caves. Look at the "server_log.txt" Now you have an error log. If you can, try to understand what the error log says. Some errors could easily be fixed by yourself. You could also try a search to see if someone encountered the same problem. If it's not the case, you could create a topic. Title. The first thing people will see is the title. There is a lot of topic asking for help, so "help pls with a mod", "I need help" "[URGENT] Need help" isn't a good title, because it doesn't give a clue about what the problem is. Since people helping here are doing this in their free time, and since every modder have his strong point and weak point, your best option is to have a clear title, with informations about what you are searching. This way, people able to help you could see what help you need even before opening the topic. For example "How to create a perk for my character" "My character mod is crashing (Mod and Error log in topic)", "How to make an aura healing others players ?". You will gain a lot of time with a clear title, and people will be more likely to help. Content of your topic. Your topic must contain a clear explanation about what you need. If you are asking for help because of a crash, provide the error log (you've seen before how to obtain it), and attach your mod, so people could take a look at it. You must zip your mod first, then you can see an option "drag files here to attach, or choose files". Attach the zip file. This way, everyone could download your file and see what is wrong. When searching the cause of a crash, looking at the code is often mandatory, so you'll gain a lot of time by attaching mod in your first post. Usefuls links and tools. [TOOL] Texture and atlas packer : a tool allowing you to easily pack or unpack texture. Great for inventory image containing multiple items images. [TOOL] HandsomeMatt's Tools : one tool allowing you to converting .png file into .tex, another one allowing you to open .tex file and save them as .png [TOOL] Build renamer : one tool allowing you to rename builds. [TOOL] ktools : allow to decompile animations in a spriter file. Useful, but you need some knowledge to make it works. [RESOURCE] DST Speech Mod Template : All the speech line in one file, useful for custom character. Tutorials : [TUTORIAL] Custom recipe/food visible in crockpot/farm [TUTORIAL] How to add, not replace stuff in worldgeneration [TUTORIAL] Basics : what to use to open .lua files and why [TUTORIAL] How to create a Set Piece
- 29 replies
-
- 17
-
-
-
This tutorial will teach you how to create a mod which replaces a sound in 'Don't Starve'. For this tutorial, we're going to replace the 'rabbit scream' sound with a 'bird scream'. This tutorial requires:- PC version of 'Don't Starve' and 'Don't Starve Mod Tools'- The 'Sound Mod Tutorial' mod installed through Steam Workshop or on the Klei Forum downloads. Tutorial:All sounds in 'Don't Starve' are called events. To replace an existing sound event, we need to create a new sound event using the FMOD designer and then tell the game to use that sound instead. Let's get started! To launch the designer, Double click on the 'Don't Starve Mod Tools' in steam: Now inside the designer, browse to your mod folder and open 'sound_mod_tutorial.fdp'. Next click on the events tab and scroll down till you find the 'rabbit_scream' event. Right click on the gray area under the word play list and click add sound. Add the 'bird_scream.wav' sound from the mod folder. Press 'CTRL+B' to bring up the build menu and click the build button. You can now close the designer. Browse to the mod folder and open up a file named 'modmain.lua' in your favorite text editor. Remove the two dashes next to the 'rabbit_scream' line and save the file. Now start the game and go chase some rabbits! Remember to enable your mod through the mods menu. Happy modding!
-
MODS IN MENU IS BACK, BABY! And this time, it's here to stay! No more hand-holding No more spammy tables in the modinfo No more crashing with every Klei update Now fully open with limitless capabilities Fully loads server mods on the clientside Able to access a mod's configuration Allows for Postinits, Prefabs, and Assets to be added Put characters in the main menu Insanely easy and user-friendly How does it work? I'll tell you! A brand new tab will appear in your mods menu. Click it and you'll be able to view mods that are compatible with Mods in Menu! And that's it! Click apply and you will be able to see changes that mod wants to make to the main menu! Ok, but how can I make my mod compatible? Simply add a modclientmain.lua file to your mod. Treat this modclientmain as if it were a second modmain that only loads clientside. (because it is) And that's it! Your mod is ready to access the clientside! Okay but in all seriousness though, there's a few important things I need to note and go over. Firstly, an explanation of what exactly is going on here to help those newer to code understand. Your modmain.lua file is essentially the starting point of your mod when it is loaded. It brings in assets, prefabs, and game changes, all starting from that single file. The new modclientmain.lua is essentially the SAME EXACT THING with all the SAME EXACT CAPABILITIES. However, it is loaded on the clientside via Mods in Menu! "Okay but why would I need that? I could just set my mod to be clientside!", I hear you audibly questioning from your brain. And I have an answer! Making your mod clientside will prevent it from being enabled serverside! This is bad for a modded character for example. This feature is mainly there for server-only mods to reach their characters and items into the main menu for users to enjoy more features! Now I've gotta cover some basic restrictions and changes that everyone should pay attention to. First, your mod's priority. It is very important that you do not reach this priority number (-2147483647) with your server mod as Mods in Menu MUST load after all server mods to prevent major issues. If you need your server mod to load on the backend then do -2147483646 instead. For those interested, all mods loaded by MiM will then load AFTER MiM using the normal priority rules. Next thing to note, is that when working with your modclientmain your goal is to use the absolute minimum code/strings/assets possible! The entire reason Klei originally moved server mods to not enable on the clientside is because they wanted to cut down on load times. Keep this in mind when working with your modclientmain and only require assets/code that is absolutely necessary for your character or changes to appear in the main menu as intended! Depending on your programming experience, there's a multitude of ways that you can use your modclientmain! Handle your modmain and modclientmain files completely separately. This is the easiest for those not too familiar with code but takes more time and effort to upkeep. Have both your modmain and modclientmain require a common file that will register all assets/prefabs/strings/etc that would otherwise be shared between both files. This makes upkeep nice and easy and it cuts out all repeating code. DO NOT DO THIS UNLESS YOU ABSOLUTELY KNOW WHAT YOU ARE DOING. Calling modimport("modmain") will load your modmain file, leaving the modclientmain practically untouched and load your full mod as intended serverside. This will be the optimally efficient way to handle your mod but things can go south quickly if you don't do it right, it can be dangerous. There are a couple IF checks to help out with the 2nd and 3rd methods to ensure you don't load serverside things on the client! --This variable gets added to your modding environment by Mods in Menu --Use this check to see if your file is being run on a server or by Mods in Menu if is_mim_enabled then --This is a check I found while building this API actually and it can prove to be quite helpful for mods enabled on both client and server --The gamemode will always return an empty string if you're in the main menu and not in-game if TheNet:GetServerGameMode() == "" then And that's all anyone needs to know really! Attached to this post will be a modclientmain file I whipped up as an example using the Whemy The Witch mod under the first handling method. IF THERE ARE ANY QUESTIONS, PLEASE FEEL FREE TO ASK HERE! SPECIAL THANKS TO: Erik for drawing the mod icon image (isn't it awesome looking?) Hornet for encouraging me and letting me use Hamlet characters as guineapigs Von for letting me use Whemy as a guineapig Get the API on Steam: https://steamcommunity.com/sharedfiles/filedetails/?id=2415978456 modclientmain.lua
-
Hello everyone. I know there are some tutorials that cover this topic, but in my opinion it might seem to be too hard to follow by fresh members of this amazing forum. In fact I have learnt a lot from those ancient manuscripts, so don't get me wrong. I will try to explain you how to create custom crafting tab and custom items (on head, body, hand slots). Template is ready to download in attachment section. I think you will spot differences between original ESCTemplate and my version with items, so it's self explanatory. I have described some stuff inside .lua files, but if something will cause you trouble just let me know in the comments and I will explain it further. I have used already existing armor and hat graphisc, because I am too lazy, but you can do whatever you want. In order to decompile anim from game you can use ktools: ktools: Cross-platform modding tools for Don't Starve 4.4.0 and if you don't understand it yet, check this out: [TUTORIAL] How to use Krane from Ktools Sources Work of the Old Masters -------------------------------- [Tutorial] Using Extended Sample Character Template [Tutorial] Creating a "handslot-equippable-item" from scratch Hat Example 1.0 I hope you will find it useful my dear Newcomers. Of course I forgot to attach template. There you go. Custom items and item tab [tutorial].rar UPDATED VERSION - Custom items and item tab [template] - updated 21.04.2021.rar What to do if your game doesn't crash but your custom item is invisible? 1. Make sure that you placed location of .zip file (inside of anim folder) under local assets={} function. 2. Make sure that you saved Spriter project (.scml) as [name_of_your_custom_item].scml and marked .scml file format.
-
tutorial [TUTORIAL] How to Add Talking Fonts to the Game
Lucemodok posted a topic in Tutorials and Guides
Hello, I'm Lucemodok and today I learned from @zarklord_klei how to load fonts into DST. So, first you need to download your font, any font will do as long as you can read it. Second, you'll need BMFont, it's a way to convert font files to bitmap fonts, which is what DST uses. You'll then need to open BMFont and open the font settings to select a font. After that, you need to set your font configurations, this is what I used. Next, open the export options and use this configuration. This makes your font work with DST and have an outline. After that, select save bitmap font as... and save it as "font.fnt" in whatever folder you want, a png with the name "font_0.png" should also appear there. Convert the png into a tex with any tex conversion tool you have, rename it "font.tex" and zip it along with the fnt into "talkingfont_yourcharacter.zip" for the game to be able to read it. Create a fonts folder in your mod folder, and put the new zip into the folder. Here comes the coding part. -- modmain.lua Assets = { Asset("FONT", "fonts/talkingfont_yourcharacter.zip"), } GLOBAL.TALKINGFONT_YOURCHARACTER = "talkingfont_yourcharacter" AddSimPostInit(function() GLOBAL.TheSim:LoadFont(GLOBAL.resolvefilepath("fonts/talkingfont_yourcharacter.zip"), GLOBAL.TALKINGFONT_YOURCHARACTER) end) Put that in the bottom of your modmain.lua and put the following in your character's common_postinit function. inst.components.talker.font = TALKINGFONT_YOURCHARACTER You should be done with your fonts, now you should test for any crashes. Enjoy! -
So you want to implement a voice for your character mod or import sounds for your items? Then let’s get started, this tutorial was created on the bases of the old tutorial back in 2013 but with don’t starve together coming around it wasn’t really updated to say the least. So this guide will more or less will be an update compared to the previous guide and hopefully be re-edited when an update gives us something new. Before we start a few tools are needed to follow this guide: What’s needed: · Don’t starve mod tools in steam (for FMOD Designer) · Notepad++ or some other coding api · Audacity (for this tutorial, you can use FMOD studio or some other audio editing program but it’s your job to know how to use it) · VLC media player (a converter from non mp3 to mp3 for audacity) · Some experience with dealing with sound files (mainly editing). · Highly recommended to view the getting stared: guides, tutorials and examples. Especially if you’re new to modding as this guide will require basic coding knowledge and patience. · Your own sound files for voice implementation/item sounds. Universally mp3 is used which is fine just one more conversion. · A sort of tool box from the last bullet in links. · Moderate modding experience for sounds on items as you’ll need to make decisions and this is where the files act more like a toolbox. Links: · https://notepad-plus-plus.org/ · https://www.audacityteam.org/download/ · https://www.videolan.org/vlc/ · https://forums.kleientertainment.com/topic/28021-getting-started-guides-tutorials-and-examples/ · Where it originated from: http://forums.kleientertainment.com/topic/27803-tutorial-adding-custom-sound-to-your-custom-character/ · https://forums.kleientertainment.com/files/file/1829-character-custom-voice-tutorial-and-custom-item-sounds/ Important numbers (all values come from wilson’s voice files): · A character’s talk voice will last on average 2 seconds, max 2.5 seconds. I don’t know how to extend the duration just saying it now. Recommended amount 7 sound files. · Emote voice averages 1.4 second. Recommended amount 1 sound file. · A yawn average 1 second. Recommended amount 1 sound file. · A hurt sound .5 second. Recommended amount 3 sound files. · A ghost sound 1 second average, 1.5 seconds max. Recommended amount 7 sound files. · A death voice 1.75 seconds. Recommended amount 1 sound file. · A pose 1.8 seconds. Recommended amount 1 sound file. A carol 13 seconds. Recommended amount 1 sound file. · A eye rub (also called sleepy emote) 0.6 seconds. Recommended amount 1 sound file. A sinking 2.8 seconds. Recommended amount 1 sound file · For a items it’s about 45 seconds max. Video: Character voice (if you have trouble know what to click refer to the pictures, green boxes = point of interest, yellow boxes = important sections): 1. Open the modmain and the first 20 lines should have all the lines of code for your character mod’s voice just replace all “characterprefab” with well your character’s name. If you’re doing don't starve only voice mod you can ignore lines 12-18 unless you plan to make it both don’t starve together and don’t starve compatible in the future. 2. Next open the characterprefab file under scripts-prefabs there will be only be a single line to put into your character lua file. Line 3 is for dst, while line 7 is for don't starve but the note above should be taken into consideration. 3. Alright disclaimer I don’t make custom music so you should have your own source of sounds to implement, most of my voices come from songs from the games I adapt my mods from. That out of the way open up audacity and vlc media player while you’re at it. If you already have your mp3’s ready go down to the next step, or if you have your .wav go to step 5. If you drag your sound file into audacity and get a window pop up then there’s a chance your file won’t come out as good as it should, then that’s why we have vlc media player open. Go to media-convert/save…-file-add…- and find your sound file in your computer. Select convert/save (not the drop down arrow) and a new window will open. Select the drop down arrow next to profile and find audio – MP3, next click browse to put your mp3 sound file, preferably a folder you won’t delete later and rename it to your meaningful name like character_talk1 and such (the name won’t matter). Then click start, if you have more files to convert this will become repetitive real quick as you don’t get all files you added converted in one go. So go back to the window where you add files, remove the top file you converted and keep going till you have all your mp3s set. 4. Note: I’m not much of a sound/signals kind of guy so the next part will only mention bare bones basic options. Now with audacity drag your mp3 onto the grey area and two wavelengths will appear. Here you can edit your sound files by shrinking them, increase the gain by some # dB (units: decibels comes from signals classes), and importantly convert mp3 to wav files. Go down to “Basics and Tips for audacity” and read up on your controls and along that read up on “Important numbers”. If you’re a music/signals kind of person you can use the effect on your menu bar and use fade out on your last milliseconds (by holding click and highlighting the wavelength) of your sounds to avoid the sudden silence at the end of your character’s speech. For beginners you can do an alternative fade out in the next step when I mention optional. When you think you get the right sounds with the right length go to file-export-export as wav- go to where you put all your sound files and save. 5. Let’s open up the characterprefab.fdp in the sound folder with fmod designer and check a few things. You can find fmod designer with directory: C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Mod Tools\mod_tools\FMOD_Designer once you get there use the application: fmod_designer (I’m saying this cause window 8 and above usually don’t know how to open applications any more, what happen to window 7 knowing what application was right for the job???). Alright once open you should go to events and from there open characters-characterprefab if it isn’t open, and click on the events (hurt,death_voice, etc) and go one by one to check for the following settings in the property-value table that’s on the far right hand side. Mode: 3d, 3D Rolloff: Linear, 3D Max Distance: 50. What does this do? We’ll it’s a common error in most mods that you can hear the character’s voice all throughout the world when they speak, with these options it’ll limit it to the maximum zoom out for your in-game camera. Optional (Recommended for beginners): set Fade out time: 150 to match the original’s character’s voice fading when their done speaking. Also it doesn’t sound good when your character’s voice goes dead silence in less than 0 seconds (or sounds that way). 6. After you check that property-value table then let’s start renaming the characterprefab with your character’s name. Click characterprefab, from there look at the property-value table on the right hand side and there should be the option: name, user properties, notes. On name replace characterprefab with your character’s name. Alright once that’s done we got another characterprefab to rename, go to the banks and on the left hand side click characterprefab and look at the far right where the property-value table comes up again. Go to name and rename it to your character’s name, no other options shouldn’t need to be edited unless you know what you’re doing. 7. Once that’s done I’ll say it now: IMPORTANT: Where you keep your sound files is where fmod designer will go to when you build the files, so places all the sound files in one place preferably somewhere you won’t mind them staying and won’t delete them. If you decide to re-edit the files in the future or the files didn’t come out the way to wanted and you delete them/move them, then you’ll have to either: put back the sound files where they were or redo the next step so cluttered desktops beware! 8. Go back to events and click on an event (hurt, yawn, pose, talk_LP, etc), in the center of the window there will be a box titled playlist with rand and sound subtitles there you’ll drag your respective sound files into there. Like your three hurt sounds inside hurt, your seven talk sounds inside talk_LP, and so forth. Optional: You’re free to right click a wav sound and set percentage, to give the chance that sound will play, plus use lock percentage if needed but unlock them when you’re done. Once you filled the events with your wav files (if you used mp3 or another format the game won’t recognize it) press control+B and select the bank with your character’s name on it (aka check the checkbox) and click build and rebuild. If it fails there’s a chance you put a non-wav format file or a wav file is missing. Otherwise if successful it’ll say build took *some sort of time, probably less than a few seconds*. After that’s done keep your fdp file around in case you mess up or need to do re-editing, otherwise cut the fev and fsb files in the sound folder and put it into your mod. You should create a folder named sound in the main directory of your mod and put the fev and fsb files in there. After that that’s all the mod needs and test it out. 9. If you don’t like the way they came out delete the bak file(if it exists), fev, and fsb and re-edit the sound file in audacity and redo step 8 till you’re happy with the way your character sounds. Items sounds (refer to the pictures above if your lost, yellow boxes = important sections, green boxes = points of interest): Note this section is meant for experienced modders as I briefly cover things that weren’t done in the character voice section. If you know how to put a voice for a character then this section is mainly the same and you’ll use the files like a tool box and use some of the lines you need and don’t use the ones you don’t need (like a restaurant menu, “omg there’s a lot of food!” waiter: “yeah just get the things you want, you don’t have to order it all”). If you want to start here just skim through steps 5 through 8 to get some idea of fmod designer otherwise I’ll briefly summarize. 1. Let’s go to sounds-structureprefab.fdp, this file can be molded into whatever you like (weapon sounds, food sounds, armor sounds etc.) but lets go through some small details. Go to events, expand the folder named structure (if it isn’t expanded already) and click event1, under the playback options (next to playlist) the repeating loop has been selected to repeat a single sound indefinitely. You can select oneshot for it to play only once, scrolling down to the very bottom allows you to play the playlist at random, sequential (one after the other) or shuffle, you can also click allow repetition if you desire. Next look at the far right where it has the property-value table and see the following: mode:3d, 3D Rolloff: linear, 3D max distance: 50, and fade out time: 0. The first 2 mention is just setup, the max distance is your main focus, at 50 is about the radius that sound can be heard which is about how far you can zoom out your camera in-game. You can change it to your desired range, the fade out time is the time your sound starts to fade out (again doesn’t sound good when your item goes dead silent in 0 seconds), but if you’re doing repeating loop it probably won’t be needed just pointing it out. The other events are set to oneshot, but if you need more than 3 events then go to the structure folder on your left hand side, right click the folder and click add simple event and give it a name (don’t worry about the template option) once that happens redo the property on that event (mode,3D rolloff, etc.) and set it up to the previously mentioned or your sound will be heard worldwide in the game. 2. Go to banks and select the folder structureprefab, there the property-value table will pop up again change the name as you wish. Notice in the center is where your filename (assuming you put it into the events playlist) with the directory of where it’s getting the sound file from, this should be noted if you comeback to re-edit it or make a mistake. The fmod designer will look at the same place to build the files and if you miss place it… well another headache will approach. So keep the folder somewhere it won’t bother you and you won’t mind it being there. 3. Now then if your not working on structures, then go back to events and click the structure folder and change the name under the value table to whatever you like (if you haven’t already done it). Same goes for the events click it go to the property and value table and rename it. Go to the banks and click the folder and rename it. After that’s done go to the menu bar click file-save project as and rename your fdp file to whatever you’re working with. Save and click control+B, the build project will pop up and your renamed bank should be there and click the check box. The click build and rebuild and your done with fmod designer. 4. Back to the file directory click on modmain, all you need is the assets on the bottom rename the structureprefab to your fsb and fev files (it should be the same as your fdp). And that’s all you need for your modmain, no remaping or extra code just cut it and put it to you modmain in your mod. 5. Now go to scripts-prefabs and open up the prefab you’re working with, is it a armor? A structure? Or a weapon? Well open the one you need and there is your restaurant menu with few default sounds used commonly in those files. Its recommended to read the weaponprefab for one of the notes, otherwise notes have been added to tell more or less what it is. And that’s it for the most part. Basics and Tips for audacity: 1. Your play back options and a record option if you have a microphone (it’s not needed for this guide just letting you know) 2. Your play back level or volume, all you need to know is that you want to avoid getting high levels of volume indicated by the color system (green for acceptable, yellow for warning, and red for high feedback). So it’s recommended to stay in the green instead of blowing out your ears or more importantly other people's ears out at red. 3. A quick menu for cut, copy, paste, trim audio, silence audio, undo and redo. For trim audio your pretty much cutting off the highlighted part (refer to 7) of the sound file out and keeping only that highlighted part. For silence audio is to well silence the highlighted audio, pretty self-explanatory. 4. Your zoom in, zoom out, fit selection, fit project in window, play at speed and playback speed. Fit selection zooms in to the highlighted section (7), and fit in project in window pretty much zoom out to fit the entire sound file. 5. Raise the gain or volume of the sound file, scrolling to the left lowers the volume of the entire sound file and right does the opposite (again don’t blow up your ears). The R and L just shifts the volume to the left speaker and right speaker just like in your car radio settings. 6. It’s a quick play section in which the name speaks for itself. 7. The highlighted section is done by clicking and holding down right click on the wavelength to edit it by using the commands at 3, 4 and referenced at 8. Since you’ll be trying to match the numbers mentioned near the top the start and end of selection but you can change it by pressing the drop down arrow and using start and length of selection to save you some math work. The audio position isn’t too important just where the marker will start to play not much to say. 8. The start time and end time of the highlighted (7) wavelength by default. You can edit by clicking the number place (ones, tens, hundredths, etc.) and typing it in. The drop down gives a variety of options but for the most part start and length of selection will be your go to option. 9. This is a bit advanced for basic needs just match around 44100 hertz (if it isn’t there) to avoid some problems down the road. (I haven’t tried lower or higher that much but using default isn’t a bad idea). · Tip editing (8) the start time will affect the end time making it annoying if you’re trying to move up the wavelength · Pressing file-new is a good way to paste wavelengths that were copyed/cut but beware after constantly using file it’ll crash later down the road. · The quick play (6) will play automatically, just a head up. · Effect on the menu bar has a variety of options in modifying your sound file, the fade out is a option that can be used multiple times to make sounds gradually go to silence vs dead silence right away. Otherwise the other options are bit too advance for me to speak of. · When saving a edit metadata tags window will pop up for the most part it’s not very important and doesn’t require any options to be edited. Just a fancy way of organizing in short, press ok is all you need. · Rebuilding creates a fev file so if you're wondering where it is, you forgot to rebuild. If there’s any mistakes or steps I missed comment below and I’ll make the necessary changes. Changes to the thread may/will be made especially that DST is still developing and chances are more character sounds will be implemented.
-
Version 1.15
414 downloads
Note: this file will not run as a independent mod, its more of a toolbox if anything. Also its recommended to have some modding experience as the tutorial isn't beginner friendly. This file is a tool box and template for making custom character voices and other item sounds as well. It contains a few common armor, structure, and weapon sounds that the base game uses, along with notes about them that may prove useful. The code is preset to follow the lua files stored inside so its less of a hassle trying to start from scratch. Last this file is subject to updates to keep up with don't starve together adding more types of voices like emotes, pose, and ghost voice. Tutorial: -
Before I begin with this guide, I have to mention the previous guide I wrote back in 2019. If at anytime you want to view that guide, go to it either using the URL or click on the window below: For this guide, I will be showing how to download the Don't Starve Mod Tools, getting the right files for making music mods, using FMOD for specifically music mods, and uploading your music mod (if you don't already know.) What you will need: A Text Editor (Really, any text editor will do, just not Notepad. What I use is Notepad++, but sometimes the website could be down or your operating system cannot use the program. If any issues are to occur, just use a different one.) Don't Starve Mod Tools (Mainly the program FMOD Designer within the tools and the Workshop Uploader.) Instead of including TheScraps98's guide downloads, I'm going to provide a variation of my own since his is a bit outdated, but I am still going to give credit to him. This also applies to Klei's Official Music Mod tutorial for Don't Starve since that one is also very outdated. For my Tutorial music mod, you can get it by clicking here. The audio files that you want to use. A picture you want to use to represent your music mod. How to get the Mod Tools The mod tools can be found within your library. As for the process, well... it has changed with the new Steam Library update back in October of 2019. To access it, you will need to go to your Library and click the tab GAMES AND SOFTWARE. From there, you can tick the TOOLS option. After that, you can search for the tool with the search bar or look for it in alphabetical order. Of course, in my case, I have the tool installed along with it being within a category. When you start the tool up, you will be prompted with this message. You will want to select the Launch FMOD Designer option. Congratulations! You have passed the Mod Tools section of this guide. How to use FMOD for Music Mods So, now that we have found the tools, lets begin with getting the project setup. First of all, you will need to download the Workshop item I will include so you can follow these steps to understand how to replace any tracks within this project file. The first step is to load the project data. In order to do that, we go to File -> Open Project... From that point, you'll want to navigate until you get to my workshop mod. The file location can be found in C:\Program Files (x86)\Steam/steamapps\workshop\content\322330 and it will be in a folder named whatever the Workshop ID is for the item. After you locate it, you'll want to open it. Once it's open, you'll notice a bunch of events on the left-hand side window. Each one can be altered by clicking on each individual one and viewing the right-hand menu. Let's try out the music_FE event. After you click on it, you'll see many things you can do on the right. Let's not mess with those settings right now and focus on replacing the track in question. In order to replace said track, you can right click on the big blue object in the center of the layer00 parameter. From there, you will want to Replace object... Soon after, you will be prompted with a window where you can look through your added sounds. From here, we want to choose Add sound file... then you will want to locate your sound file(s) of choice. (I highly recommend that you create a folder to store all of your data in. Like for example, copy my workshop item's folder into the Don't Starve Together Mods Folder. You will need to do that anyway since you will have to test it to make sure it's working later.) Then, you choose your file and it should now replace the previous slience.mp3 file. (I should also mention that you can use any format that FMOD can accept such as .wav, .mp3, or my favorite .ogg. When you use these files you will need to alter your build later on to accompany these file types so the size of the project doesn't exceed 100 MB.) Now you have figured out how to replace audio clips for these types of events. Good job! Types of Events and How to Replace their Audio The first event was just a heavily modified Multi-Track Event, which usually only show with a red "C". These events can't quite be recreated from the ground-up. Instead, you will need to copy-and-paste the event into the main music group folder. Now that's out of the way, the next two events are not too hard to understand. The first one is called a Simple Event. This one can have music either looping in a single playlist, or it can function as a single song that plays. (Which isn't really different from copy-and-pasting a Modified Multi-Track Event.) Many options are listed, but if you just want to add a track or few, right click on the empty space in the middle of the Playlist box and click Add Sound... From there, you can do the same thing as the last event, but you can add multiple tracks into this one. The way they work is that they are set to loop in a fashion where no-one track repeats unless they haven't been played yet. I can't really recommend selecting a different Playback Mode, but if you are feeling adventurous, then by all means! Anyhow, you can also do the same for the Playlist Behavior, but try not to change WAY too much. You don't want to get yourself stuck with messed up settings. I might also include that you can alter the sound by navigating to the Volume property. From there, you can only go into the negative range to turn down the volume. I don't recommend going past -2 unless your audio is WAY too quiet. Which even then, I would try to fix that in an audio editing software (such as Audacity) After you all said and done, you can navigate to the next type of event. The other one is a normal Multi-Track Event. This one is just an average Multi-track event, but you'll notice the ones for music_work have a wave going through them. This wave is a "fade-in" property created by either Klei or TheScraps98. I chose not to mess with it ever since I started working on music mods mainly because it would be difficult to fix it if you don't have a whole lot of knowledge of how FMOD Designer works. Replacing the audio is just like the first Multi-track event. Although, to get around that pesky wave, you'll need to right-click in the empty blue space occupying the audio. Don't right-click on the red wave since you might bring up the wrong properties menu. Nothing really else for me to explain here since I already had explained how the volume control and audio changing works. That pretty much wraps up this section. Building your Project If you feel completely done with altering the project, you are going to want to make sure you save your project. I really cannot stress this enough since over the past four years of making mods for Don't Starve Together, my projects would be lost thanks to my clumsiness of forgetting to save or just the program crashing in general. Of course, if you have higher-end PCs like I do now, you shouldn't have to worry about the engine crashing. Although, save regardless. To save, you just do like any other type of file. For building the project's file, you'll want to head over to the Banks tab. Once there, you'll want to click on the music_mod bank. This section will allow you to view all your current sound files and the properties to the right. For the properties, you'll want to make sure your bank is named music_mod. If it isn't, change it to that. As for Compression, you'll want to change that to whatever file type you are using. (.wav, .mp3, etc...) After everything is set and ready to go, press Ctrl - B and it will bring up the Build menu. From here, you can see your options. If you would like, you can use the Output > > option to see where your project's exported files will end up and whatnot or even view any errors you have. Otherwise, just click Build to compile the .fsb and .fev Now, you will want to navigate to find your project's compiled files are. The usual spot will be in a subfolder called sound. For the sake of the workshop mod's spot, it will end up in sound/project/sound. From there, you will want to take the .fsb and .fev files and put them in the main sound folder within the main root of the mod. Congrats, you have completed all the steps to making the main sound files for the mod! Now time for the final part. Final Revisions and Uploading your Mod Now it's time to wrap this whole mod up into a nice pretty bow. The first step is changing the modinfo.lua file in the main root of your music mod. I will be going off my mod's info file if you are using the workshop mod I uploaded. You will want to open the .lua file with the text editor of your choice and changing anything in the details all the way at the top to whatever you desire for each field. After you have done that, then you are now complete with the coding part of this guide. The next part is to add the icon you would like to represent your music mod. If you navigate to the images folder in the mod's main folder, you will find a folder labeled icon. In this folder, you can use any of the parts given to you in that folder, but if you do, make sure you read the text document included. Although, if you feel like using your own image instead, make sure you save your image in the images folder labeled modicon.png and make sure it is 128x128. Once done with that, you can go ahead and open the Workshop Uploader. To open the Uploader, you will want to reopen Don't Starve Mod Tools again, but this time choose the first option. Afterwards, you will be prompted with this window and you can select between Don't Starve and Don't Starve Together. For our sake, let's choose Don't Starve Together. After this has been chosen, you can select Add and you will be greeted with a new list of options. The next steps are to find every piece of the required data such as the mod folder for Update Data and to use the selected Preview Image. You can also change the Name and Description here, but later you can change it from the item's Workshop page. Once you have found everything for the mod, you can tick the Tags if you are feeling interested in labeling your mod. After everything is said and done, go ahead and Publish! Conclusion Well, that's pretty much all that you'll need for this guide. Hopefully, this helped you with any of your endeavors towards finishing or fixing your music mods. If anything, there is always multiple ways to do something in modding. If you have any questions or feedback to give me, please let me know what you have on your mind in the replies section. I wish you all good luck and thanks for stopping by.
-
api [Tutorial] Making your own skins for modded items
Cunning fox posted a topic in Tutorials and Guides
DISCLAIMER: This guide is for modded items only. Klei prohibited creating custom skins for official items, and this library won't be able to add them. Hey everyone! Since I haven't found up-to-date and easy to use library for creating custom skins for items, I decided to make my own one and share it with you I used @Kzisor / Ysovuka's library as a base for mine. 1. Installation First of all, you'll need to download the library from here: Then, you'll need to put it in your mod's folder. I'll be using path scripts/libs/skins_api.lua. After that, you'll need to include this library for your mod. Add this line into your modmain: modimport("scripts/libs/skins_api.lua") All set! The library is installed, and we can actually add our skins. 2. Making custom skin prefab Unlike Klei's skins, modded skins use different prefabs for every skin. So, you can different properties for every skin! They even can have different functionality. So, you have 2 options: Make a separate prefabs file for skins (or each skin) Make prefab's skins directly in the base prefab's file. To register your skin you'll need to use CreateModPrefabSkin(name, properties) function, where name is a string with the name of your skin, and properties is a table. For example: CreateModPrefabSkin("dummy_formal", { assets = { Asset("ANIM", "anim/dummy_formal.zip"), }, base_prefab = "dummy", fn = formal, rarity = "Timeless", reskinable = true, build_name_override = "dummy_formal", type = "item", skin_tags = { }, release_group = 0, }) Assets: a table of assets for your skin; base_prefab: Prefab of the items you're making a skin for. fn: Prefab's constructor. Acts like a regular prefab constructor. rarity: Your item's rarity. reskinable: Will your item be reskinable using the Clean Sweeper. build_name_override: The build of the skin. The rest of the properties is only used by Klei, so it's better to just keep them unchanged. If you're confused about the Fn, here's an example: Let's say that you want to make a skin for something similar to a carrot. You have a constructor function: local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() inst.AnimState:SetBank("carrot") inst.AnimState:SetBuild("carrot") inst.AnimState:PlayAnimation("planted") inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst:AddComponent("inspectable") inst:AddComponent("pickable") inst.components.pickable:SetUp("carrot", 10) inst.components.pickable.onpickedfn = onpicked return inst end To make a skin you'll need to create a new constructor like this: local function carrot_skin() local inst = fn() inst.AnimState:SetBuild("skinned_carrot_build") return inst end Here we create a default carrot (using fn()), and then apply some changes to it (change the carrot's build). After that, we'll need to return our skin, just like a regular prefab. At the end of the file you need to put: return Prefab("carrot", fn, assets), CreateModPrefabSkin("dummy_formal", { assets = { Asset("ANIM", "anim/skinned_carrot.zip"), }, base_prefab = "carrot", fn = carrot_skin, -- This is our constructor! rarity = "Timeless", reskinable = true, build_name_override = "skinned_carrot", type = "item", skin_tags = { }, release_group = 0, }) 3. Updating the recipe and adding strings After creating your skins' prefab, you'll need to update your recipe too. After you've added your item's recipe with AddRecipe, you'll need to call MadeRecipeSkinnable(recipe_name, atlas_data), where recipe_name is the name of your recipe, and atlas_data is a table, containing info about your skin's inventory image. MadeRecipeSkinnable("dummy", { dummy_formal = { atlas = "images/inventoryimages/dummy.xml", image = "dummy_formal.tex", }, }) The second argument is the table. Here you'll add atlas and image of the skin. Here, dummy_formal is the name of the skin, the atlas is a path to .xml file, and the image is the name of the texture. After that, you'll need to name your skin, using STRINGS.SKIN_NAMES table. Is works just like adding names to regular prefabs, but the name of the prefab has to be lowercased. STRINGS.SKIN_NAMES.dummy_formal = "Formal dummy" All set! Your modded item now should have its own skin. 4. Applying skins on placers. If your item is a structure and has a placer, you'll want to apply a skin to its placer too. To do it, you'll need to modify your MakePlacer, to make it look like this: MakePlacer("dummy_placer", "dummy", "dummy", "anim", nil, nil, nil, nil, nil, nil, placer) placer here is a custom function that'll be applying the skin itself. If should look like this: local function placer(inst) inst.ApplySkin = function(inst, skin) if skin == "dummy_formal" then inst.AnimState:SetBuild("dummy_formal") end end end Here placer function adds ApplySkin function. The skin argument is the name of the skin for the item. In this example, we check if the skin is dummy_formal, and apply custom build for a placer if it's true. That's all you need to add a skin for your item! If you have any questions or feature requests, feel free to ask them in the comments! Mods that use this library (You can use them as an example) The Dummy Mod -
Hello there! This is going to be my first ever tutorial, so apologies if anything is unclear (though let me know if it is and I'll try to update this/help out!) or, in worst case, flat out incorrect. Let's jump in! EDIT: Just wanted to clarify, this guide is only for extracting the sprites. It does not cover the process of recompiling the assets back into the game. I have linked the Steam post guide for that down further into the guide. Sorry, I just don't know how to do that personally and I apologize if anyone feels this guide is useless because of that lack of information. So I've noticed a lot of people lately (including myself) struggling to do this, for one of 2 reasons (possibly more): First, Krane's intended command prompt usage simply doesn't work, no matter how you do it Second, the desired graphics/animations don't come with a corresponding anim.bin file I have solutions to both of these problems (though maybe not perfect ones), so hopefully anyone else looking to do this and running into the same issues will be able to accomplish what they want to do. Alright, let's get started! You'll need: -KTools -TEXTool -A program that can open/extract .zip archive files -An image editing program that supports transparency (this is really important) 1. First, you want to make sure you have KTools. Without this, you won't be able to extract any graphics or animations. The downloaded folder for KTools can be saved anywhere (though I recommend renaming the folder to simply "ktools". E.g. "ktools-4.4.4" changes to just "ktools") to avoid any errors. Also be sure you've downloaded the Microsoft Redistributable Package linked on KTools' download page to avoid errors as well. 2. Now you'll need TEXTool, which comes with Handsome Matt's set of tools. With this, you can extract the .tex files themselves in their "raw" state, just in case KTools doesn't extract the sprites correctly and you have to take the sprites from the texture atlas itself (more on that later). 3. Time to look for the sprites/animations you want to extract from the game. This works for both Don't Starve and Don't Starve Together, so it will work the same for whichever one you need. In this example, we'll want to go to [disk drive that has your Steam folder in it]\Steam\steamapps\common\Don't Starve Together\data\anim. So in my case, it would be D:\Games\Steam\steamapps\common\Don't Starve Together\data\anim, though it may be under C:\Program Files\Steam\steamapps\common\Don't Starve Together\data\anim for most people. 4. So, say you want to extract Wolfgang's sprites/animations. You would go to Wolfgang's .zip file (simply called wolfgang) located under the "anim" folder we just navigated to. Open that or extract the contents using whatever archive-opening program you have (I have WinRAR for example), You'll notice that it contains an "atlas-0.tex" and a "build.bin" file. Extract these directly into your ktools folder. ...But the .zip file doesn't have an "anim.bin" file! We need that in order for Krane to be able to extract the sprites and animations for us, so what do we do? Well, I discovered a solution to this through trial and error. 5. Now, we'll go to the player_idles.zip file, extract the anim.bin from that and place it, again, directly into the ktools folder along with your atlas-0.tex and build.bin files we just extracted from Wolfgang's archive. 6. Next thing we want to do will ensure that we can actually use Krane in the first place, because, as some of us know, trying to run it through command prompt simply doesn't work. So, we'll want to open our text editor (I use Notepad++, but plain old Notepad should work just fine) and create a new file. It can be named whatever you want (I named mine "slurtle" because I started testing this with Slurtle's files), but make sure that this exact code is pasted into the very first line of the text file: krane anim.bin build.bin output_dir And that's it! All we have to do now is save that text file as a .bat file in the ktools folder, again. This is a Windows Batch File which will run Krane as if it were an executable file. What that means is, we can simply double-click this .bat file and it will run Krane without having to go through command prompt! How exciting! 7. Now that all that's done, our folder structure should look exactly like this: ...with "slurtle" being our .bat file. Now, double-click on your new .bat file, and watch the magic happen! Look! It's not closing immediately like it would if you had simply tried opening Krane itself. Now, look what happened... 8. That "output_dir" folder has all our newly extracted assets in it! Let's look inside... Hooray! If you made it to this point, you should now have your sprites in proper animation order! 9. ...But hold up. We looked in Wolfgang's "torso" and "torso_pelvis" folders, and something's not right here... They look kinda blurry and stretched, don't they? And they're the only sprites like that! Why did that happen? Well, to tell you the truth, I don't know why this happens. It just does with certain assets, even for entities that DO have all three matching anim, atlas, and build files. How do we fix it then? Well, I don't know of a "proper" fix yet, but I do know a workaround. It will involve TEXTool that I had you download earlier. 10. Go to where you downloaded and saved your folder for Handsome Matt's tools. You should see TEXTool and TEXCreator in there. TEXTool is what we want. Now, once you open TEXTool, click the little folder icon to browse to where you saved your atlas-0.tex file. We will load this into TEXTool. So, once we load Wolfgang's .tex file, it will look like this: It looks like a total nightmare, doesn't it? Well, this is how the game stores its graphical assets. Good thing Krane automatically cuts these sprites out for us. So, we won't actually be doing much here aside from clicking the little floppy disk icon to save this texture atlas to wherever we want, as a .png file. Now comes the slightly tedious part. 11. Now, if you don't already have one, acquire that image editing program I mentioned. I personally recommend Paint.NET as it is free, supports transparency, and it suits all our purposes here just fine. Just please make sure you don't use MS Paint. So, let's open our new atlas-0.png file in our image editing program. As you can see, the atlas is quite a large image. This is all the sprites for Wolfgang at their proper resolution. Now, here comes the tedious part (though it's not that hard): If using Paint.NET, you'll first want to click the paint bucket tool. Why? It'll just make our lives a bit easier when we go to pick the sprites we need out of the atlas. We aren't keeping this atlas anyway (unless you intend to change the actual sprites and put them back into the game, but that's not what this guide is for). Now, pick a gaudy color that sticks out from the sprites but won't burn your eyes. We'll pick a nice shade of pink for this. Now, the left and right arrows point to the paint bucket tool and color palettes, obviously. But what's this middle part? That would be the Flood Mode, Fill Type, Tolerance, and Anti-Aliasing toggle. What does all this mean? I'll tell you! First, make sure Flood Mode looks like an empty lightbulb as I have it (aka don't set it to "global"). "Fill" basically just changes the pattern you want to use for the paint bucket tool. So if you want it to only fill a grid pattern with our chosen pink, change that option. But for this purpose, keep it on Solid Color. Next, make sure Tolerance is all the way down at 0%. This is very important, because if it's at any number above that, it could mess up our sprites. Sampling isn't important and is difficult to explain, so for now let's just keep it on Layer. This next one is also very important. Right after the Sampling setting, make sure the little "connect the dots" icon is jagged like I have it in the screenshot, not curvy and smooth. This basically means, if you hover over it and it says that the paint bucket is set to "anti-aliasing enabled", then the pink color will blend into our sprites, and we do not want that. Now, having all our settings the way we want them,, let's actually do it. Select the paint bucket tool with our color chosen and click in any space that has the white and gray checkerboard pattern. This is the image's transparency. It's what lets the sprites "hover" over other sprites and be see-through, without any background or color behind them. Let's see what happens when we do this: Now, if you can still see little transparent "junk pixels" around the sprites, then you did it correctly. Alright, now here actually comes the tedious part. Use your select tool (click the little rectangle icon in the top left, or press the S key once) and carefully click and drag the selection rectangle around the sprite we want. In this case, we'll start with this torso sprite here as it is the first sprite frame in the "torso" folder (be sure to zoom in with ctrl + scroll up on the mouse wheel to make this easier): Now, press shift + s (or click the magic wand tool in your tool box on the left). Then, press alt + left click anywhere on the pink background to "snap" the selection to the exact boundaries of the sprite, like so: Now, press ctrl + X to cut the sprite out of the image. Then press ctrl + alt + V to paste this sprite as a new image. Like this: Save this sprite as a new image with ctrl + S. It will ask you where to save this sprite. You can either save it in another folder or you can overwrite the blurry export. Compare the difference between the sprites: The bottom one from the atlas is the correct version of the sprite. Now you have to do this same process for the rest of the sprites that came out wrong (in Wolfgang's case, only the torso and pelvis came out wrong), using the blurry exports as reference for the animation order. Always be sure to check the exported sprites closely and, if they look off, compare them with those from the texture atlas itself to make sure they are at the correct resolution. 12. Congratulations! You now know how to export sprites in their correct animation order and, in some cases, fix the sprites that don't come out as they should and use them for whatever you want! Now, bear in mind that this probably won't work if you're trying to edit the sprites and re-insert them back into the game. However, there's a guide on that here. I hope this helped! This is my first guide so I apologize that it's so long and wordy when it probably doesn't need to be. I just wanted to make sure I covered all the bases and didn't under-explain anything. If you encounter any problems or find anything I missed, please let me know and I will try to help as best I can! ~Garamonde EDIT: Sorry about these last two images at the bottom of the post. I can't seem to remove them. They can be safely ignored though. EDIT 2: If anyone has problems getting Krane to run, despite following this guide, try checking out this thread.
-
Hello and welcome to my tutorial on how to make your own custom shader for DST! This sort of knowledge is limited to very few people in the community so I thought to make a tutorial to make this knowledge available for everyone who wants to make a custom shader for their mods! What’s a Shader? Originally shaders were used to shade 3D models in video games. Today they're used to shape, change color, size and etc on textures, used in post processing and so on. They're used all the time in DST and I can show you some examples! One common shader is the “bloom” shader. In the first image here is a roaring campfire where the fire has the “bloom” shader applied that greatly brightens the fire, the 2nd picture has a campfire without the “bloom” shader. The “bloom” shader is generally used to make things bright and shiny! They’re used everywhere in the game. They’re used for the tiles you stand on, the ocean, the UI, spider webbing, haunted effect, colour cubes and much much more! (Bloom On) (Bloom Off) So what do I need to make a custom Shader? -To make a shader file(.ksh), you’ll need a vertex shader(.vs) file and a pixel/fragment shader(.ps) file Quick Explanation on Vertex and Pixel Shaders -Some basic knowledge of GLSL(OpenGL Shading Language) GLSL is the main language we’ll be using to make our custom shaders, I recommend you get some basic understanding and knowledge of the language but if you understand other languages fairly well(such as LUA, which is used for DST programming most of the time) then you should be able to figure out GLSL as you go along An important resource will be this website here! https://thebookofshaders.com/ https://thebookofshaders.com/edit.php This website has a lot of knowledge on shaders and even has an editor for making fragment shaders! Some shaders being showcased are clickable and will lead you to an editor with the code that make up that shader. Almost every shader you see on this website can be applied in DST itself, so take a gander around and see what shaders you like. Programming your Shader So let’s get to programming your shaders! In both the vertex shader and pixel shader files! Create two files like these wherever you’d like. (We will be moving these files later however) You can name them whatever you’d like. But I've named them “examplePixelShader” and “exampleVertexShader” in my case. Be sure the PixelShader file has .ps has its extension, and the VertexShader has .vs as its extension. Now open up your VertexShader.vs file and copy paste this code in. uniform mat4 MatrixP; uniform mat4 MatrixV; uniform mat4 MatrixW; attribute vec4 POS2D_UV; varying vec3 PS_TEXCOORD; void main() { vec3 POSITION = vec3(POS2D_UV.xy, 0); float samplerIndex = floor(POS2D_UV.z/2.0); vec3 TEXCOORD0 = vec3(POS2D_UV.z - 2.0*samplerIndex, POS2D_UV.w, samplerIndex); mat4 mtxPVW = MatrixP * MatrixV * MatrixW; gl_Position = mtxPVW * vec4( POSITION.xyz, 1.0 ); PS_TEXCOORD = TEXCOORD0; } Why do we put this code in? Well this code is necessary for making sure our PixelShader will only apply to the texture/entity we apply it to. What the code is doing is loading in some variables the game gives us (POS2D_UV, PS_TEXCOORD, MatrixP, MatrixV, etc) and we’re doing calculations with those variables to give the game the positions(gl_Position variable). And now the PixelShader will only apply to pixels in that position. If we just did something like gl_Position = vec4(1.0) And set that to the gl_Position variable, our Pixel Shader will run for every pixel on the screen which isn’t what we’d like. As for the code you put in your PixelShader? Well, it can be anything really! But you can find many examples in the bookofshaders website I linked earlier. For my example i’ll be using the code here! Found in: https://thebookofshaders.com/06/ This pixel shader here will switch the color of our entity/texture from yellow to blue and back constantly. You can follow along and plop the code of the example i'm using, or plop your own code in. Just like that! But before we continue, there’s something very important we need to do for my example. (This might not apply to the code you're using) Do you see that “u_time” variable there? Well we need to replace it! Unfortunately the game does not provide us with a u_time variable to use. However! That’s because there’s another variable that’s used to measure time. uniform vec4 TIMEPARAMS; We can use the TIMEPARAMS variable instead! Go ahead and replace the uniform float u_time; line with the “uniform vec4 TIMEPARAMS;” line up above. The TIMEPARAMS variable is used in the game's own shader files(anim.ksh) and that’s where I found it. Now go ahead and replace all instances of “u_time” in your code with “TIMEPARAMS.x” For example, from this To this! Of course if you don’t have the “u_time” variable anywhere in your code you can ignore this. If your pixel shader does something that's unchanging and constant then you probably don’t need a time variable to use. Compiling Our Shader Now we should be done programming our VertexShader and PixelShader files. It’s time for the fun part of compiling our files into the actual “ksh” file which is the actual shader we’ll be loading in-game. Copy your files, and head on over to this directory here “C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Mod Tools\mod_tools\tools\bin” And paste your files here. You’ll notice there’s an executable called “ShaderCompiler.exe” which will be the program we use to compile our shader. Open your command prompt (Windows Key + R, or search Command Prompt in your computer search bar) Type in “cd”, put a space and then paste the directory I gave you earlier and press Enter. Now you’re able to do the compiling as you’re in the directory with the ShaderCompiler. ShaderCompiler.exe -little “shadername” “exampleVertexShader.vs” “examplePixelShader.ps” “shadername.ksh” -oglsl Paste this line into your command prompt like this. Make sure to replace instances of “shadername” with what you’d like to name your shader. And replace “exampleVertexShader” and “examplePixelShader” with the names you have given them. And then you can execute the command by pressing Enter. If your files were prepared correctly and there are no errors, you should get something like this right after in your command prompt. If an error did pop up. Let me know and i'll try to help you out! But anyways, if you did it correctly, this means the shader compiled correctly! You should now find a file named “shadername.ksh” or whatever you set the name of your shader to be, in the directory. Yup, there it is! Grab this file, and head on over to your mod directory Make a new folder named “shaders” in your mod directory., place/paste your new shader file in there. Head on over to your “modmain.lua” and load the shader file in the Assets table like this. You’ll probably already have an Asset table filled up so just plop the Asset(“SHADER”, “shaders/shadername.ksh”) line in your assets table, and be sure to rename accordingly. It’s finally time to test in-game, will your custom shader work? Let’s find out! Create a world and enable your mod. Once you’re in, copy and paste this command and hover over any entity in the game. (Be sure to replace “shadername” with the actual name of your shader) c_select().AnimState:SetBloomEffectHandle(resolvefilepath(“shaders/shadername.ksh”)) And Congratulations you (hopefully) did it! You may use this shader on any entity/texture you’d like at any time. Have fun with this new knowledge and understanding of shaders and I hope us Modders can make some wicked stuff with this! Notes:
-
Aye! Modders! This is a short guide that points out many differences between DST and DS version. I just decided to create this little tutorial to help some of the modders that would like to translate their DST mod into a DS, which of course can be done inversely. It won't be hard stuff, as I don't know much about coding and started with zero knowledge in Lua. The purpose of these writings is just about sharing and helping. Still, I hope this WILL help. Let's begin. First your should seek for your mod folder and I assume you already know where it should be. We will set every change in the following section : *Modinfo *Modmain *Character *Items/prefabs Modinfo : Modmain : Character : Items/Prefabs : Feel free to be constructive and point out what you know about translating DST to DS. I know this short guide is not complete, but everything has a beginning. D4rkh0bb1T
-
I have seen a lot of people which are still new to modding having troubles with the basic character perks, therefore I decided to create a simple tutorial showing you how to create some basic perks for your character. So if you're having trouble and are working on a mod for DS, RoG, or SW (or... all) then hopefully this could help you out at least a little bit! I know that I'm not the best modder out there, and that there can be few different ways to achieve some of these things in this tutorial, but I'm gonna focus mainly on the ways that I learned how to do them. ---------------------------------------------------------------------------------------------------------------- IMPORTANT DST mods differ in their codding from the DS, RoG, and SW. So sadly this tutorial might not help you if you're working on a DST mod. ---------------------------------------------------------------------------------------------------------------- So most of you probably are already using a basic character template, which provides you with a basic modmain.lua file, same as a starter character prefab file which already has the basic list of assets, and character stats for you to manipulate. But just in case you don't have them, then here's where you can get them: Extended Sample Character << Click In this tutorial I'll show you how to: - Set/Change your characters Health, Sanity, and hunger. - Increase/Decrease/Turn off night and dusk sanity drain or reverse it. - Increase/Decrease/Turn off moisture sanity drain or reverse it. - Set a HP/Sanity/Hunger regen/damage over time. - Set a HP/Sanity/Hunger regen/damage during specified time of the day. - Set a HP/Sanity/Hunger regen/damage during specified season. - Set a HP/Sanity/Hunger regen/damage from rain or while being in caves. - Set a health/sanity/hunger regern/damage from temperature. - Set a health/sanity/hunger regern/damage from moisture. - Set a sanity/health/hunger loss/gain from attacking creatures. - Set a sanity/health/hunger loss/gain from killing creatures. - Set a Sanity regern/damage by equipping an item. - Erase/Increase/Decrease an existing sanity regen/damage on an item. - Add a sanity aura heal/damage to an item/creature. -------------------------- - Change your character's basic defense/attack power/speed. - Change defense/power/speed based on the time of the day. - Change defense/power/speed based on season. - Change defense/power/speed based on rain or caves. - Change defense/power/speed based on temperature. - Change defense/power/speed based on moisture. -------------------------- - Set your character's heat and cold resistance. - Increase/Decrease the HP damage when freezing/overheating. - Make your character fragile/resistant/immune to heat/cold. - Make your character immune to fire. - Turn your character into a monster or make it "not scary to prey". - Make the spiders/merm ignore your character (if unbothered). -------------------------- - Set/Change what your character can/can't eat. - Change the amount of sanity/health/hunger that a specified food gives. - Create a custom food type/group for your character. - Make an non-eatable item eatable to your character. --------------------------- - Give your character starting inventory items. - Make your character always start with a certain custom item (even in adventure mode). - Give your character a night vision/glow. - Unlock recipes for your character. - Change existing recipes. - Give your character custom recipes for existing items. - Remove the sanity gain/loss from picking flowers. - Mute your character. - Make your character unable to trigger spiders when walking on their webs. (All of the sections are in the same order as in the list above) BTW, I know that you'll see me repeat the same things many times in this tutorial, but that's just because I made it for people to be able to head right away to the section that they care to learn, without needing to read the whole thing. So I'm sorry if you'll find that annoying. Anyways, let's start! ========================================================================= Health / Sanity / Hunger ========================================================================= --=====BASIC=====-- -- Set/Change the character's basic stats -- -- Increase/Decrease/Turn off night & dusk sanity drain or reverse it -- -- Increase/Decrease/Turn off moisture sanity drain or reverse it -- --=====REGEN/DAMAGE BASED ON TIME OR SEASON=====-- -- Set a HP/Sanity/Hunger regen/damage over time -- -- Set a HP/Sanity/Hunger regen/damage during specified time of the day -- -- Set a HP/Sanity/Hunger regen/damage during specified season -- --=====REGEN/DAMAGE BASED ON LOCATION OR RAIN=====-- -- Set a HP/Sanity/Hunger regen/damage from rain or while being in caves -- --=====REGEN/DAMAGE BASED ON TEMPERATURE OR MOISTURE=====-- -- Set a health/sanity/hunger regern/damage from temperature -- -- Set a health/sanity/hunger regern/damage from moisture -- --=====REGEN/DAMAGE BASED ON KILL OR ATTACK=====-- -- Set a sanity/health/hunger loss/gain from attacking creatures -- -- Set a sanity/health/hunger loss/gain from killing creatures -- --=====REGEN/DAMAGE BASED ON ITEMS OR CREATURES=====-- -- Set a sanity regern/damage by equipping an item -- -- Erase/Increase/Decrease an existing sanity regen/damage on an item -- -- Add a sanity aura heal/damage to an item/creature -- ========================================================================= Defense / Attack power / Speed ========================================================================= --=====BASIC=====-- -- Change your character's basic defense/attack power/speed -- --=====INCREASE/DECREASE BASED ON TIME OR SEASON=====-- -- Change defense/power/speed based on the time of the day -- -- Change defense/power/speed based on season -- --=====INCREASE/DECREASE BASED ON LOCATION OR RAIN=====-- -- Change defense/power/speed based on rain or caves -- --=====INCREASE/DECREASE BASED ON TEMPERATURE OR MOISTURE=====-- -- Change defense/power/speed based on temperature -- -- Change defense/power/speed based on moisture -- ========================================================================= Sensibility / Numbness / Characteristics ========================================================================= --=====BASIC=====-- -- Set your character's heat and cold resistance -- -- Increase/Decrease the HP damage when freezing/overheating -- --=====FRAGILE / IMMUNE=====-- -- Make your character fragile/resistant/immune to heat/cold -- -- Make your character immune to fire -- -- Turn your character into a monster or make it "not scary to prey" -- -- Make the spiders/merm ignore your character (if unbothered) -- ========================================================================= Food ========================================================================= --=====BASIC=====-- -- Set/Change what your character can/can't eat -- -- Change the amount of sanity/health/hunger that a specified food gives -- --=====CUSTOM=====-- -- Create a custom food type/group for your character -- -- Make an non-eatable item eatable to your character -- ========================================================================= Starter inventory / Night vision / Recipes / Other ========================================================================= --=====ITEMS=====-- -- Give your character starting inventory items -- -- Make your character always start with a certain custom item (even in adventure mode) -- --=====CHARACTER=====-- -- Give your character a night vision/glow -- --=====RECIPES=====-- -- Unlock recipes for your character -- -- Change existing recipes -- --=====CUSTOM=====-- -- Give your character custom recipes for existing items -- --=====OTHER=====-- -- Remove the sanity gain/loss from picking flowers -- -- Mute your character -- -- Make your character unable to trigger spiders when walking on their webs -- ========================================================================= And that would be the end of this tutorial. It took me 5 days to compose all this, so I really hope that at least some of you might find it helpful. However, if any of this parts/sections confused you, then please feel free to ask me whatever it is that you didn't understand, and I'll try to explain it differently to hopefully help you out. Also: Please, do not ask any questions that have nothing to do with this tutorial (nor anything it shows) in here. (Just trying to avoid unnecessary mess) ^^;
- 29 replies
-
- 14
-
-
-
-
-
Hey, guys, this tutorial is for people who would like to make a custom setpiece (i.e. a pre-generated chunk of land), but don't know the specifics of it. The tutorial will be kind of long and elaborate, but hopefully it will be helpful. It will require basic modding knowledge, and it is assumed that you already have your base mod (mod folder and modmain) set up. Now let's start. First half (setting up all of the properties): Now that we're all set up, we need to make some ground for our setpiece. Make sure to select the BG_TILES layer, or this won't work. Put your cursor over the tile you want (in the bottom-right corner) and click to select it. For the sake of simplicity, I'll use grass. Next, spread it around the middle of the screen simply by clicking and dragging. It should hopefully look something like this: Wonderful, now we need to create some objects! So you will need to select the FG_OBJECTS layer. Make sure to highlight both of these, top one first: And click up here on this little rectangle thingy. Now, just click where you want the object to be located in relation to the tiles you placed earlier. It should create a small, gray rectangle where you clicked. Now, you should right click the rectangle, and click Object Properties. It should bring up a little popup box. Now type in the name of the prefab you want to create in the type box (I'm going to use researchlab so it stands out). BE CAREFUL: if you type it in the name box, it WON'T WORK, so make sure to type it in the TYPE box. I speak from experience, don't make that mistake. After you've typed the name of your prefab in, press OK. You can add as many objects as you like but for the sake of simplicity, I'll leave mine at one. Once you're done with that, you're finally done (finally). You should definitely save your work so you can modify it later, but the most important part is exporting it: This will export the file into code. MAKE SURE it is set to .lua when you export it. You need to export it to /yourmod/scripts/map/static_layouts/ That is where your setpieces will go. I'm going to call mine rl (research lab). At last, we are done. With most of it. Now all you need is to add a little bit of code to initialize it. To finish, I'm going to show you how to add your setpiece to a biome (won't be making the biome). Here's the code: local Layouts = GLOBAL.require("map/layouts").Layoutslocal StaticLayout = GLOBAL.require("map/static_layout")Layouts["ResearchLab"] = StaticLayout.Get("map/static_layouts/rl")AddRoomPreInit("Forest", function(room) if not room.contents.countstaticlayouts then room.contents.countstaticlayouts = {} end room.contents.countstaticlayouts["ResearchLab"] = 1end)This code should go into your modworldgenmain, a file in the same location as your modmain. If you do all of that, you should get something like this: And voila! You should have a working setpiece! I apologize if this tutorial was hard to follow, but please tell me in the comments if you think I can edit it or make it better. Thank you for reading! setpiecemod.zip
-
Introduction Hello everyone. I hadn't seen any tutorial dedicated to this topic. At the start I need to state that I am pretty lame in everything associated with modding, so don't expect sophisticated solutions. This tutorial is simple yet effective, I have to agree that it could be better but as I have said, I am just simple man. I have used my old projects to explain you the scheme of your custom follower. Template is based on this: Main Part To make functional follower you need to introduce the follower's: - main script [creature.lua], the corpus of you follower - anchor [anchor.lua], I have called it this way, because it attaches and provides easy summoning of the creature to your DST world - brain [creaturebrain.lua], yep, that's the brain, every action you require from your creature belongs to it - stategraph [SGcreature.lua], this file gives your creature ability to perform any visible action, because it's connected with animations and their realizations Locations Main Folder -> scripts -> prefabs -> [creature.lua] Main Folder -> scripts -> prefabs -> [anchor.lua] Main Folder -> scripts -> brains -> [creaturebrain.lua] Main Folder -> scripts -> stategraphs -> [SGcreature.lua] How to make mine template yours ? That's simple! Follow me this way! At the start, change my names [name.lua] into yours. [taern.lua] That should be your character's name. into local common_postinit = function(inst) goes inst:AddTag("summonerally") Add this tag to prevent summoned creature from attacking your character and vice versa. and local master_postinit = function(inst) goes inst:AddComponent("reader") It will let you read books, which is crucial for this method of summoning follower. [creature.lua] Change name 'creature' into yours follower's name. Using Ctrl+F in Notepad++ as shown in ESCT tutorial by Dragon Wolf Leo. That's your follower's appearance [Main Folder -> exported -> creature] You can call it what you want to, but it must match [name in exported] and all other references in whole mod to work properly. [anchor.lua] Change name 'anchor' into your summoning item. [creaturebrain.lua] I am not sure if changing CreatureBrain name will affect anything but just to be sure you can try. function CreatureBrain:OnStart() local root = PriorityNode( { WhileNode(function() return IsNearLeader(self.inst, KEEP_WORKING_DIST) end, "Leader In Range", PriorityNode({ IfNode(function() return self.inst.prefab == "creature" end, "Is Duelist", PriorityNode({ WhileNode(function() return self.inst.components.combat:GetCooldown() > .5 and ShouldKite(self.inst.components.combat.target, self.inst) end, "Dodge", RunAway(self.inst, { fn = ShouldKite, tags = { "_combat", "_health" }, notags = { "INLIMBO" } }, KITING_DIST, STOP_KITING_DIST)), ChaseAndAttack(self.inst), }, .25)), IfNode(function() return self.inst.prefab == "creature" end, "Keep Chopping", DoAction(self.inst, function() return FindEntityToWorkAction(self.inst, ACTIONS.CHOP) end)), IfNode(function() return self.inst.prefab == "creature" end, "Keep Mining", DoAction(self.inst, function() return FindEntityToWorkAction(self.inst, ACTIONS.MINE) end)), IfNode(function() return self.inst.prefab == "creature" end, "Keep Digging", DoAction(self.inst, function() return FindEntityToWorkAction(self.inst, ACTIONS.DIG, DIG_TAGS) end)), }, .25)), Follow(self.inst, GetLeader, MIN_FOLLOW_DIST, TARGET_FOLLOW_DIST, MAX_FOLLOW_DIST), WhileNode(function() return GetLeader(self.inst) ~= nil end, "Has Leader", FaceEntity(self.inst, GetFaceTargetFn, KeepFaceTargetFn)), }, .25) self.bt = BT(self.inst, root) end Those lines inside of this chunk must match your prefab's name. If it won't match your follower is not going to perform those actions (fighting,mining,chopping,digging) ex. 'Creature' =/= 'creature' and your follower will not dig out objects in this case. [SGcreature.lua] Change name 'creature' into yours follower's name. If you want your creature to be non-humanoid you can play with stategraph to match your animation's frames, but I don't know how to achieve rewarding results. [modmain.lua] PrefabFiles = { "taern", "taern_none", ------------ "creature", } Change name 'creature' into yours follower's name one more. Add this: Assets = { Asset("ATLAS", "images/inventoryimages/anchor.xml"), Asset("IMAGE", "images/inventoryimages/anchor.tex"), Asset("ANIM", "anim/creature.zip"), } This will make your item [anchor] avaible to craft and use. Just remember about CAPITALS. GLOBAL.STRINGS.NAMES.ANCHOR = "Anchor" GLOBAL.STRINGS.RECIPE_DESC.ANCHOR = "Allows you to summon your custom creature into this world." GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.ANCHOR = "Is this a Ouija board ?" local anchor = Ingredient( "anchor", 1 ) anchor.atlas = "images/inventoryimages/anchor.xml" local anchor = AddRecipe("anchor", { Ingredient("feather_crow", 2), Ingredient(GLOBAL.CHARACTER_INGREDIENT.SANITY, 20), Ingredient("goldnugget", 4)}, RECIPETABS.WAR, TECH.NONE, nil, nil, nil, nil, nil, "images/inventoryimages/anchor.xml") You will need to create additional: - [Main Folder -> exported -> anchor] for your item if you want to see it in game. - [Main Folder -> images -> inventoryimages] and place your 64x64 icon of item TEX and XML. Change names in XML too. Appendix So everything beyond 'vanilla' tutorial is added by me to make your life easier. If you have created your first custom character you won't have problems with distinguishing extraordinary files connected with custom follower. I have attached my template just few lines under this block of text. Have fun with your digital friend P.S. I know my english is not perfect, but I think it's pretty understandable. Well if not just write a comment below and I will try to help you the best I can Download the template here -----> Taern - Follower Tutorial.zip
-
Something I've noticed a lot of people have been struggling with is adding stories for Walter to tell that will be compatible with ones that are already there. Many people replace his story table, which means no other stories will be told other than the ones in that specific mod. In some cases you might want this, say if you're making a joke or a meme mod. However in most cases people want these stories to be told alongside other mods and the vanilla game, so here I will show how you do it properly. In its most basic form, this all will go in your modmain. (The forums hate me when it comes to formatting, so I'll provide a download link as well) This can be used in mods that aren't exclusively for stories as well. Imagine having secrets in your mod that are hinted about by Walter when he tells stories... If someone else's mod isn't compatible and people use it alongside yours, you can still let your stories show up by putting this line at the bottom of your modinfo. priority = -10 What this does is cause your mod to load after other mods by lowering the priority of it. Their mod will have already replaced the story table by the time yours adds stories to it. Hopefully this can help people who want to add stories. I love seeing the lore-friendly ideas other people have, it's fun to read them. modmain.lua