Jump to content

ModdableFarming


cecilkorik

Recommended Posts

  • 2 weeks later...

I've got it almost entirely fixed. In fact I've got a version here but I'm not going to put it up on the main post yet because I'm still working out a few issues with the waterMins. I know you had a patch that allowed waterMin = 0, but I am having some trouble with it and the plants still insta-die without water. You can try it out though.

 

However it definitely fixes the issues with regrow/finalGrow. The issue was actually quite complicated but I don't have time to detail it right now. I'm still working on diagnosing the problem with the sprites as well.

 

I will have a proper 0.4 release out shortly, but it's late and I'm tired of banging my head against it tonight.

Link to comment
Share on other sites

I'm putting version 0.4 up right now. Please check the main post. I am actually very happy with this version, I've done quite a bit of testing on it and am very happy with how it's working now. It has been quite stable for me, and I am now using it with my own WIP crops addon which includes trees and vines and so on.

So now I'm confident it will fix the issues with regrow and finalGrow. I have regrowing trees working in my own mod now.

Sorry it took so long, the real issue was actually quite unexpected and took a long time to find. There was apparently a whole different harvest function hidden away in the client UI code. It does almost the exact same things as the main harvest function, but it didn't have my modifications to it and didn't know about the new settings I added, so it went through and deleted the plants because it decided they were dead/harvested already even though I had removed that code from the main harvest function the other function still was able to delete the plant. A strange way to design the code, but now that I know about it and where it is, it should not pose any future trouble.

I did find the issue you mentioned with the sprites, and they are now fixed as well.

I also added some other modifications and minor bugfixes, and I included the changes to waterMins to allow a minimum water of 0 if you want to disable most of the water checking. Setting it to 0 or nil should work now and the plant will not instantly die and will not lose health. However there may still be issues with disease and higher change of disease.

The one major improvement I was working on for this version is that you now have a choice of setting several fields to either a single value, or choosing individual values for each grow state using a table.

 

For all of the following data fields -- timeToGrowMin, timeToGrowMax, waterMins, WaterMaxes -- You can now choose to set them to either a single number which applies to ALL grow levels. Or you can set them to a table like {10,20,30,40,50,60,70} (7 table entries for maxGrow=7). Each table entry corresponds to the same numbered grow level. So if that table was set to waterMaxes, you could only add 10 water when it was first planted, however once it grows a bit you could add 20 water, and then a bit later the max you could add would be 30.

Note that the reverse is also true. You used to have to enter a whole table for waterMins/waterMaxes... now you can add just a single number if you want the same value for all grow levels. You could now just set waterMins = 0 instead of {0, 0, 0, 0, 0, 0, 0}. You should also be able to set waterMaxes = nil or waterMaxes to completely disable the watering mechanics, although I haven't tested the waterMax part of it yet.
 

My next plan is to look into the diseases functions, and see if I can change them to make them more configurable. Now that we can have very long-life crops like trees, I expect diseases to become a serious problem. So if people would like to have disease-resistant crops or make one disease totally immune, but another disease very likely, or make it so it is easier or harder for diseases to spread throughout a certain crop, or things like that. That will be my next goal for the mod, to allow people to configure these disease settings on a crop-by-crop basis.

 

I may also take a look at how crop health values are calculated.

Link to comment
Share on other sites

I'm putting version 0.4 up right now. Please check the main post. I am actually very happy with this version, I've done quite a bit of testing on it and am very happy with how it's working now. It has been quite stable for me, and I am now using it with my own WIP crops addon which includes trees and vines and so on.

So now I'm confident it will fix the issues with regrow and finalGrow. I have regrowing trees working in my own mod now.

Sorry it took so long, the real issue was actually quite unexpected and took a long time to find. There was apparently a whole different harvest function hidden away in the client UI code. It does almost the exact same things as the main harvest function, but it didn't have my modifications to it and didn't know about the new settings I added, so it went through and deleted the plants because it decided they were dead/harvested already even though I had removed that code from the main harvest function the other function still was able to delete the plant. A strange way to design the code, but now that I know about it and where it is, it should not pose any future trouble.

I did find the issue you mentioned with the sprites, and they are now fixed as well.

I also added some other modifications and minor bugfixes, and I included the changes to waterMins to allow a minimum water of 0 if you want to disable most of the water checking. Setting it to 0 or nil should work now and the plant will not instantly die and will not lose health. However there may still be issues with disease and higher change of disease.

The one major improvement I was working on for this version is that you now have a choice of setting several fields to either a single value, or choosing individual values for each grow state using a table.

For all of the following data fields -- timeToGrowMin, timeToGrowMax, waterMins, WaterMaxes -- You can now choose to set them to either a single number which applies to ALL grow levels. Or you can set them to a table like {10,20,30,40,50,60,70} (7 table entries for maxGrow=7). Each table entry corresponds to the same numbered grow level. So if that table was set to waterMaxes, you could only add 10 water when it was first planted, however once it grows a bit you could add 20 water, and then a bit later the max you could add would be 30.

Note that the reverse is also true. You used to have to enter a whole table for waterMins/waterMaxes... now you can add just a single number if you want the same value for all grow levels. You could now just set waterMins = 0 instead of {0, 0, 0, 0, 0, 0, 0}. You should also be able to set waterMaxes = nil or waterMaxes to completely disable the watering mechanics, although I haven't tested the waterMax part of it yet.

My next plan is to look into the diseases functions, and see if I can change them to make them more configurable. Now that we can have very long-life crops like trees, I expect diseases to become a serious problem. So if people would like to have disease-resistant crops or make one disease totally immune, but another disease very likely, or make it so it is easier or harder for diseases to spread throughout a certain crop, or things like that. That will be my next goal for the mod, to allow people to configure these disease settings on a crop-by-crop basis.

I may also take a look at how crop health values are calculated.

good,i'll try it asap.

btw,I already put my codes used for zero waterMin issue in this topic. Hope it will do some help.

Link to comment
Share on other sites

It was very helpful! I didn't use your code exactly, because I needed to do it slightly differently now that you can set waterMins to be a number instead of a table. But it showed me where to make the changes. So it actually saved me a lot of time to look at your code. Thanks!

 

Let me know if you run into any other issues, but like I said I've been playing around with it in my mod quite a bit now and I'm really happy with how its running. Especially now that I've got my custom sprites in (thanks for your helpful comment on that as well). It looks glorious to have an orchard of fruit frees! I made it take a long time to grow, several months of game time, but it's worth it in the end :)

 

They all die eventually from disease though, which is why I need to look at disease next.

 

Here is an example of an Apple tree

props[name] = {};props[name].seedsRequired = 1; --number of seeds required to plantprops[name].waterLvl = 65; --minimum water required, only used for display purposes nowprops[name].waterMins = 65;props[name].waterMaxes = nil;props[name].minVeg = 3; --number harvestedprops[name].maxVeg = 4; --number harvestedprops[name].minVegAutorized = 5; --harvest at max skill?props[name].maxVegAutorized = 9; --harvest at max skill?props[name].vegetableName = "Base.Apple"; --this is the ID of the vegetable it provides when harvestedprops[name].seedName = "CecilFoodService.AppleSeed"; --this is the ID of the seed it provides when harvested (prefix required)props[name].seedTypeName = "AppleSeed"; --this is the ID of the seed used to grow it (no prefix)props[name].seedPackTypeName = nil; --leave this nil for now, I have future plans for itprops[name].seedPackSize = 50; --unused due to nil seedpackprops[name].maxGrow = 7; --number of growing phasesprops[name].plantName = "Apple Tree";props[name].regrowResetTo = 5;props[name].finalGrowResetTo = 5;props[name].growPhases = {-1, 0, 0, 0, -2, -2, 1};props[name].seedPerVeg = 0; --seeds received when harvestingprops[name].timeToGrowMin = {240, 240, 240, 62, 62, 62, 62}; --in hours per phaseprops[name].timeToGrowMax = {400, 400, 400, 82, 82, 82, 82}; --in hours per phase
Link to comment
Share on other sites

 

It was very helpful! I didn't use your code exactly, because I needed to do it slightly differently now that you can set waterMins to be a number instead of a table. But it showed me where to make the changes. So it actually saved me a lot of time to look at your code. Thanks!

 

Let me know if you run into any other issues, but like I said I've been playing around with it in my mod quite a bit now and I'm really happy with how its running. Especially now that I've got my custom sprites in (thanks for your helpful comment on that as well). It looks glorious to have an orchard of fruit frees! I made it take a long time to grow, several months of game time, but it's worth it in the end :)

 

They all die eventually from disease though, which is why I need to look at disease next.

 

Here is an example of an Apple tree

props[name] = {};props[name].seedsRequired = 1; --number of seeds required to plantprops[name].waterLvl = 65; --minimum water required, only used for display purposes nowprops[name].waterMins = 65;props[name].waterMaxes = nil;props[name].minVeg = 3; --number harvestedprops[name].maxVeg = 4; --number harvestedprops[name].minVegAutorized = 5; --harvest at max skill?props[name].maxVegAutorized = 9; --harvest at max skill?props[name].vegetableName = "Base.Apple"; --this is the ID of the vegetable it provides when harvestedprops[name].seedName = "CecilFoodService.AppleSeed"; --this is the ID of the seed it provides when harvested (prefix required)props[name].seedTypeName = "AppleSeed"; --this is the ID of the seed used to grow it (no prefix)props[name].seedPackTypeName = nil; --leave this nil for now, I have future plans for itprops[name].seedPackSize = 50; --unused due to nil seedpackprops[name].maxGrow = 7; --number of growing phasesprops[name].plantName = "Apple Tree";props[name].regrowResetTo = 5;props[name].finalGrowResetTo = 5;props[name].growPhases = {-1, 0, 0, 0, -2, -2, 1};props[name].seedPerVeg = 0; --seeds received when harvestingprops[name].timeToGrowMin = {240, 240, 240, 62, 62, 62, 62}; --in hours per phaseprops[name].timeToGrowMax = {400, 400, 400, 82, 82, 82, 82}; --in hours per phase

:mrgreen:

Link to comment
Share on other sites

 

It was very helpful! I didn't use your code exactly, because I needed to do it slightly differently now that you can set waterMins to be a number instead of a table. But it showed me where to make the changes. So it actually saved me a lot of time to look at your code. Thanks!

 

Let me know if you run into any other issues, but like I said I've been playing around with it in my mod quite a bit now and I'm really happy with how its running. Especially now that I've got my custom sprites in (thanks for your helpful comment on that as well). It looks glorious to have an orchard of fruit frees! I made it take a long time to grow, several months of game time, but it's worth it in the end :)

 

They all die eventually from disease though, which is why I need to look at disease next.

 

Here is an example of an Apple tree

props[name] = {};props[name].seedsRequired = 1; --number of seeds required to plantprops[name].waterLvl = 65; --minimum water required, only used for display purposes nowprops[name].waterMins = 65;props[name].waterMaxes = nil;props[name].minVeg = 3; --number harvestedprops[name].maxVeg = 4; --number harvestedprops[name].minVegAutorized = 5; --harvest at max skill?props[name].maxVegAutorized = 9; --harvest at max skill?props[name].vegetableName = "Base.Apple"; --this is the ID of the vegetable it provides when harvestedprops[name].seedName = "CecilFoodService.AppleSeed"; --this is the ID of the seed it provides when harvested (prefix required)props[name].seedTypeName = "AppleSeed"; --this is the ID of the seed used to grow it (no prefix)props[name].seedPackTypeName = nil; --leave this nil for now, I have future plans for itprops[name].seedPackSize = 50; --unused due to nil seedpackprops[name].maxGrow = 7; --number of growing phasesprops[name].plantName = "Apple Tree";props[name].regrowResetTo = 5;props[name].finalGrowResetTo = 5;props[name].growPhases = {-1, 0, 0, 0, -2, -2, 1};props[name].seedPerVeg = 0; --seeds received when harvestingprops[name].timeToGrowMin = {240, 240, 240, 62, 62, 62, 62}; --in hours per phaseprops[name].timeToGrowMax = {400, 400, 400, 82, 82, 82, 82}; --in hours per phase

:oops: Well, I'm OK with the current disease mechanism.

But it will be great, if you can allow us to rename the growing phases.

Link to comment
Share on other sites

 

But it will be great, if you can allow us to rename the growing phases.

 

Great suggestion! The default names use the game's text translation table in order to work in multiple languages, however mod support for multiple languages seems very sketchy. I do like this idea though, and I can certainly add a setting that allows you to put in custom names, although it won't work with multiple languages.

Link to comment
Share on other sites

 

 

But it will be great, if you can allow us to rename the growing phases.

 

Great suggestion! The default names use the game's text translation table in order to work in multiple languages, however mod support for multiple languages seems very sketchy. I do like this idea though, and I can certainly add a setting that allows you to put in custom names, although it won't work with multiple languages.

 

:oops: It will be great.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 2 weeks later...

 

 

But it will be great, if you can allow us to rename the growing phases.

 

Great suggestion! The default names use the game's text translation table in order to work in multiple languages, however mod support for multiple languages seems very sketchy. I do like this idea though, and I can certainly add a setting that allows you to put in custom names, although it won't work with multiple languages.

 

How's things going?

Link to comment
Share on other sites

  • 2 weeks later...

Honestly the horde spawning in the last update killed the game for me and I don't have any interest in playing anymore. Even setting them on ultra-low doesn't help, the only way I can play the game in a way that doesn't make me feel like I'm banging my head against a wall is by disabling zombies entirely and that's just no fun at all.

 

As for the mod, not trying to sound whiny or anything but I just can't see any point in extended farming when you can't even live in one place long enough to harvest a crop anymore before getting overwhelmed by the horde. The devs stance seems to be that this is the way they like it and the way they always intended it, and the way it used to be was just a placeholder/accident. That leaves me little hope that it will change back.

 

If you want to take over the mod, you have my approval and encouragement, but I doubt I'll be continuing it myself...

Link to comment
Share on other sites

  • 2 weeks later...

Honestly the horde spawning in the last update killed the game for me and I don't have any interest in playing anymore. Even setting them on ultra-low doesn't help, the only way I can play the game in a way that doesn't make me feel like I'm banging my head against a wall is by disabling zombies entirely and that's just no fun at all.

 

As for the mod, not trying to sound whiny or anything but I just can't see any point in extended farming when you can't even live in one place long enough to harvest a crop anymore before getting overwhelmed by the horde. The devs stance seems to be that this is the way they like it and the way they always intended it, and the way it used to be was just a placeholder/accident. That leaves me little hope that it will change back.

 

If you want to take over the mod, you have my approval and encouragement, but I doubt I'll be continuing it myself...

:eek:  :-(

Link to comment
Share on other sites

  • 1 year later...
  • 7 months later...

I have been trying to do exactly that for the last week, and then I found this topic when looking for something else. Ok then seems like it was abandoned. Interesting enough my version wasn't going to touch vegetableconf. I'll download it and see how it works, maybe I can make something out of the best of the 2 mods.

 

EDIT: The download link are broken. Can anyone send me the files? I'd like to check them and see if there's anything useful to incorporate into my own version.

Edited by Soul Filcher
Link to comment
Share on other sites

  • 1 month later...

Sorry for the broken links, it seems like Dropbox changed the way they do sharing of files.

 

This is the last version I released, 0.4. Does this link work for you?

 

I hope you can use some of the code in your version. Please consider it public domain at this point and continue it as you wish, with my blessing. PZ needs a good farming mod, or at least it did when I started working on this :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...