Modding Help Sleeping, bathing and picky eating

Discussion in 'Starbound Modding' started by uPr0ph3tu, Aug 21, 2019.

  1. uPr0ph3tu

    uPr0ph3tu Intergalactic Tourist

    Hey everyone,

    I have a mod running on my dedicated server, that slows hunger to 1 hour.

    I would like to publish a mod on workshop that:

    1) If you don't sleep within 6 hours for 30 seconds, screen gets increasingly blurry
    2) If you don't bathe within 12 hours you get tiny flies surrounding you mgs style
    3) Can't eat the same item twice in 6 hours that way players are forced to have variety of foods. Don't want this to interfere with other consumables however like potions etc

    Any templates/snipets stuff like that I can work with to get familiarized ? I'm not sure where to look
     
    Last edited: Aug 21, 2019
  2. uPr0ph3tu

    uPr0ph3tu Intergalactic Tourist

    Basically my questions is
    Asset-wise:
    1) Where do I edit sleep effects
    2) How can I proceed with the bathing option
    3) Where can I edit eating behaviour like that ?

    EDIT: I think I'm looking for 'listeners' to be more specific
     
    Last edited: Aug 21, 2019
  3. Zaakari

    Zaakari Pangalactic Porcupine

    1) It looks like most (if not all) beds have a status effect that they link to. See the file "/objects/generic/woodenbed/woodenbed.object" for reference. You can see it has a property "sitStatusEffectts".
    So I suppose you could patch all the beds in the game, or their status effects; or, you could edit the Lua file that they all seem to call: "/stats/effects/bed/bed.lua".

    2) I'm not sure what you would do for this. Though, you might be able to work something with custom status effects.
    In that case, you would most likely need message handlers. For those, have a look at this very helpful post (and the pages it links to): Starbound sending messages

    For the cleanliness, I suppose you would want to create a custom stat. And then make a custom effect (like "getDirty"), which would decrease the cleanliness stat every update. Then when the cleanliness falls to a certain level, give the player another status effect that shows the flies buzzing around him. And then--I suppose--when the player gets wet or uses a shower-like object, the cleanliness stat gets reset, and the flies effect gets removed.

    3) I'm not sure what file handles eating. Perhaps someone else can help out here.

    Edit:
    Now that I think about it, perhaps you wouldn't need message handlers.
     
    Last edited: Aug 21, 2019
  4. uPr0ph3tu

    uPr0ph3tu Intergalactic Tourist

    hi there !

    Thanks for answering.

    It's ok I took a different approach.

    1) I've Slowed down all the bandage/healing rates in the game so sleeping heals faster which makes it better for you to sleep when you're badly injured rather than waste bandages etc which now heal much less throughout longer periods.

    2) bathing.. eh thought it would be cool. Too much work for little aesthetic gain. I feel like there's so much that can go wrong (conflict) with this mod, not to mention rain gets you wet doesn't really count as cleaning you'd still stink. So forget it that one's a pipe dream.

    3) Not eating the same food twice.. Well It's fine, instead I put the mod bigger stomach and edited the value.

    The only thing that's bugging me now is that some items have health regen. I'm looking at the /stats/effects/regeneration files and I'm wondering, if I change the multiplie to like 0.5 say

    function init()
    animator.setParticleEmitterOffsetRegion("healing", mcontroller.boundBox())
    animator.setParticleEmitterActive("healing", config.getParameter("particles", true))

    script.setUpdateDelta(5)

    self.healingRate = 1.0 / config.getParameter("healTime", 60)
    end

    would that work

    EDIT:
    Disregard. Regeneration.lua and regenerationaugment.lua are lua (obviously) so you can't patch 'em I have to load my version of the script. Good thing I've edited the metadata of all my mods and written it down in excel
     
    Last edited: Aug 21, 2019

Share This Page