I love all the mods pouring out especially with food, which is why I love the "Food Spoilage and Preserved Foods" modlet to help get rid of all the excess food.
I was wonder what is an easy way to either add all the food mods to be affected by this or modify this to affect them, etc. Is it just a "food" tag? Wondering how to go about it, if there was an easier way or breakdown and go through every item in a mod and flag it.
Also, I was thinking about people talking about how easy it is finding the foods from these mods. Perhaps this can add another level of robustness... Since even preserved foods are not always 100% top notch, Grade-A fresh... especially like MRE's and the contents therein... I was thinking that foods can be found in tiers representing stages of freshness and decay... the worse the stage, the less benefits you get from it, and the worse it is, the higher the chances of something bad from eating it.
This way not everything you find is "great" to eat, like it was made today and adds incentive to find better foods. Perhaps another sink or two to get rid of them as well, like the spoilage feature does. Use them in zombie traps/attractants, fertilizer, animal feed, etc, so you can get rid of some of the excess, especially worse tiers, to give them some additional use and get rid of them from the world.
The way the mod adds food spoilage XML tags, is by examining the name attribute of the items. The conditions:
- The item name must start with "food" or "resourceCrop".
- The item name cannot contain "foodCan" (so canned foods don't spoil).
- The item name cannot contain "Schematic" or "Magazine" (so pre-A21 recipes and A21 crafting skill magazines don't spoil).
This is done in items.xml in the food spoilage mod. There is more in that file, but it's mainly to customize food spoilage for specific vanilla items.
If other food mods follow these naming conventions, then they should also spoil (at the default rate),
provided they load before the food spoilage mod. Mods load in alphabetical order by folder name, so you might have to rename their folders, or rename the food spoilage mod so it starts with "z" or something. If they don't follow those conventions, or if you want their items to spoil at a non-default rate, then you'll have to write a compatibility modlet for them.
The notion of food "tiers" is interesting, but would take a lot of work to implement. The issue is that food is stackable, and the item quality you see underneath the food item represents the remaining time for
one item in the stack to spoil. So once an item spoils, the quality starts over at 100% again. This means you can't use that value to represent the "tier" of the stack.
To represent different tiers, you could make each tier be an entirely different item in items.xml. To make the bar color different, set the "QualityTierLevel" to whichever tier you want ("1" through "6" as with weapons or armor). Depending on what you want to happen, you could have that item "spoil" to the same food but at one lower tier. Keep in mind that each tier would be a separate stack.
However, if that's the way you do it, I don't think you can hook into the crafting system the same way armor or weapons do, where the higher your crafting level the higher the tier you can craft (or in this case, cook). In order to do that, you'd have to make the food items have a "quality" level, and
items with a quality level don't stack. Now, maybe that's something you want - I've seen it in other games - but not being able to stack food is a pretty big change for most players.
You could get around this by having different recipes for the different items (e.g. "blueberry pie level 1" and "blueberry pie level 2"), and have each recipe unlock at a different crafting tier. Or, you could just have the current recipe unlock a specific tier, and all food cooked by the player would start at that tier. (Maybe the next-highest tier, and the highest tier could only be looted, the same way tier 6 armor or weapons can only be looted?)
Since my mod is for a general audience, I don't think it's appropriate for me to include any of that in my mod. But hopefully that will give you some ideas which you can use to implement your own version. Good luck!
I added the better dew collecter and i run in issue with that when i open i see 1 water and than when i open i see full and when i add new it wont work on the new ones i need to restart the server is there a way to fix it?
I assume "better dew collecter" means my "Rain Collector" mod, correct? (And not the "Murky Dew" modlet.)
If so, I'm not sure I understand the issue. When you say "when I add new it won't work on the new ones" what new thing are you adding?
If you're adding
slots, then yes, you have to restart the server, or at least restart the game executable on the server. There's no way to avoid that. XML files are only read when the game starts, and adding slots is done through XML. It's intentional by TFP, and not something I can "fix."
If it's something else, let me know the details.