Jump to content

Help with perks for a character mod

Recommended Posts

I've recently decided to try and get into making character mods, and decided to start with an OC of mine. After watching some tutorials, I think I know how to do most of what I need to do, but I'm not sure how to add perks. The character always wears a sweater, so I was thinking it'd be a little easier for him to stay warm in the winter (and maybe, in turn, harder to stay cool during the summer). Is there any way I could do that? 

Link to comment
Share on other sites

The best way to start is to take a look through the game files at existing examples that might give you an idea of how it might work!

For natural warmth, Wilson's beard is an example you might want to look at, since he is also granted a natural warmth at certain beard stages. You might find it in wilson.lua in the prefabs folder. or you might find something more useful in some sort of "bearded" or "insulation" component in the components folder. Poke around a little! Maybe hats and clothing items might hold some answers too.

testing to see if it works is one thing to take into account. To see if it works, go BIG. throw in a number 1000 times larger than you think you will need, and start a new world in winter. If you feel like you've become immune to cold, you're probably going in the right direction.

You'll have to unzip the scripts bundle file first though, I forgot they recently made it so that all the game scripts are zipped up in databundles now.


Natural insulation is easy, but making it harder to stay cool is a little more tricky than one might assume, as I've found. but it's good to start small and work your way up

Link to comment
Share on other sites

For perks its best to go with pickleplayer's suggestion on checking on the items ingame and see what you can gather more or less. But for insulation of a character here's some code that'll do what your asking for:

inst.components.temperature.inherentinsulation = 120 --60 for small, 120 medium, and 240 for large amount of winter insulation not summer so it'll go against you

As for the 1000 times larger id rather say you should multiply it by 3 times instead since there is a limit on somethings and you'll crash since the game can't go that large. Other than that you can also search other mods and see what people did to get perks (for the most part most people don't care about copying code from their mod just don't name the prefabs with the same name).

Edited by K1NGT1GER609
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...