The Noon Fish Posted March 8, 2015 Share Posted March 8, 2015 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 somethingNoonFish and others.ziplog.txt Link to comment Share on other sites More sharing options...
debugman18 Posted March 8, 2015 Share Posted March 8, 2015 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 somethingNoonFish and others.ziplog.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. Link to comment Share on other sites More sharing options...
The Noon Fish Posted March 9, 2015 Author Share Posted March 9, 2015 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 Link to comment Share on other sites More sharing options...
The Noon Fish Posted March 9, 2015 Author Share Posted March 9, 2015 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* Link to comment Share on other sites More sharing options...
The Noon Fish Posted March 11, 2015 Author Share Posted March 11, 2015 guysinst.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 pointNoonFish and others.ziplog.txt Link to comment Share on other sites More sharing options...
Blueberrys Posted March 11, 2015 Share Posted March 11, 2015 @The Noon Fish "GetSeasonManager():IsRaining()" Does in fact return a boolean value. Do you want to just increase sanity in rain? Or does it have to be by wetness? Link to comment Share on other sites More sharing options...
The Noon Fish Posted March 11, 2015 Author Share Posted March 11, 2015 @Blueberrys, (third time writing this because "you cant do that!" error for invalid characters or something strikes again) i want it to be both since i want my character to revolve around the water/ice theme. Link to comment Share on other sites More sharing options...
Blueberrys Posted March 11, 2015 Share Posted March 11, 2015 @The Noon Fish, 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 Link to comment Share on other sites More sharing options...
The Noon Fish Posted March 12, 2015 Author Share Posted March 12, 2015 @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" Link to comment Share on other sites More sharing options...
Blueberrys Posted March 12, 2015 Share Posted March 12, 2015 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 Link to comment Share on other sites More sharing options...
The Noon Fish Posted March 12, 2015 Author Share Posted March 12, 2015 @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 -hurtratewould that make it healing instead of hurting?(also i found out the game cant add because i got "unexpected symbol near '+'") Link to comment Share on other sites More sharing options...
Blueberrys Posted March 12, 2015 Share Posted March 12, 2015 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? Link to comment Share on other sites More sharing options...
The Noon Fish Posted March 12, 2015 Author Share Posted March 12, 2015 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/RoGthat and im kinda bad at remembering things.plus school is a thinginst.components.locomotor.walkspeed = TUNING.WILSON_WALK_SPEED * 1.2 + 1 Link to comment Share on other sites More sharing options...
Blueberrys Posted March 12, 2015 Share Posted March 12, 2015 What are the lines before and after that? Are you sure you haven't missed a comma or bracket somewhere nearby? Link to comment Share on other sites More sharing options...
The Noon Fish Posted March 12, 2015 Author Share Posted March 12, 2015 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 Link to comment Share on other sites More sharing options...
The Noon Fish Posted March 13, 2015 Author Share Posted March 13, 2015 i managed to fix the wetness thing, but the raining thing still isn't workingi looked at the the link and everything, but it still doesn't worknoonfish.lua Link to comment Share on other sites More sharing options...
The Noon Fish Posted March 15, 2015 Author Share Posted March 15, 2015 Nvm i think i fixed ityea i think so ehhhhh Link to comment Share on other sites More sharing options...
Recommended Posts
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.