Jump to content

Recommended Posts

yea i know it's still a work in progress, but i want a single player version ready to play.

problem is, the game crashes and it doesn't really tell me whats wrong, it just says "moduntil crased at 56" or something

NoonFish and others.zip

log.txt

yea i know it's still a work in progress, but i want a single player version ready to play.

problem is, the game crashes and it doesn't really tell me whats wrong, it just says "moduntil crased at 56" or something

attachicon.gifNoonFish and others.zip

attachicon.giflog.txt

 

That should give you an idea of what is going wrong, actually.

 

scripts/modutil.lua:56: attempt to call upvalue 'postfn' (a nil value)

 

It suggests that you're using DoAddClassPostConstruct somewhere without declaring the postfn.

That should give you an idea of what is going wrong, actually.

 

scripts/modutil.lua:56: attempt to call upvalue 'postfn' (a nil value)

 

It suggests that you're using DoAddClassPostConstruct somewhere without declaring the postfn.

ok i found the source of the problem and fixed it

AddPrefabPostInit("sanity", function(inst)	local old = inst.components.sanity:GetMoistureDelta()	function m = self.inst.components.moiture			easing.insine(m:GetMoisture(), 0, TUNING.MOISTURE_SANITY_PENALTY_MAX, m.moitureclamp.max)			if m = self and m = self.prefab == "noonfish" then				local m = self.inst.components.moisture				return easing.inSine(m:GetMoisture(), 0, 140, m.moistureclamp.max)		end	endend)

this doesn't work, but it doesn't crash the game. .-.

im trying to get my character gain sanity from being wet

*rams head into wall*

guys

inst.components.sanity.custom_rate_fn = function(inst)		local rain_delta = GetSeasonManager() and GetSeasonManager():IsRaining()		local mydelta = -(rain_delta * 1.5)		return mydeltaend 

does this look functional to you? for some reason the game says it's a boolean value(idk how but it happened) and im basically rolling my face on the keyboard at this point

NoonFish and others.zip

log.txt

Follow the link for increasing sanity in rain.

 

Use this for wetness.

TUNING.MOISTURE_SANITY_MAX = -TUNING.MOISTURE_SANITY_PENALTY_MAX-- Can be whatever you wantfunction moisture_delta(inst)    local m = inst.components.moisture    return easing.inSine(m:GetMoisture(), 0, TUNING.MOISTURE_SANITY_MAX, m.moistureclamp.max)end-- ...-- where inst is the player instanceinst.components.sanity.custom_rate_fn = function(inst)    local negate_moisture_penalty = -(inst.components.sanity:GetMoistureDelta())    local moisture_rate = negate_moisture_penalty + moisture_delta(inst)    return moisture_rateend 
Edited by Blueberrys

@Blueberrys, the code you gave me doesn't work, so i assume it would only work once my character reaches the moist limit.... also 

AddComponentPostInit("temperature", function(self)    local old = self.OnUpdate    function self:OnUpdate(dt, applyhealthdelta)        old(self, dt, applyhealthdelta)        if self.inst.prefab == "noonfish" and applyhealthdelta and self.current < 0 and self.inst.components.health then            self.inst.components.health:DoDelta(self.hurtrate*dt*1.5, true, "cold")        end    endend)

this doesn't work, but i assume it's because of 

self.hurtrate*dt*1.5, true, "cold"

Change the moisture_delta function and see if it has any effect.

 

You should modify the component through your prefab instead of using a component post init.

-- Where inst is your player instanceinst.components.temperature.OnUpdate = ...

But why not listen for the startfreezing event instead? It's pushed when the temperature reaches below 0.

 

And I'm not certain what you're trying to accomplish, but if you just want to change the hurtrate you can simply do something like this and it should work fine.

-- Doubles hurtrateinst.components.temperature.hurtrate = inst.components.temperature.hurtrate*2

@Blueberrys, I'm trying to get my character to gain health while freezing instead of losing health, and i think the hurt rate is a negitive, so if i do 

-hurtrate

would that make it healing instead of hurting?

(also i found out the game cant add because i got  "unexpected symbol near '+'")

I'm trying to get my character to gain health while freezing instead of losing health, and i think the hurt rate is a negitive, so if i do

 would that make it healing instead of hurting?

Try it and let me know.

Edit (spoiler):

Hint: Think about this, what happens if you put a negative before a number?

e.g. (2) -> (-2)

or (-2) -> (-(-2)) -> (2)

Double negative

 

(also i found out the game cant add because i got  "unexpected symbol near '+'")

 

Please provide the relevant code, I can't fix what I can't see.

Have you tried to understand and use the information from the previous posts?

Edited by Blueberrys

Try it and let me know.

Edit (spoiler):

Hint: Think about this, what happens if you put a negative before a number?

e.g. (2) -> (-2)

or (-2) -> (-(-2)) -> (2)

Double negative

 

 

Please provide the relevant code, I can't fix what I can't see.

Have you tried to understand and use the information from the previous posts?

 

will try

 

yes i do try to understand and use the imformation in previous posts and other things, but it's hard swapping from DST and DS/RoG

that and im kinda bad at remembering things.

plus school is a thing

inst.components.locomotor.walkspeed = TUNING.WILSON_WALK_SPEED * 1.2 + 1
Edited by The Noon Fish

What are the lines before and after that? Are you sure you haven't missed a comma or bracket somewhere nearby?

ok nvm about that, it kinda works (it doesnt crash the game, yay)

but my character (still) doesn't gain sainty from rain or being soaked to the max

(she kinda gains health while freezing but i havent tested the new codes yet because i felt like drawing ;-; )

noonfish.lua

Edited by The Noon Fish

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