RELEASED Animal Husbandry Mod (former Butcher Mod) [v2.2.2]

Discussion in 'Mods' started by Digus, Oct 9, 2017.

  1. Digus

    Digus Ketchup Robot

    Animal Husbandry Mod (former Butcher Mod) 2.2.2
    Download link on nexus:

    Current version: 2.2.2
    • Adds support to Stardew Valley 1.3 and multiplayer.
    • New entry in the cooking.json file to customize the meat recipes.
    • Meat now show in the shipping collection. (only count the amount shipped after this version, sorry.)
    • Dinosaurs now give a random type of meat. Same rules for the amount received apply.
    • New console command: player_addallmeatrecipes - add all meat recipes to the current player.
    • New letter design for the Meat Cleaver/Meat Wand and the Insemination Syringe.
    • Adds support to Stardew Valley 1.3.32
    • Fix incomplete event showing up at some day of the year.
    • Fix to work with the new Stardew Valley 1.3.33 version
    Improve Animal Husbandry.

    CA intended to add meat from the start. That was one of the things that made me excited about the game and made me follow it's development for years. It was disappointing to knew it was cut out a few months before release. It was never about wanting to kill animals, it was about a whole aspect of the farming and lots of related items being removed from the game.

    Update: From version 2.0.X
    Update: From version 1.X
    This is needed to transfer the info on your pregnant animals and changes you may have made to the mod data file.
    • Follow the instructions above for updating from from version 2.0.X
    • Go into "ButcherMod" folder and copy the "data" folder.
    • Paste the data folder into the "AnimalHusbandryMod" folder.
    • Delete the ButcherMod folder. (you need to delete the old folder, or the new version will not load.)
    Obs. Always backup your save files before tying this kind of mod.

    This mod may conflict with other mods using the original meat sprites and the meat dishes left in the game code. (objectInformation ids 639 to 644 and 652 to 666). It may also conflict with mods changing the mailbox and the TV, because of it's dependency on the MailFrameworkMod and PyTK.CustomTV.
    There were reports of problems with custom animal skins. Using them may cause conflicts with the pregnancy feature.
    It was reported that the mod does not work on version 1.2.30 of the game. It works fine in the latest version 1.2.33.

    How does it work:
    • Meat Cleaver/Wand
      • Once you own a farm animal, you will receive a letter with the Meat Cleaver/Wand. Using this tool on any adult animal twice will make meat pop in the air.
      • The more loved the animal is, the more meat you will receive. You can also get wool, duck feather and rabbit feet as well. Friendship and mood affect the quality of the items.
      • The total price sum of the items will always be higher than selling the animal directly. The total sum varies from that to about double of that value.
      • You can sell meat using the shipping box or directly to Pierre and Marnie (I intend to disable selling to Marnie, it was something automatically enabled for the meat category).
      • You can use meat on the animal bundle at the community center.
      • Meat appears in the shipping collection.
    • Meat Recipes
      • You can learn meat recipes every Friday starting at the third week of the year on "The Queen of Sauce - Meat Friday" channel. Recipes will re-run every other Friday for a total of 7 new recipes during one year. The schedule is the same every year.
      • You will receive letters with new recipes from the villager when certain conditions are met.
      • Every meat recipe has buff. The more expensive the recipe, the better the buff will be. Some even have speed 2 or lucky 6.
    • Insemination Syringe
      • Once you own the required buildings with animals in it, you will receive the Insemination Syringe in the mail. Using this tool you can impregnate adult animals that don't lay egg. You need to load the syringe with the product that animal produce. One item is required for each impregnation.
      • Once the animal gives birth, you will be notified after the day start to choose the name.
      • Big Barn can support 1 pregnant animal, Deluxe Barn can support 2. Coops can support any number of pregnant rabbits.
      • The game default pregnancy event still work as normal, but is disabled on pregnant animals.
    • Feeding Basket
      • Once you own an animal(pet or farm animal) and befriend Marnie enough, you will receive the Feeding Basket in the mail. Using this tool you can give treats to your animals. You need to place the food you want to give in the basket. One item is consumed per animal.
      • Once the animal eats the treat, their mood will be maxed and its friendship toward you will increase.
      • Each animal has different likes and dislikes that can be learned watching the new channel "Livin' With The Animals", or by trial and error.
      • Pets can eat a treat per day, bur farm animals have bigger waiting time between treats, that vary for each kind of animal.
      • The amount of friendship gained per treat is fixed for pets, but for farm animals it depends on the price of the treat and the base price of the farm animal. This was done to better balance the feature. The sale price of the animal will raise more than the base price of the treat.(ignoring professions bonus). That means if you give amaranth to a cow and sell it immediately after you will not lose any money.(unless you are a tiller, but if you are a rancher and sell its meat, you will always make profit)
      • Coopmaster and Shepherd increase the friendship gain from treats.
    • Meat Button
      • It's an alternative to the Meat Cleaver/Wand.
      • You will get the same meat and items, lose the same amount of energy and gain the same amount of experience as using the Meat Cleaver/Wand.
      • It works much like the sell button, but you get meat added to your inventory instead of money.
      • If your inventory is full, a menu will show for you to get which items you want. You can through items out of the menu window for them to stay on the floor and not have to trash anything.
    Config options:
    Run the game at least one with the mod instaled to create the config.json file. You can edit this file to change the configuration.
    • "Softmode": (false|true) Enable or disable the Softmode. When enabled the Meat Cleaver is replaced with the Meat Want. They work the same, but sound, text and effects are changed to resemble magic.
    • "AddMeatCleaverToInventoryKey": (null|"any_key") Set a keyboard key to directly add the Meat Cleaver/Want to your inventory.
    • "AddInseminationSyringeToInventoryKey": (null|"any_key") Set a keyboard key to directly add the Meat Cleaver/Want to your inventory.
    • "DisableFullBuildingForBirthNotification": (false|true) Enable or disable notifications for when an animals can't give birth because their building is full.
    • "DisableTomorrowBirthNotification": (false|true) Enable or disable notifications for when an animal will give birth tomorrow.
    • "DisablePregnancy": (false|true) Enable or disable all features related to pregnancy. Syringe will not be delivered, and if already owned, wil not work. Pregnancy status will not update but will not reset. Animals that were pregnant will be with random pregnancy disabled unless changed. If re-enabled, everything will resume as it was before.
    • "DisableMeat": (false|true) Enable or disable all features related to meat. Meat Cleaver/Wand will not be delivered , and if already owned, will not work. Meat items and meat dishes will not be loaded. Any item still on the inventory is be bugged. You should sell/trash all of them before disabling meat. Meat Friday will not show on TV. You will not receive any more meat recipe letter from the villagers. Learned recipes will still be known, but will not show on the cooking menu. If re-enabled, they will show again.
    • "DisableTreats": (false|true) Enable or disable all features related to treats. The basket will not be delivered, and if already owned, will not work. Treat status will update while the treat feature is disable. Animals that were feed treats before will be able to eat again if the appropriate amount of days has passed when the mod was disabled.
    • "DisableRancherMeatPriceAjust": (false|true) Enable or disable the patch that make Rancher Profession work on meat items. It was causing error log on Mac and Linux. Version 2.0.0 should fix the problem, but you can disable here if wanted.
    • "DisableMoodInscreseWithTreats": (false|true) Enable or disable animal mood being set to max when given a treat.
    • "DisableFriendshipInscreseWithTreats": (false|true) Enable or disable animal friendship being increased when given a treat.
    • "EnableTreatsCountAsAnimalFeed": (false|true) Enable or disable animal feed status being set to max when given a treat. This was not fully analyzed, so use it at you on risk. Report bugs if you find any.
    • "DisableMeatFromDinosaur": (false|true) Enable or disable dinosaurs giving a random kind of meat.
    • "PercentualAjustOnFriendshipInscreaseFromProfessions": (0.25|anyNumber) Change the perceptual adjust for friendship increase when giving treats when you have the coopmaster of Shepherd professions. The default is a 25% increase.
    You can now change the Meat Cleaver object to a Meat Wand. Sounds and animation are also changed to resemble magic effects. Text are also supporting the idea that you are exchanging your animals for meat that grows on trees on another dimension.

    This mod is compatible with SMAPI suport to i18n files. As of now, there is no official translation for this mod, but you can translate it your self following this instructions:

    Data files:
    You can change the mod data. To do so, lunch the game at least once and edit the files in the 'AnimalHusbandryMod\data' folder.
    • meats.json - You can configure the price and edibility of meat
    • cooking.json - You can configure the recipe, price, edibility and the buffs of meat dishes.
    • animals.json - You can configure Min and Max amount of items received from animals. You can configure the pregnancy time. You can configure the amount of days between treats. You can choose which items the animal accept as treat. You can use category values for liked treats, to set the whole category as liked.
    • animalBuilding.json - You can configure the number of pregnent animals allowed in a build. 'null' means unlimited.

    • Sell or trash every meat and meat dishes you have.
    • Trash the Meat Cleaver, the Insemination Syringe and Feeding Basket.
    • Sleep to save the game.
    • Delete the mod from the installation folder.

    Goals: (in no specific order) (done,working,on hold)
    • Add the original meat items into the game.
    • Add a way to turn animals into meat.
    • Add a custom made sprite to the Meat Cleaver.
    • Upload the source code of the mod.
    • Add the original Cooking Items related to meat.
    • Add a "friendly" none-violent option in the config. So people can add meat in the game and get it from their animals without having to use a Meat Cleaver.
    • Make it compatible with most used mods if there are any conflicts. (on demand)
    • Add a config file to customize the mod.
    • Add a localization file to support multiple language.
    • Make meat products count as animal items when selling it.
    • A way to fertilize animal that don't use the incubator.
    • Rename the mod to Animal Husbandry Mod
    • Customize the villagers preferences to meat items (raw and cooked)
    • More ways to rise friendship so animals can "grow" quicker.
    • Make some events related to animals.
    • Make some quests related to animals.
    • A way to get animals easier at the start of the game. (coop coupon instead of parsnip seeds.)
    • Craftable animal stalls to increase the barn capacity for pregnant animals.
    • Artisan goods from meat.
    Long term Goals for a future version:
    • Original sprites for meat, with more than one kind from animal.
    • New machinery to make Artisan goods related to meat.
    • Original Cooking Items.
    • Animal trap, working similar to the Crab Pot, to get stuff like Rabbit Meat
    I'm open for ideas of different features and what should be priority on the list above.
    I'm also open for help. I have almost none experience with pixel art. Any contribution would be credited.
    I'm not from an english speaking country. So any typo or suggestions on how to improve the mods writing, please let me know.


    Change Log:

    Special Thanks:
    • People from the original butchering topic. I always wanted to mod a game and all that talking inspired me out. It took sometime, but I'm here now.
    • @TheSecretman83 , for compiling progress others made on his request topic. It helped me start.
    • @Declension , for this post. This info helped a lot.
    • @Platonymous , for making his mods open source. I learned a lot looking into his code. And again for supporting PyTK really well.
    • For everyone on the discord channel that are always super helpful.
    • @Pathoschild , for his amazing work and support on the SMAPI.

      Last edited: Jan 6, 2019
      addy468, Beon, HopeWasHere and 4 others like this.
    • hunni

      hunni Void-Bound Voyager

      This works amazing! Thank you so much!
      • Ichimatsu

        Ichimatsu Big Damn Hero

        Ok, so this happened.
        I know nothing about modding but I suspect it's an incompatibility issue or ID conflict with More Crops mod. I remembered it did something with the meat items existing in the game but I didn't remember what. As I checked the yamls, though, I saw it adds descriptions and assigns IDs to some meat items (ie 807: "Beef/130/-300/Basic -5/Beef/Not a good idea to eat it raw." #!String). This is in ObjectInformation yaml. If it's other mod messing things up idk which could be. That's the only one that messes with content folder that I know of.

        I didn't think it'd be an issue because your mod doesn't mess with content folder, but I don't know how mods work and it actually seems to do so it the end, lol.

        Is there any way in which you could add a compatibility patch or is it too hard/not worth it? :(
        • Ichimatsu

          Ichimatsu Big Damn Hero

          Wait, it uses the sprites but it copies it again in springobjects png instead of adding info. Idk then what could cause this. :catsparkle:
          • Digus

            Digus Ketchup Robot

            I imagined my mod could have some conflicts with others mods that are using the meat sprites, but I didn't have time to make this disclaimer.
            What I do is basically add my entries on the springobjects dictionary. I did it that way so I didn't have to mess around with the game files.
            The chicken meat ID is 441 if I'm not mistaken. (edit: it's 641)
              Last edited: Oct 11, 2017
            • Digus

              Digus Ketchup Robot

              I installed the More Crops mod and its requirements and could not find any problem. It must be another mod.
              I need more info to help you out.
              The ids I'm using are 639 to 644.
              • Digus

                Digus Ketchup Robot

                I managed to add a custom tool sprite without editing the xnb.
                This could make the mod compatible with any other mod when I try to add more meat, even when adding to the same xnb.
                I will try to make a framework out of it.

                I also made a custom sprite for the Meat Cleaver. It can use some polish, but I'm really happy with the result:
                  Last edited: Oct 10, 2017
                  Karmylla, anothersarah and hunni like this.
                • Karmylla

                  Karmylla Hard-To-Destroy Reptile

                  Hey Digus,
                  I think the meat cleaver looks great, honestly!
                  Great job! :D
                    Digus likes this.
                  • Digus

                    Digus Ketchup Robot

                    Thanks You. :D

                    I looked into your ObjectInformation file and there is nothing there that should cause conflict.
                    I was also looking into the Entoarox Framework and I think it does what I'm already doing manually. So it might be the cause of the problem. If that is the case, I will try to use the Framework in the project, so any mod using it should be compatible. I will look into it to night, If I have the time.
                      Karmylla likes this.
                    • Karmylla

                      Karmylla Hard-To-Destroy Reptile

                      Thank you so much, you're great :D
                      • Digus

                        Digus Ketchup Robot

                        That problem should be solved on version 1.0.1

                        I was not supposed to edit the game assets directly, since SMAPI can change them as needed by other mods.
                        Thanks to people on the discord mod channel I was able to solve it really fast.
                          anothersarah likes this.
                        • Ichimatsu

                          Ichimatsu Big Damn Hero

                          It throws some errors in the console but in-game the mod seems to work perfectly fine. You even added all meats except mutton to the pantry. Neat. Thanks for finding the error out! :D
                          • Digus

                            Digus Ketchup Robot

                            Can you post the log here? I'm not getting any errors in my log. It might not affect my mod but could affect others.

                            I used the meat category already implemented (id -14), that probably why its added in the pantry. (Actually, I don't even know what you are talking, lol. Can you use it in the bundles?)
                            Mutton might be an exception because it was supposed to be "Cheap Meat", from animals that were not supposed to be killed.
                            That is why sheep and goat have the same meat. They didn't have their on meat sprite.
                            If I remember correctly, Goat was the last animal added, probably after CA decided to remove meat entirely.
                            Dinosaurs were also supposed to drop Cheap Meat, but since I renamed it to Mutton, I made the Meat Cleaver not work on them.
                            • Karmylla

                              Karmylla Hard-To-Destroy Reptile

                              @Digus it's easier to talk through here than at Nexus, so I'll be answering here, if that's okay!
                              Regarding the latest update, I do get an error log in the console:
                              [20:13:57 ERROR SMAPI] BUTCHER crashed when editing asset 'Data\ObjectInformation', which may cause errors in-game. Error details:
                              System.ArgumentException: An item with the same key has already been added.
                                 at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
                                 at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
                                 at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
                                 at ButcherMod.DataLoader.Edit[T](IAssetData asset) in C:\Users\Digus\source\repos\ButcherMod\ButcherMod\DataLoader.cs:line 43
                                 at StardewModdingAPI.Framework.SContentManager.ApplyEditors[T](IAssetInfo info, IAssetData asset) in D:\source\_Stardew\SMAPI\src\StardewModdingAPI\Framework\SContentManager.cs:line 465
                              I can't seem to understand which item has the same key as the one in your mod, sadly :(
                              Though, by using CJB Item Spawner, I was able to check that all the meat is spawnable with no errors, so that's a plus!

                              I'll attach the full log, maybe it'll help some? Please tell me if I can help you in any way!

                                Attached Files:

                              • Digus

                                Digus Ketchup Robot

                                The log will help, this line:
                                at ButcherMod.DataLoader.Edit[T](IAssetData asset) in C:\Users\Digus\source\repos\ButcherMod\ButcherMod\DataLoader.cs:line 43
                                will tell me the exactly which meat is causing the problem, but I wouldn't be able to see the code before later to night.

                                I prefers here as well. That is why I placed the link to this thread there.
                                  Karmylla likes this.
                                • Ichimatsu

                                  Ichimatsu Big Damn Hero

                                  My error is basically the same as hers:

                                  Yes, by all means:
                                  I love it, though. Lol.
                                    Last edited: Oct 12, 2017
                                  • Digus

                                    Digus Ketchup Robot

                                    @Ichimatsu , that is really cool. So CA when this far with the meat stuff before deciding to remove it all. What I think is really unexpected is that you can use meat in bundles but it is not affected by the profession bonus for animal products. Profession was included soon after meat was created, he might have removed it deliberately.

                                    Just looked into the source and found this on 'Data\bundles':
                                    "Pantry/4: "Animal/BO 16 1/186 1 0 182 1 0 174 1 0 438 1 0 440 1 0 442 1 0 639 1 0 640 1 0 641 1 0 642 1 0 643 1 0/4/5" #!String"
                                    So he really placed the meat numbers there, one by one. And that is really why mutton is out, 644 was supposed to be Cheap Meat. Not bundle material.

                                    @Karmylla , the line is trying to add beef into the game. But since now I'm using SMAPI to add it, it must be handling the exception without halting the code. So all other meat is added, and beef is probably with the other mod status.
                                    Can you see if your beef have this status:
                                    "Beef/100/15/Basic -14/Beef/Meat from a cow. Fatty and slightly sweet."
                                    The original code was supposed to have this values:
                                    "Beef/200/15/Basic -14/Meat from a cow. Fatty and slightly sweet."
                                    So, if the other modder copied it as well, the only thing different would be the price. I change it to 100 because I wanted cows to drop more meat than other animals, since they are suppose to be the biggest. But since they are one of the cheapest to sell, beef couldn't value so much.

                                    You two probably are using a mod who also used the 639 id for beef. The worst thing that can happen is it being unbalanced.
                                    • Ichimatsu

                                      Ichimatsu Big Damn Hero

                                      Yeah. I figured as much-that CA deliberately left some of the old code for meats. Maybe he left it as is for modders to use. :D

                                      As I said, I don't know much about modding. But as far as I understood by checking yamls and images, more crops mod actually re-adds beef. It doesn't use the same ID. It copies the sprite and adds it again but with ID 807 and with another description. So I have two possible beef items with 2 different IDs, prices, and uses.
                                      • Advize

                                        Advize Scruffy Nerf-Herder

                                        I don't know what constitutes the unique key in the dictionaries made from Data\ObjectInformation, but because CA coded it, I wouldn't be surprised if its actually the name of the item rather than the ID. If so, then the key "beef" already exists because of another mod and therefore triggers an error message from SMAPI (can't add a key to a dictionary that already exists, although you can change its value). What I would recommend doing is changing its name to something guaranteed to be unique, but maintaining a display name of beef.

                                        Something like
                                        "ButcherModBeef/100/15/Basic -14/Beef/Meat from a cow. Fatty and slightly sweet."

                                        • Digus

                                          Digus Ketchup Robot

                                          Are you talking about this one?
                                          Because I tested with this one, and it is not causing any conflicts, like you said, there beef is copied to another place of springobjects.
                                          There must be another mod setting a value on Data\ObjectInformation. It does not need to be in the file, they could be doing it pragmatically, like I am.

                                          The Name is actually what it display. If a change the name of the beef to beef2, it shows beef2 everywhere. Changing the "displayName" does not change anything.
                                          Actually on the wiki it says : "(specific to language file)"
                                          So, this name must be the "key" used to get the translation. It's not uncommon to use the own text as a key for a translation.

                                          As far as a know, the id is what identifies an object, and is also the position of the sprite on the Texture2D. So you can't make two different objects use the same sprite unless you copy it to another position.

                                          Share This Page