RELEASED Butcher Mod [v1.2.1]

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

  1. Digus

    Digus Cosmic Narwhal

    Butcher Mod 1.2.1
    Download link on nexus:
    https://www.nexusmods.com/stardewvalley/mods/1538/?


    Current Version: 1.2.1
    • Adds a Softmode replacing the Meat Cleaver for a Meat Wand. Some other changes to resemble magic.
    • Adds a config file to enable Softmode and a custom key to directly add the Meat Cleaver.
    • Adds data files to personalize prices, edibility, buffs and amount of meat received from animals.
    • Adds support to i18n files so all text can be translated.
    Update:(from version 1.1.X)
    1. Update the MailFramework to version 1.2.0 (required if you are going to use i18n files. There is also bug fixes)
    Installation:
    1. Install the latest version of SMAPI.
    2. Unzip the Butcher Mod into Stardew Valley/Mods.
    3. Unzip the MailFrameworkMod into Stardew Valley/Mods.
    4. Unzip the CustomElementHandler into Stardew Valley/Mods.
    5. Unzip the CustomTV into /Stardew Valley/Mods.
    6. Run the game using SMAPI.
    Obs. Always backup your save file before tying this kind of mod.

    Compatibility: 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 CustomTV.

    Objective: To add meat and related features into the game.

    How does it work:
    • Once you own a farm animal, you will receive a letter the next day with the Meat Cleaver. Using this tool on any adult animal twice will make meat pop in the air. If you trash the Meat Cleaver or lose it by any other means, you will receive the same letter the next day. If not, it's probably on some chest you forgot about.
    • Baby animals can't be turned into meat. I don't plan on changing that.
    • 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 also 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, already in the games code).
    • 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 meet.
    • You can use meat on the animal bundle at the community center.
    • You can configure the price and edibility of all new items. As well as the buffs from the meals recipes. Min and max amount of items revived from animals are also configurable. To do so, lunch the game at least once and edit the files on the data directory on the ButcherMod folder.
    • You can translate the mod buy copying and editing "i18n/default.json" to other languages. No translations are being provided yet. (I'm working on a Portuguese translation to be released as a optional file)
    Softmode: You can now change the Meat Cleaver 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.
    To enable it, run the game with the mod once to create a config.json file. Edit the file and change: "Softmode":false, to "Softmode": true, Then start the game and enjoy.

    How to uninstall:
    1. Sell or trash every meat and meat dishes you have.
    2. Trash the Meat Cleaver.
    3. Sleep to save the game.
    4. Delete the mod from the installation folder.
    Justification: 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.

    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.
    • Make some quests related to meat.
    • Customize the villagers preferences to meat items (raw and cooked)
    • A way to fertilize animal that don't use the incubator.
    • More ways to rise friendship so animals can "grow" quicker.
    Long term Goals for a 2.0 version:
    • Original sprites for meat, with more than one kind from animal.
    • Artisan goods from meat.
    • New machinery to make Artisan goods related to meat.
    • Original Cooking Items.
    Feedback: 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.

    Source: https://github.com/Digus/StardewValleyMods/tree/master/ButcherMod

    Change Log:
    • 1.2.1
      • Fix to version name
      • Fix to Meat Cleaver spawn key name.
    • 1.2.0
      • Adds a Softmode replacing the Meat Cleaver for a Meat Wand. Some other changes to resemble magic.
      • Adds a config file to enable Softmode and a custom key to directly add the Meat Cleaver.
      • Adds data files to personalize prices, edibility, buffs and amount of meat revived from animals.
      • Adds support to i18n files so all text can be translated.
    • 1.1.2
      • Fix to meat dishes not being recognized as cooking category.
    • 1.1.1
      • Minor correction from 1.1.0 (it was always teaching 3 recipes on load)
    • 1.1.0
      • Adds meat dishes to the game.
      • Adds meat recipes to the game
      • Adds new day to queen of sauce channel to teach meat recipes. (friday)
      • Adds new letters to be sent by the villagers with meat recipes.
      • Adds mutton to the animal bundle.
    • 1.0.1
      • Fix to reported incompatibility issues with other mods.
      • New sprite for the Meat Cleaver.
    • 1.0.0
      • Mod release
    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 updating his CustomTV mod really fast when I found a bug.
    • For everyone on the discord channel that are always super helpful.
    [​IMG]

    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
     
      Last edited: Nov 18, 2017 at 2:59 AM
      addy468, Beon, HopeWasHere and 4 others like this.
    • hunni

      hunni Aquatic Astronaut

      This works amazing! Thank you so much!
       
      • Ichimatsu

        Ichimatsu Big Damn Hero

        Ok, so this happened.
        Meat.png
        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 Cosmic Narwhal

            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 Cosmic Narwhal

              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 Cosmic Narwhal

                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: http://i.imgur.com/H56LaUC.gif
                [​IMG]
                 
                  Last edited: Oct 10, 2017
                  Karmylla, anothersarah and hunni like this.
                • Karmylla

                  Karmylla Cosmic Narwhal

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

                    Digus Cosmic Narwhal

                    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 Cosmic Narwhal

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

                        Digus Cosmic Narwhal

                        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 Cosmic Narwhal

                            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 Cosmic Narwhal

                              @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:
                              Code:
                              [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 Cosmic Narwhal

                                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:
                                  Meat.png
                                  I love it, though. Lol.
                                   
                                    Last edited: Oct 12, 2017
                                  • Digus

                                    Digus Cosmic Narwhal

                                    @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.
                                    https://stardewvalley.net/dev-update-9/
                                    https://stardewvalley.net/dev-update-11/

                                    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."

                                        https://stardewvalleywiki.com/Modding:Object_data#Other_objects
                                         
                                        • Digus

                                          Digus Cosmic Narwhal

                                          Are you talking about this one? https://community.playstarbound.com...icial-continuation.129349/page-6#post-3154045
                                          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