Jump to content

a little help? - custom character programing


Hial

Recommended Posts

hi :)

 

is my first time modding a character in Don't Starve,

I saw a lot of tutorials and started programing, but...

I'd like to know if it's possible to do something such specific as

"loose sanity if, not having a shovel in the inventory"

 

how can I do that? is that even possible?

if you could help me I would appreciate a lot

 

 

thanks for the help!!

Link to comment
Share on other sites

In your player data, you should have a "local function fn()" which has an "end" at its ...end, unsuprisingly. Put something like this into that function, ideally near the end:

inst.components.sanity.custom_rate_fn = function(inst)    if not inst.components.inventory:Has("shovel") then        return -.5 --this is the rate at which the guy goes mad (additional to normal rate)    endend

I haven't tested that myself, so it may have a syntax error or something.

 

Serionis' method is more complicated than it needs to be, but it should work too

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
×
  • Create New...