ColinTheNPC Posted January 19, 2019 Share Posted January 19, 2019 Hello fellow starvers, I have never thought I'd be using the Don't starve forum but here I am now, My first post I have actually thought of making a simple mod/ script of making a hat thats only exclusive to one character I just made. I'll deal with the character itself later but for now I am actually kinda stuck on the scripting part where the hat gives off sanity when equiped. I want to make a hat that has the same sanity regen as a tophat. Any of you got any idea for the script into making the Sanity regen? Link to comment Share on other sites More sharing options...
Ultroman Posted January 19, 2019 Share Posted January 19, 2019 (edited) Why not look at the tophat prefab? It does very few things but exactly this. Before you get too far, you should take a LUA crash course, and preferably more. Also, look at the current game code, otherwise, you'll be in over your head before you can count to tophat. I think it's a pretty good idea to start with the item since they're much simpler than a character. They're already difficult, since making the graphics work in the game is a chore in itself (and not something I can help with; I only do code). For the code, you'll end up with something almost identical to the tophat, so go look at that. You'll find the game scripts in steamapps\common\Don't Starve Together\data\databundles\scripts.zip Unpack that somewhere far away from your game folder. In the "prefabs" folder you'll find all the entities in the game (players, items, creatures, bosses etc.). Some prefabs files hold more than one creature, like the "spider" and "cavespiders" prefabs. You're looking for the "hats" prefab, which contains all the hats. Since that file might be daunting in itself, I would take a look at other mods, like "Gray Wizard Hat", which adds a simple wizard hat to the game, with a recipe and everything. Then you can look at restricting it to your future character later. Edited January 19, 2019 by Ultroman Link to comment Share on other sites More sharing options...
ColinTheNPC Posted January 20, 2019 Author Share Posted January 20, 2019 Thanks mate i tried finding the prefabs not so while ago but i just couldnt find the path for it. Yway yea your answer helped! Link to comment Share on other sites More sharing options...
CarlZalph Posted January 20, 2019 Share Posted January 20, 2019 43 minutes ago, ColinTheNPC said: Thanks mate i tried finding the prefabs not so while ago but i just couldnt find the path for it. Yway yea your answer helped! scripts/prefabs/hats.lua It has every hat in the game in there. Link to comment Share on other sites More sharing options...
Thomas Die Posted January 20, 2019 Share Posted January 20, 2019 inst.components.equippable.dapperness = TUNING.DAPPERNESS_SMALL that's it Link to comment Share on other sites More sharing options...
Ultroman Posted January 20, 2019 Share Posted January 20, 2019 Yep. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now