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

  1. 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!
  2. Yep, I have a tag added at initialization which I check the owner of the widget to have before I do anything
  3. 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!
  4. 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!
  5. 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.
  6. I tried with -5 health / second and it still does not trigger the arrow :/
  7. Your solution with an event for updating net vars worked, thank you!
  8. Hi! How does one call a function on the client from the server? Thanks in advance!
  9. 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.
  10. 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?
  11. 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.
  12. 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 :/
  13. How do you invoke (and then later hide) the damage over time overlay that appears when you are starving?
  14. Testing just to make sure, running it from client does indeed not work, kind of out of options :/
  15. 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
  16. 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.
  17. 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 :/
  18. 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)
  19. 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?
  20. Yes thanks, I can make it work with that!
  21. 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!
  22. 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?
  23. 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?
  24. 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?