Jump to content

Recommended Posts

'Ello lads, I'm here asking for any and all of your help with effect/item coding. What I need help with is the planned features tab on my mod, Wakana The Adventurous. I would love the help as I've been working hard enough on this mod and I really don't need the stress that comes with coding bugs and issues. If any of you do help with my mod you will be added into the contributors list on the mod page.

I would love the help as I've been working hard enough on this mod and I really don't need the stress that comes with coding bugs and issues.

 

So you want other people to deal with that stress? :razz:

 

Anyway, some of the features on that list aren't that hard, like gaining sanity from walking: use custom_rate_fn from the sanity component. It's a function that you must define yourself that returns a dapperness bonus depending on custom conditions.

In this case, you want to return a bonus when the character is moving, which can be done with Locomotor.isrunning, like this:

inst.components.sanity.custom_rate_fn = function(inst)    if inst.components.locomotor.isrunning then        return TUNING.DAPPERNESS_SMALL -- 2 units of sanity per minute    else        return 0    endend

To be put in master_postinit.

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