Jump to content

Adding perks and whatnot


Recommended Posts

Okay, I am very new to coding stuff (i have no coding experience at all) and need help adding some perks to a character of mine. 

Perks that I hope to add:

immune to cold, able to eat all raw meat with no negativity, sanity drain during day but not dusk or night, and small monsters such as birds and rabbits dont flee since he is stealthy. 

Also, is there a limit on the stats and damage multiplier?? (and how do you add items to your starting inventory???) 

Link to comment
Share on other sites

Put this inside YOURCHARACTER.lua is master_postinit

Spoiler

inst.components.eater.Eat_orig = inst.components.eater.Eat
function inst.components.eater:Eat(food)
if food and food.components.edible
and food.components.edible.foodtype == FOODTYPE.MEAT
and self:CanEat(food) then
if food.components.edible.sanityvalue < 0 then
food.components.edible.sanityvalue = 0
end
end
return inst.components.eater:Eat_orig(food)
end

It should make you not take sanity penalty from any meat, I think :)..

 

Link to comment
Share on other sites

you can use this for immune to cold

inst.components.temperature.mintemp = 20

put it under master_postinit in character.lua

that makes your minimum temperature 20 

 

for add items to starting inventory

this must be in your  character.lua

local start_inv = {
    "fishsticks",
    "fishsticks",
    "fishsticks",
    "fishtacos",
    "fishtacos",
    "fishtacos",
	"ice",
	"ice",
	"ice",
	"ice",
	"bluegem",
	"bluegem",
	"bluegem",
}

it's a example you can chance the items and you can add more 

Edited by AkaiNight
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
 Share

×
  • Create New...