Jump to content

Recommended Posts

I'm creating a character and I had tried to put some perks. Well, I got success with some of them, like upgradable system (health, speed and health regen), different stats to different times of the day, and this is pretty cool kk. Now I have some perks that I want to "put" but I just can't realize how to do. Can someone help me?

*Upgradable damage multiplier(0.5 to 1.5   ex: 0.5 + upgrade/30 where level 30 is the cap, to work with the other system);

*A boost on the damage(double), speed(double) and hunger rate (double) when the sanity drop to 0;

*Heat resistence (I already got the code for cold weakness);

*Health/sanity/hunger damaged when get wet;

*And if is possible, loses 1 of sanity with each kill of any mob;

I already had searched for codes and etc, but when I find something, no one explain where and how to put the code, like if is on local master_postinit = function(inst) or local common_postinit = function(inst). So.. please, explain, I will be very very grateful. 

That is all, thanks for reading. \o/

Ps: sorry for the english, isn't my main language x.x

Edited by chaucan
Link to comment
https://forums.kleientertainment.com/forums/topic/71498-character-perks/
Share on other sites

I don'k know did you find the code but if you don't you can use this

for lose 1 sanity put them anywhere in character.lua

local function onkilled(inst, data)
	if data.victim ~= nil and data.victim.components.health ~= nil then
	    inst.components.sanity:DoDelta(-1)
    end
end

local function master_init(inst)
	inst:ListenForEvent("killed", onkilled)
end

and overheat redistance put them under stats

inst.components.temperature.maxtemp = 60
inst.components.temperature.overheattemp = 70

 

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...