Farming Never Rot
О материале
«Farming Never Rot» — материал мастерской Project Zomboid. Карты, транспорт, оружие и моды для выживания. Данные Steam, описание автора и ссылка для установки через подписку. Совместимость редакцией не проверена.
Описание автора
Farming Never Rot
About:
After plants fully mature they will not rot. Resets the max growth cycle if the plant is fully mature when checked. Feeling stuck at a your safe house waiting for pixels to grow, no more! Got a lazy friend in multiplayer that won't check crops, you can still be friends with this mod!
This is a quality of life written with the intent for multiplayer. If you are offline and the time is running your crops will not rot. This mod simply circumvents the plants going rotten on the growth cycle after plants reach maturity.
Disease will continue to affect the plants. Plants can still die or recede due to infestation or lack of water.
Nitty Gritty
A simple if statement that limits the growth state to 6, which should be the seed bearing stage.
Previously we just added an if statement into an existing function
Replaces the SFarmingSystem:growPlant basicFarming.growPlant from
/media/lua/server/Farming/SFarmingSystem.lua /media/lua/server/Farming/basicFarming.lua
to add one if statement
if (luaObject.nbOfGrow >6) then
luaObject.nbOfGrow = 6
end
Thanks to star in the comments section to show us a cool way to Monkey patch the function. While it's a hacky way of doing things it fits for this type of mod, which is such a minor change to force a loop, and should allow better compatibility with other mods, if any that modify the core function.
Every plant cycle nbOfGrow is increased by 1, every cycle it will call one of the following methods from the following methods /media/lua/server/Farming/farming_vegetableconf.lua
farming_vegetableconf.growCarrots farming_vegetableconf.growBroccoli farming_vegetableconf.growStrewberries farming_vegetableconf.growRedRadish farming_vegetableconf.growTomato farming_vegetableconf.growPotato farming_vegetableconf.growCabbage
All of these methods run a unique routine if the nbOfGrow is 6 or less. Otherwise it triggers the planting.state to rotten. So if nbOfGrow is 7 or greater it will turn rotten.
Repackaging Distribution, Adding it to your server mods
Want to merge this into another mod, package it for your server, blah blah blah. Go for it! link backs, credit or a mention is totally appreciated but in absolutely no way necessary. Treat it like GPL software make the world a better place one line of code at a time! Feedback and/or a "hey it's awesome" comment are nifty too.
Compatibility and Testing
Tested with versions from 40.30 to 41.65, multiplayer tests seems to be working ok with Build 41. It's doubtful this will fail until there is a major farming update.
Thanks to the folks at Good Old Dayz for setting this up on their server; reports are that it works dandy in a 24/7 multiplayer (build 40), thanks for the invaluable testing!
Workshop ID: 1415491388 Mod ID: FarmingNeverRot
Как установить и запустить
Откройте оригинальную страницу в Steam Workshop, проверьте версию игры, зависимости и порядок загрузки в описании автора. Нажмите «Подписаться» и дождитесь загрузки Steam. Включите материал в меню модификаций или контента игры, если это требуется. Совместимость и запуск редакцией не проверены.