Configuration
Config.lua
Metabolism rates
One of the most important parts of the metabolism script is metabolism rates, they’re just a way to configure how fast hunger/thirst etc… will decrease in time.
Here are the main parameters that need to be tweaked:
Config.baseRate
: basically tells how much of each metabolism gets decreased at each tick (by default 1s)Config.lowTemperatureRate
: this is how much of metabolism gets decreased if the temperature is low, low temperature affects hunger.Config.highTemperatureRate
: as above, but for hot temperature. Hot temperature affects thirst.Config.walkingRate
: as above, but for walkingConfig.runningRate
: as above, but for running (walking and running are treated as separated actions, they don’t get added up).Config.stomachEmptyingRate
: this is how fast the stomach gets empty, basically it tells how frequently the player can eat again without vomiting because it’s full.Config.lowTemperature
: threshold value for low temperature, if the body temperature is below this temperature, it will add thelowTemperatureRate
debuff.Config.highTemperature
: same as above but inverted, if the body temperature is higher than this temperature, it will add thehighTemperatureRate
debuff.
How to configure an edible item
First of all edible items are located in the config.lua
file inside the Config.nutritionalValues
table, this table holds all the data for the script to add/remove metabolism stats, execute custom actions and potentially trigger diseases.
Example
Let’s say we want to add a new food which is a shrimp 🦐, we want it in two versions: raw_shrimp
and cooked_shrimp
so that we can give diseases if eaten raw.
Let’s go ahead and write a simple configuration
It’s that simple! You just bound two new items to the metabolism script.