Project Zomboid
221 ψήφοι
Farming Never Rot
   
Βραβείο
Αγαπημένο
Αγαπημένο
Μη αγαπημένο
Μέγεθος αρχείου
Αναρτήθηκε
Ενημερώθηκε
138.967 KB
18 Ιουν 2018, 7:20
22 Δεκ 2021, 16: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
7 Δεκ 2018, 7:34
Exception errors on client side. 40.36
Starman
38 σχόλια
Luth 6 Ιουλ 2023, 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 20 Ιαν 2023, 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 16 Ιαν 2023, 23:08 
Does this mod still work?
Doctor Sex 12 Νοε 2022, 11:20 
i think its deleting seeding phase to plants too
Torkkar 15 Αυγ 2022, 19:23 
ok so after reading the description I gotta ask is this compatible with mod: Mo' Crops
Thee'e Vang 22 Ιουλ 2022, 0:59 
41.71?
puerto 8 Μαρ 2022, 11:22 
any news?
Humsas 23 Ιαν 2022, 7:46 
Does not seem to work on hosted server.
Rainoa 16 Ιαν 2022, 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 16 Ιαν 2022, 9:49 
This mod does not work, confirmed