Project Zomboid

Project Zomboid

221 个评价
Farming Never Rot
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
138.967 KB
2018 年 6 月 18 日 上午 7:20
2021 年 12 月 22 日 下午 4:44
4 项改动说明 ( 查看 )

订阅以下载
Farming Never Rot

描述
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[www.thegoodolddayz.com] 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
热门讨论 查看全部(1)
0
2018 年 12 月 7 日 上午 7:34
Exception errors on client side. 40.36
Starman
38 条留言
Luth 2023 年 7 月 6 日 下午 12:37 
The mod description says it limits the growth state to 6 but according to the wiki, the seed-bearing stage is 7.
king_kong 2023 年 1 月 20 日 上午 8:50 
This mod isn't working right anymore, I just ran it in my game with accelerated growth time and I could never get seeds out of it. I found these mods work correctly Farming Without the Rotting and Crops Never Rot .

I like Farming Without the Rotting more because the other mod has a sandbox option that no one understands
Arcturus 2023 年 1 月 16 日 下午 11:08 
Does this mod still work?
Doctor Sex 2022 年 11 月 12 日 上午 11:20 
i think its deleting seeding phase to plants too
Torkkar 2022 年 8 月 15 日 下午 7:23 
ok so after reading the description I gotta ask is this compatible with mod: Mo' Crops
Thee'e Vang 2022 年 7 月 22 日 上午 12:59 
41.71?
puerto 2022 年 3 月 8 日 上午 11:22 
any news?
Humsas 2022 年 1 月 23 日 上午 7:46 
Does not seem to work on hosted server.
Rainoa 2022 年 1 月 16 日 上午 10:01 
is it just me or is carrots seed bearing and ready to harvest models flipped?
https://steamproxy.net/sharedfiles/filedetails/?id=2721813524
https://steamproxy.net/sharedfiles/filedetails/?id=2721813368
i wonder if this is base game issue or a mod im using somehow did this?
any idea's if it somehow could be this 1?
Colonel Wolfe 2022 年 1 月 16 日 上午 9:49 
This mod does not work, confirmed