Modding Help Eating More With The "Well Fed" Stat (Next on TLC)

Discussion in 'Starbound Modding' started by Surn_Thing, Mar 26, 2021.

Tags:
  1. Surn_Thing

    Surn_Thing Pangalactic Porcupine

    Is it possible to make it so that "wellfed" doesn't stop you from eating more? If I just get the patch right I could generate patches for every food item and create a mod that would allow you to get a whole bunch of positive buffs at once through food. The following patches are applied to food:

    This does nothing:

    Code:
     
    [
                  {
                    "op":"replace",
                    "path":"/blockingEffects",
                    "value":[]
                  }
    ]
    

    And neither does this:

    Code:
    [
                  {
                    "op":"remove",
                    "path":"/blockingEffects"
                  }
    ]
    
    The log file only complains when these patches are applied to drinks such as soda as they do not have the "blockingEffects" field.
     
  2. Zaakari

    Zaakari Scruffy Nerf-Herder

    Hm, I wonder if perhaps the "wellfed" effect is hard coded to block food consumption. A workaround might be to patch the "wellfed.statuseffect", changing the default duration to something small, and adding a custom script which calls "status.addEphemeralEffect" to add a custom "wellfed" effect to replace the vanilla one. This way, you'd avoid the hard coded check, while retaining functionality similar to the vanilla effect.

    wellfed.statuseffect.patch
    Code:
    [
      { "op": "replace",
      "path": "/defaultDuration",
      "value": 0.1
      },
      { "op": "add",
      "path": "/customDuration",
      "value": 120
      },
      { "op": "add",
      "path": "/scripts/~",
      "value": "wellfed_starter.lua"
      }
    ]
    
    wellfed_starter.lua
    Code:
    function init()
      sb.logInfo("Test")  -- If this script is called, you should see an entry in the log like "[11:11:17.687] [Info] Test"
      status.addEphemeralEffect("customWellfed", config.getParameter("customDuration", 120))
    end
    
    And then the "customWellfed.statuseffect" would be almost the same as the vanilla "wellfed.statuseffect", but having a different "name" (customWellfed).

    I haven't tested this--I'm a little short on time, at the moment--but I'm guessing it would work. The function "sb.logInfo" is just for testing purposes, you'd remove it once you know the script is working.
     
  3. Surn_Thing

    Surn_Thing Pangalactic Porcupine

    You have a far better understanding of how Starbound works than I do. Thanks for your input.
     

Share This Page