Jump to content

Recommended Posts

I have also tried this but it seems not to work. 

local function sanityfn(inst, phase)
    if phase == "day" then
         inst.components.sanity.day.dapperness = (tunning.DAPPERNESS_LARGE + 0)
    elseif phase == "night" then
        inst.components.sanity.night.dapperness = (tunning.DAPPERNESS_LARGE + 3)
    elseif phase == "dusk" then
         inst.components.sanity.dusk.dapperness = (tunning.DAPPERNESS_LARGE + 0 )
    end

end

I don't get any errors so on , only it aint working.

Edited by durant313

do you want it for your characer, or for everyone?

If for everyone it is easy, the other is more complicated.

edit:
I guess you want it for your mod character so:
I took a look at the code and I found only one way to mod this so far:
Put in your  master_postinit(inst) function this:
inst.components.sanity.night_drain_mult = -1
This will reverse the sanity gain at night. So instead of loosing sanity, you will get that amount in the dark.

Edited by Serpens
14 minutes ago, durant313 said:

Hello thanks , but it didnt work... 

you really should start giving a bit more information, otherwise I can't help you ...

If it would work, is it what you asked for? Or do you want a complete different thing?

What does not work? Is there an error message? What error? Please upload client_log.txt file with the error in it.
Since I don't have your files, I can't test it, so you have to test it and report the problem precisly.

Edited by Serpens
On 9/20/2016 at 10:09 PM, durant313 said:

oh sorry bro , I don't see your reply it is so slow...

Well I will messenge you privatly u instead and show you everything.

 

It's really not in the spirit of the modding community to keep the code private.

Klei's entire game logic is all out in the open for anyone to go by, dissect, reuse, and improve upon.

 

For instance now instead of having multiple people able to help you, you've delegated your help to one individual.

19 minutes ago, CarlZalph said:

It's really not in the spirit of the modding community to keep the code private.

Klei's entire game logic is all out in the open for anyone to go by, dissect, reuse, and improve upon.

 

For instance now instead of having multiple people able to help you, you've delegated your help to one individual.

the code I gave him was correct.

he just had
inst.components.sanity.night_drain_mult = 1.3
somewhere else, so this was overriding my -1, so that's why it did not work.

Since there is only this multiplier for night, I was not able to help him with changing it for day/dusk.

I also gave him code to loose 10 sanity for any attacked damage:
 

Quote

so if it should be -10 regardless of the damage amount (so you will also get -10 if you have a 100% armor equipped), add this to your master_postinit:

    inst:ListenForEvent("attacked",function(inst,data)
        inst.components.sanity:DoDelta(-10)
    end) 

 

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