Jump to content

Mod character's perks problem

Recommended Posts

I want to add some perks to my character but i can't find clear commands to this:

- crafting speed - 1,5 times longer

- sanity drain from shadow creatures - 1,5 greater than usual

- gains x0,5 less hunger from eating stale and spoiled food

- has 10% chace of getting Wet Goop from any crockpot recipe

I tried to search for mods in workshop and dug into code, but sadly i'm tired of searching

Can someone help?

Link to comment
Share on other sites

There aren't "commands" to do these things, you'd have to make them yourself.

For the crafting speed you'd be tapping into the stategraph.

Sanity drain hooking into the target prefabs and then its sanityaura component.

Food stuff check out the eater component and how to set that up.

Look at the cookpot recipe handling for what it's supposed to make and then hook the function that generates the output and replace it with your odds.

Link to comment
Share on other sites


Which functions should I use for this? 

GetPlayer is probably for DS only...or i did something wrong, cause it crashes my game


edit: ok, i got spoliage food working, but i cannot find anything helpful in stategraph folder

any help?

Edited by TheMagmer
Link to comment
Share on other sites

Yeah, GetPlayer() is DS only. ThePlayer is DST

If you're getting a nil value, have a look at how the ActionQueue Reborn client-only mod does it.

AddComponentPostInit("playercontroller", function(self, inst)
    if inst ~= GLOBAL.ThePlayer then return end
    ThePlayer = GLOBAL.ThePlayer
    TheWorld = GLOBAL.TheWorld

As you can see, this is the "playercontroller" "component".

And there will be one for each player


> I tried to search for mods in workshop and dug into code, but sadly i'm tired of searching

I don't know what to tell you :p.

There seems to be a big learning curve with starting to mod.

I'm pretty new to DST modding, and have hit a few stumbling blocks too :p.


Let me try to do a little of the work for you, to maybe kick you out of a rut, show you how something can be done, and inspire you to keep going.

From how I'm interpreting the /scripts/ files...

I'm assuming you need to make a /prefabs/yourcharacter.lua file in your mod folder (or find someone else's character mod to start off as a baseline). Then add some of the stuff from inside other characters' prefab files. For example, Wolfgang's one (/scripts/prefabs/wolfgang.lua) contains

inst.components.sanity.neg_aura_mult = 1.1

which I think you're looking for.

ie: as Carl said "sanityaura component" on "target prefabs"

And yes, to see the file for it, you go to /scripts/components/sanity.lua


By looking at how the game, or other mods already do things. That's how I figure stuff out at least.

Good luck :)

Edited by Bigfootmech
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...