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

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

  1. Karmylla

    Karmylla Space Kumquat

    Where can I check that beef (and other meats) keys? My ObjectInformation file has none of those, so I can't check them :s
    And my 639 id is free! I have no keys using it.
     
    • Digus

      Digus Spaceman Spiff

      So, I was looking into you log file and this is what I found:

      Code:
      [20:13:57 TRACE Xnb Loader] Redirecting: Data\ObjectInformation ~> C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley\Mods\XnbLoader\ModContent\Data\ObjectInformation.xnb
      [20:13:57 TRACE Entoarox Framework] Requested cache invalidation for 'Data\ObjectInformation'.
      [20:13:57 TRACE SMAPI] Entoarox Framework loaded asset 'Data\ObjectInformation'.
      [20:13:57 TRACE SMAPI] BUTCHER intercepted Data\ObjectInformation.
      [20:13:57 TRACE SMAPI] Invalidated 1 cache entries for 1 asset keys: Data\ObjectInformation. Reloaded 1 core assets.
      ... lots of lines ...
      [20:13:57 TRACE SMAPI] Entoarox Framework loaded asset 'Data\ObjectInformation'.
      [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
      [20:13:57 TRACE SMAPI] Invalidated 14 cache entries for 14 asset keys: Characters\Farmer\hairstyles, Characters\Farmer\hats, Characters\Farmer\shirts, Data\BigCraftablesInformation, Data\NPCGiftTastes, Data\ObjectInformation, LooseSprites\Cursors, LooseSprites\font_bold, LooseSprites\font_colored, Maps\springobjects, TileSheets\Craftables, TileSheets\critters, TileSheets\crops, TileSheets\furniture. Reloaded 14 core assets.
      There are only 3 mods using SMAPI to change the Data\ObjectInformation:
      * BUTCHER
      * Entoarox Framework
      * Xnb Loader

      But since the other two are tools for other mods, any other mod that requires them could be the ones trying to edit id 639 for beef.
      But since we don't know of any mod trying to do that, another option is that SMAPI is calling my mod twice even without invalidating the whole file. So I'm the one trying to edit the same key twice. We can see in the log that there is two enteries for Entoarox Framework loading the ObjectInformation, and my mod is being called just after.
      If that is the case, this error is not a problem, and I can get rid of it by checking if the key is already there before trying to load it. I will do that for the next version and you can tell me if that worked. But since it's not causing trouble, I will not rush it.

      I will also ask that on the discord modding channel, they can probably answer me that.

      Thank you for the log.

      Edit:
      The problem is that I'm doing this:
      data.Add(639,"Beef/100/15/Basic -14/Beef/Meat from a cow. Fatty and slightly sweet.");
      And the Add method throws an exception if I try to add something that already exists. I'm not used to C# and didn't know that.
      So I'm changing it to this:
      data[639] = "Beef/100/15/Basic -14/Beef/Meat from a cow. Fatty and slightly sweet.";
       
        Last edited: Oct 12, 2017
        Advize and Karmylla like this.
      • Karmylla

        Karmylla Space Kumquat

        @Digus thanks so much for looking into this, truly! :)
         
        • Redawilo

          Redawilo Scruffy Nerf-Herder

          Perhaps I am doing something wrong, but with the custom meat cleaver sprite, the meat cleaver itself is completely invisible for me. =/ I had the old version with it looking like an axe and I could see it just fine. I tried trashing it and getting a new one in the mail, but the new one was invisible too.
           
          • Advize

            Advize Cosmic Narwhal

            What you may want to do then is change the value of it instead of trying to add a new key to the dictionary. You're probably using .Add() on the dictionary somewhere, and you can change that to check if the key exists, and if so assign a new value to it. I'd supply the code but it's difficult on mobile.

            Edit: NVM, just saw the second page of comments and noticed you discovered the problem and you're implementing the suggestion already. My apologies.
             
              Digus likes this.
            • Digus

              Digus Spaceman Spiff

              Do you have any other mods adding custom tools?
              I had this happen when I was trying to implement the new sprite and was not using the right id.
              My code is suppose to add the new sprite at the end of the tools.png and identify which Id it was placed at. So, this was not suppose to happen.
              Can you post here the SMAPI log? If you don't know where to find it, this link explain how: https://stardewvalleywiki.com/Modding:Player_FAQs#SMAPI_log

              Meanwhile, you can use 1.0.0 version without any problem, I only added the sprite and adjusted the code to avoid conflicts, but it you were not having any problem you can keep using that version for now.
               
              • Redawilo

                Redawilo Scruffy Nerf-Herder

                Only mods I'm using that add anything are Seed Bag and Giant Crop Ring.
                I'll use 1.0.0 in the meantime.
                 

                  Attached Files:

                • Digus

                  Digus Spaceman Spiff

                  Comparing your log to mine I saw something its missing:
                  Code:
                  [13:13:00 TRACE Console.Out] gameMode was 'titleScreenGameMode (0)', set to 'loadingMode (6)'.
                  [13:13:00 TRACE Console.Out] getLoadEnumerator('Modder_166466185')
                  [13:13:04 TRACE Console.Out] gameMode was 'loadingMode (6)', set to 'playingGameMode (3)'.
                  [13:13:04 TRACE SMAPI] BUTCHER intercepted TileSheets\tools.
                  [13:13:04 TRACE SMAPI] Context: loaded saved game 'Modder_166466185', starting summer 11 Y1.
                  But since this only happened when I was loading a save file, I would need to see what happen on yours after that too.

                  I will look into the mods you pointed out and also Rented Tools and Almighty Tool that was in your log.
                   
                  • Redawilo

                    Redawilo Scruffy Nerf-Herder

                    Here, my log after loading the save that has the invisible cleaver.
                     

                      Attached Files:

                    • Digus

                      Digus Spaceman Spiff

                      Tested all mods and nothing caused any problem.
                      But now I noticed somethings:
                      Your version of SMAPI is different than mine. I'm using some methods that are not even officially released, try update to SMAPI 1.15.4

                      This is also being logged:
                      Code:
                      [00:10:41 WARN  Entoarox Framework] A critical update for EntoaroxFramework is available, you should update immediately!
                      You probably should update this as well.

                      And some other mods are saying there is new versions available, they probably a not causing any trouble, but you might want to know:
                      Code:
                      [00:10:19 ALERT Fast Animations] Update to version 1.3 available.
                      [00:10:19 ALERT ChestsAnywhere] Update to version 1.11.1 available.
                      [00:10:19 ALERT LookupAnything] Update to version 1.16 available.
                      
                      Thank for the logs.
                      SMAPI version if probably the source of the problem.
                       
                      • Redawilo

                        Redawilo Scruffy Nerf-Herder

                        Ah! Yes, updating SMAPI and Entoarox Framework did the trick! So it was an error on my part, whoops. (To be honest, I haven't kept up with SMAPI updates because, as you could probably tell, I've got a number of mods that are kinda old...) Thank you for your assistance!
                         
                        • Digus

                          Digus Spaceman Spiff

                          You are welcome.
                          And I'm glad this is not a error on my part, lol.
                          I hope updating did not break your other mods.
                           
                          • Digus

                            Digus Spaceman Spiff

                            Status:
                            Currently I'm adding the food items and recipes into the game.
                            I will have to do some balancing, choose prices, skills, description and stuff.
                            After that I will need to add ways of getting this recipes, I don't just want to place than in some shop.
                            Mail can be done easy now with the MailFrameworkMod, but I'm also thinking of add than to the TV. May be a new channel, or some hacking into the Queens channel.
                            All of that will probably take some time.

                            Yesterday I was also experimenting on add a "sell for meat" button on the side of the sell animals button, as a way for people who don't want to directly butcher their animals to get the meat.
                            It is not an easy thing to do but it can be done. It would probably be easier to just change the MeatCleaver sprite and description to a magical wand, tough.
                            I'd like to know if there is any one interested in that feature. I think people who don't want to butcher their animals might don't want meat at all in their games. So it would be a useless work. What do you think?
                            This might also be an useless question, since these people would not even be looking into this thread. If you know such people, please ask them and let me know.

                            That also bring another thing I've been thinking. To change the mods name to Meat Project Mod.
                            Butcher was just the start, and with some config option I will be adding later, it might not even be required. This project is about Meat not killing, so I think I picked the wrong name and it might be pulling some people away.
                            What do you think?
                             
                              HopeWasHere, Ichimatsu and Karmylla like this.
                            • Karmylla

                              Karmylla Space Kumquat

                              These are all great ideas Digus!
                              I udnderstand where you're coming from, changing the title of the mod to Meat Project Mod would make a lot more sense, and probably a lot more people would be interested! Though, I'm not too sure about the magical wand replacing the meat cleaver, I rather liked it, but you do you, bo :)
                              (And, it's like you said, this is a mod that makes the animals into meat, no need to sugar coat the situation by replacing the tool with something 'magical')
                              For the new TV channel, you could use the CustomTV mod, which will make things a lot easier for you, in case you would like to add a new channel instead of "hacking into the Queens channel", like you've put it.

                              Loving how dedicated you are with this mod! Thanks so much for pursuing it till the end!
                               
                              • Digus

                                Digus Spaceman Spiff

                                Thank you for your reply. :D
                                The replace thing would be a config option. The default would still be the Meat Cleaver as it is.
                                I would place a "Animal Friendly" option on a json config file. With that, the Meat Cleaver would be a Wand, and the Mail you get it from would not have the P.S. part. That would be really easy to do.
                                The button would be more elegant, but also more difficult.
                                But maybe people don't want even that, and would just want a way to buy meat on store for the cooking recipes. That's another option I can think about later.
                                Just checking if there are people interested, as of now, I'm postponing it's development since more people are interested in the complete thing.

                                I'm aware of CustomTV mod, thanks for pointing it out.
                                That's why I fall back to another channel in case hacking does not work, hehehe.
                                That mod also inspired me to make the MailFramewrokMod. I thought someone had already made one, but could not find it, so I made it myself. I should probably announce it better tough. It only has poor page on nexus.
                                 
                                  Karmylla likes this.
                                • Digus

                                  Digus Spaceman Spiff

                                  Status:
                                  Every 15 of the original meat recipes are recreated. Every 15 dish has a description now. I have decided on some of the buffs for them.
                                  It's taking more time than I thought it would.
                                  That is because I'm keeping every name, price, description and edibility from this post.
                                  Since I was keeping this stuff, I had to look for these dishes online(I'm not from USA, never heard of Monte Cristo), looking for common ingredients that existed in the game as I tried to identify what CA meant to be the original recipe for them. Some were easy as ingredients sales prices matched exactly the sales price of the dish. Others are pretty generic like Duck Stew.
                                  Also, since I had to change the meat price to better represent the price of the animals, trying to recreate the recipe would not work for every dish.
                                  Besides that, mutton was suppose to be cheap meat, so no recipes were created for it, and I want at least one recipe for every kind of meat.
                                  Also, as of now, I can't add recipes that you can use any kind of meat, as you can do with egg, milk and fish. I would have to do an extensive hack ant it is not worth the effort. (everybody would use beef any way since it's the cheapest)
                                  Meat prices is what gives me trouble to balance things out. I have recipes varying from 312g to 2725g to create. Even the cheapest one is more than average for dish prices in the game. And I don't have completion to force people to make them at least once.
                                  What can make it worth spending 2725 on a dish? Probably anything I can make buffs with.
                                  I don't want the recipes to be useless also, but it's really difficult to work with what I have.
                                  I'm trying to make them unique at least:
                                  • Different combinations
                                  • Lots of skills that make sense together for the more expensive ones.
                                  • Extended duration.
                                  • Higher value than the current maxs.
                                  But I don't want to make overpowered recipes that break the game nether.
                                  So not to make it pay to win, if some buff is really good, I'm combining Meat with some rare ingredient so you cannot make tons of it without some effort.
                                  I'm also having the opportunity to use ingredients that were not used on any other recipes, like Wine, Honey, Snow Yams and Goat cheese. I think that adds some value to them.

                                  After finishing with the buffs, I will start to work on how you can get those recipes. See if I can place some of them on TV or if it's better to receive them all as letters.
                                  No idea of how much time it will take for release, but I'm working on this every chance I have.

                                  Question:
                                  Does anyone think higher value buffs will break the game?
                                  Like one expensive rare to make dish with +2 to speed? or +5 to attack?
                                  Would it still be worthless?

                                  TL;DR
                                  I'm working, but it will take more time.
                                  No great difficult besides balancing and needing more free time.
                                   
                                    HopeWasHere likes this.
                                  • Ichimatsu

                                    Ichimatsu Pangalactic Porcupine

                                    I don't think they'll break the game. I mean, Lucky Lunch is pretty OP and its ingredients aren't that hard to get.
                                    Aside from that, I don't really care much for buffs. I cook mainly to turn crab pot shellfish into sashimi for health & energy; to make stuff people love; and to complete
                                    achievements.
                                    I may be alone in this, but I find food and its mechanics overall lackluster and underwhelming in vanilla SV.

                                    Ps. I've always read your name as "Dingus." I just noticed that it wasn't, lol.
                                     
                                    • Digus

                                      Digus Spaceman Spiff

                                      Making some dishes loved could make them more useful, but probably there is already cheaper options for every character.
                                      I know people like speed and lucky bonuses, combining them will make some dishes worth a try at least.
                                      And if you are using luck to mine with bombs, speed and magnetism will save you time, so a dish like that might pay for it self.
                                      I will look for some advanced tip guides for the min max stuff, it might be useful to decide on some buffs.
                                      Thank you for your feedback.

                                      ps. Some people make this confusion with the Dingus word, it's not a first.
                                       
                                        Karmylla likes this.
                                      • Digus

                                        Digus Spaceman Spiff

                                        Status:
                                        Here is the sketch of food bonuses. I'll probably twitch a little more before releasing.
                                        [​IMG]
                                        I'm posting it here to get some feedback.

                                        Now I'll be focusing on how to get recipes. Lot's of letters and maybe channel presentations to write.
                                        Does anyone know of declared vegetarians or vegans between the characters? Or any comment about meat?
                                        I last played far into the game long time ago, so don't remember specific dialog. I remember there is a burger barbecue done by Gus, but I don't remember character comments.
                                        I don't want to make any inconsistency between characters personality when deciding who who will send recipes and what they will say.
                                        Any help is appreciated.
                                         
                                          Last edited: Oct 19, 2017
                                          Beon, Ichimatsu and HopeWasHere like this.
                                        • Digus

                                          Digus Spaceman Spiff

                                          Status:
                                          Implemented the custom channel using CustomTV mod. It will be named "The Queen of Sauce - Meat Friday".
                                          It will run on every Friday starting on the 3º week of the year. It will have new recipes on the 3º and 1º week of each month and will re-run the last new recipe on the 2º and 4º weeks.
                                          So it will have 7 meat recipes in a year and will rerun everything next year, same schedule.

                                          I also updated the MailFrameworkMod to nativity handle recipes. Before you could do it using callback functions. Now you can create a letter with the recipe name and it will do the work for you. (it will be released together with version 1.1.0 of the butcher mod)

                                          I have decided which recipe will run on TV and when, also decided who will give the other 8. (This can of course change, but it's more o less set)
                                          I have some ideas for the text of some letters and TV shows, but nothing have been written yet.

                                          I'm trying to think of conditions to receive the letters besides friendship level. Like combine friendship level, with some skill level, died in the mines, done some number of quest to a character, donated X to the museum...
                                          But I don't know what is possible or not. I don't plan on doing anything to elaborated now. I want to release this soon.
                                           
                                            Last edited: Oct 20, 2017

                                          Share This Page