
WhiteAutumn
-
Content count
27 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Klei Bug Tracker
Game Updates
Hot Lava Bug Reporter
Everything posted by WhiteAutumn
-
Show the down arrow at health meter [Solved]
WhiteAutumn posted a topic in [Don't Starve Together] Mods and Tools
Hi, I'm making a thing that needs health to be drained constantly. Copying how hunger.lua does it I did inst:DoPeriodicTask running every second that calls health:DoDelta which works, however I don't get this down arrow that you get when you are starving? I don't see anything in hunger.lua which makes this arrow appear, how do you do it? Thanks in advance! -
Show the down arrow at health meter [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
Yep, I have a tag added at initialization which I check the owner of the widget to have before I do anything -
Show the down arrow at health meter [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
It works! Think I have all my questions answered now finally, my inquisition of the DST modding forums is over haha. A huge thanks to everyone who has helped me! -
Show the down arrow at health meter [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
Couldn't I override OnUpdate using AddClassPostConstruct then and change it to show changes in health caused by my mod? I'll keep this in mind if I am not able to modify the health badge to show changes in health from my mod, thanks! -
Show the down arrow at health meter [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
I suppose, however I would like it more if I could thematically stay away from the overheating effect. Using the overheating mechanic would invoke the sort of orange-y overlay would it not? Also wouldn't stuff like eating ice or endothermic firepits stop the overheating effect? I wouldn't want that. -
Show the down arrow at health meter [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
I tried with -5 health / second and it still does not trigger the arrow :/ -
Calling a function on the client from the server? [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
Your solution with an event for updating net vars worked, thank you! -
Calling a function on the client from the server? [Solved]
WhiteAutumn posted a topic in [Don't Starve Together] Mods and Tools
Hi! How does one call a function on the client from the server? Thanks in advance! -
Calling a function on the client from the server? [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
Something visual is exactly what I need updated sadly, a widget. I have modified the bloodover widget to show red if the player is in daylight and not sheltered. This works fine when the user is the host however when they are a client the sheltered event only gets fired on the server which means while the user does not take damage while standing under a tree they still see the red overlay because the client has not had a chance to update it. I suppose I could have a periodic task on the client checking if it needs to update the overlay ever second but that seems dirty. -
Calling a function on the client from the server? [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
You're right! For whatever reason since I created my account my posts need to be approved by mods before they become public :/ edit: Looks like a mod while reading this message for approval removed my restriction! That or you need 20 posts approved before you can post without that limitation. Let me elaborate. I have the a listener for whenever shelter changes however that event only gets fired on the server and I need to update a thing on the client. I had the impression RPCs only work from client -> server but perhaps that's wrong? -
How to invoke the damage over time overlay? [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
That also crashes but this time at line 45 in bloodover.lua due to owner being nil. It's fine though, i've found a hacky workaround that does work. Turns out there's only one listener for the event "stopstarving" and that listener is the one in bloodover.lua which calls UpdateState so I can just push event stopstarving whenever I want UpdateState called and it works. -
Show the down arrow at health meter [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
I don't, i just figured since the health arrow thing that appears is a client sided thing perhaps you would need to call it on client. My problem is still that my health does decrease like intended however the arrow does not appear :/ -
How to invoke the damage over time overlay? [Solved]
WhiteAutumn posted a topic in [Don't Starve Together] Mods and Tools
How do you invoke (and then later hide) the damage over time overlay that appears when you are starving? -
Show the down arrow at health meter [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
Testing just to make sure, running it from client does indeed not work, kind of out of options :/ -
How to invoke the damage over time overlay? [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
Testing the suggested change leaves the game in an infinite loop upon character load :/ edit: hold on something else seems to be causing that edit: Okay this time I have what actually happens. The game loads fine however on phase change it crashes: Line 70 is this (a part of previous code snippets): if (self.owner.IsFreezing ~= nil and self.owner:IsFreezing()) or -
Show the down arrow at health meter [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
Sorry that was a mistake from my trying to extract a more readable snippet from my mod, in code it's actually a dot. One thing I forgot to mention is that my code snipped runs only server side since I components can't be modified on the client (iirc), maybe that's useful for diagnosing the problem. -
Show the down arrow at health meter [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
Tested and does not work :/ Looking at the declaration of DoDelta in health.lua function Health:DoDelta(amount, overtime, cause, ignore_invincible, afflicter, ignore_absorb) You'd think overtime true would make the arrow appear :/ -
Show the down arrow at health meter [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
Here you go: local function doHealthDelta(inst) if not inst.components.health:IsDead() and not inst:HasTag("playerghost") then inst.components.health:DoDelta(-0.1, true, "light") end end healthDeltaTask = inst:DoPeriodicTask(1, doHealthDelta, nil, inst) -
How to invoke the damage over time overlay? [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
Wouldn't this add a new listener every time UpdateState is called? eventually resulting in UpdateState being called a lot of times on phase change? -
Event for changing light level? [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
Yes thanks, I can make it work with that! -
Get waterproofness of character [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
Awesome thanks! -
Event for changing light level? [Solved]
WhiteAutumn posted a topic in [Don't Starve Together] Mods and Tools
Hello! Is there an event that gets fired upon the player moving between areas of different light levels, for example walking out into darkness or walking closer to a fire? Thanks in advance! -
Get waterproofness of character [Solved]
WhiteAutumn posted a topic in [Don't Starve Together] Mods and Tools
Hi, I'm working on a character that takes damage from the sunlight but can hide under trees / umbrellas. I was thinking I could implement this by checking the characters current waterproofness level since it should be affected by standing under trees and such. How can I get the waterproofness of my character? -
Get waterproofness of character [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
Thanks! I might go with just shelter then. I did also want it to work for stuff like umbrellas but not for rain-coasts, I guess I will have to check manually if the player is holding an umbrella? -
How to invoke the damage over time overlay? [Solved]
WhiteAutumn replied to WhiteAutumn's topic in [Don't Starve Together] Mods and Tools
Thanks that worked! Now my hopefully my final problem and question is about how to trigger UpdateState. Having a look in bloodover.lua we can see when UpdateState gets triggered self.inst:ListenForEvent("badaura", _Flash, owner) self.inst:ListenForEvent("attacked", function(owner, data) if not data.redirected then self:Flash() end end, owner) self.inst:ListenForEvent("damaged", _Flash, owner) -- same as attacked, but for non-combat situations like making a telltale heart self.inst:ListenForEvent("startstarving", _UpdateState, owner) self.inst:ListenForEvent("stopstarving", _UpdateState, owner) self.inst:ListenForEvent("startfreezing", _UpdateState, owner) self.inst:ListenForEvent("stopfreezing", _UpdateState, owner) self.inst:ListenForEvent("startoverheating", _UpdateState, owner) self.inst:ListenForEvent("stopoverheating", _UpdateState, owner) self.inst:DoTaskInTime(0, _UpdateState) However since I need it to update upon changing phase that won't work, is it possible to change UpdateState to be called upon phase change?