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

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

  1. Midnyght

    Midnyght Orbital Explorer

    Meeting the condition meaning?
     
    • Midnyght

      Midnyght Orbital Explorer

      Also, is there a way to get the meat from this mod to be recognized as the same as the meat from the alternative meat mod? I want all the recipes and I'm dealing with two different 'beef' types, but it'd be nice to be able to combine them.
       
      • Digus

        Digus Spaceman Spiff

        The mod checks if you have a building called "Deluxe Coop" or "Deluxe Barn" or "Big Barn", and you need to have at least one animal in it.
        Also, you should not have an insemination syringe in you inventory or inside a chest.
        This is checked at the start of everyday.

        On my part, there is no way. I never added the meat or the dishes sprites, they were already in the game.
        Depending on the mod you are using, you can try change it to use the same item Id that I'm using. That would do the trick. But you can only do it if the mod can handle customization and the override of the game assets. You would have to edit the items and the recipes to use the Ids.
        Which mod are you using? I can try to look if it's possible.

        Here are the ids I'm using for meat:
        https://github.com/Digus/StardewValleyMods/blob/master/ButcherMod/meats/Meat.cs
        And for the dishes:
        https://github.com/Digus/StardewValleyMods/blob/master/ButcherMod/cooking/Cooking.cs
         
        • genman

          genman Subatomic Cosmonaut

        • Digus

          Digus Spaceman Spiff

          I've thought about it, but it's not planned for now.

          The truth is that the development of this mod is on hold.
          I became a little burnout and I'm doing other stuff on my free time. I will probably get back when multiplayer comes out, since I will need to update the mod.
          I'm still checking this forum and nexus everyday to see if people needs help, so the project is not abandoned, just on hold.
           
            Last edited: Apr 19, 2018
            genman and HopeWasHere like this.
          • origamipenguin79

            origamipenguin79 Space Hobo

            I notice you said the mod is on hold so don't feel obligated to put too much effort into this, but I'm getting an error that I can't solve.

            Pregnancy isn't working out so well for me. When I use the syringe, the animal (I have tried both a cow and a goat) shows up as pregnant, but on the day they are supposed to give birth, they show up as no longer pregnant but no baby appears. I have a deluxe barn that is only half full. Checking the log, I find an error looking like this:

            Animal Husbandry Mod The animal id '-9223372036854775621' was not found in the game and its pregnancy data is being discarted.

            So clearly something is going wrong during the "birth" event, which is a bummer. Definitely appreciate all the other (working just fine) features!
             
            • Digus

              Digus Spaceman Spiff

              It's on hold for new features, but I'm still willing to fix any problems.
              Did this happened multiple times?
              Can you upload the log so I can take a look? https://log.smapi.io/
               
              • origamipenguin79

                origamipenguin79 Space Hobo

                The first time it happened, I didn't catch the log for it, because I just thought I screwed up and never actually impregnated the cow in question, so I just used the syringe again.

                I was paying closer attention the second time when the due date came around, and immediately pulled up the log, which is here: https://log.smapi.io/FXPWMDQ3

                I had exited that game day, so the save file was still the same. I backed up the save and booted it up again, and the new log immediately threw the same error: https://log.smapi.io/Q8hHdcVP
                 
                • Digus

                  Digus Spaceman Spiff

                  I was checking my code when you reported the bug to see if I learned something.
                  What is really weird is that the problem only happen when it's the day of the birth.
                  At the start of each day the mod check all pregnant animals to see if they are ready for birth, if it does not found the animal, it discards the pregnancy data. That is because people could have sold or killed the animal, and that is the way to avoid trash data.
                  If it was some conflict with other mods, it would problem discard the pregnancy info much sooner, it would not only happen on the day of birth.
                  Did you get a notification on the day before the animal is going to give birth?
                   
                  • origamipenguin79

                    origamipenguin79 Space Hobo

                    For the first time, where I have no log, I got no notification, but I had (perhaps incorrectly) assumed that since the cow in question was suddenly no longer pregnant that it was supposed to be the day. I continued with the save file and chose different animal for my second attempt.

                    For the second attempt, I again had no notice but I discovered my should-be-pregnant cow and goat no longer were, with no babies to be found, exited mid-day so it wouldn't save, and found the error in the log.

                    The third attempt (same save file as the second, just reloaded), the log immediately threw the same error, but both the cow and goat were still pregnant with a couple days left on their timers. I continued playing the save file today and they each correctly got a day-before and day-of notice, and the babies showed up correctly, so problem solved I guess.

                    The first incident I'm willing to chalk up to me accidentally butchering the pregnant cow instead of my other not-pregnant one, but I have no clue as to why the second/third attempts had differing outcomes. I got my calf and kid in the end, so I'm just going to chalk it up to my game being weird. You don't need to spend too much time trying to figure out what went wrong, haha.
                     
                    • Digus

                      Digus Spaceman Spiff

                    • Digus

                      Digus Spaceman Spiff

                      @skuldomg , I'm answering you here to not clog the other thread.
                      The MailFramworkMod work as a repository of letters and conditions. You register a letter with a condition, and it will be delivered everyday if the condition is true.
                      So it is intended that modders manually control if the player has read his letter.
                      Giving that, it's also a good practice to add all your letters when loading the mod.

                      There are someways to control if the player has read the letter, here are the ones I did in my mod:
                      Recipe letters was really easy, I just placed "not know the recipe" as part of the condition.
                      Letters that deliver tools, check if the person already has the tool, so it will be automatically be sent again if the tool is trashed.

                      Besides the condition, you can save your letter with a callback function. That function will be called once the letter is read by the player. This way you can save on some variable that the letter was read, and place that as part of the condition. The way the game does that is adding the name of the letter to 'Game1.player.mailReceived'
                      I also have a similar example in the Animal Husbandry Mod:
                      https://github.com/Digus/StardewValleyMods/blob/master/ButcherMod/tools/ToolsLoader.cs
                      Take a look at the feedingBasket letters. I have 2 letters, one for the first time and another one for redelivers. The first letter had this as part of the condition:
                      Code:
                      !Game1.player.mailReceived.Contains("feedingBasket")
                      And this as the callback function:
                      Code:
                      (l)=> Game1.player.mailReceived.Add(l.Id)
                      So, once that Letter is read, it will never be delivered again for that player.
                      The redelivery letter on the other hand, will only be sent if the player that already read the first letter, and trashed the feeding basket.

                      If you don't like this "repository" approach, there is another way, but I don't recommend it:
                      Another thing you can do is call the saveLetter with '(l)=>true' as condition to register the letter only when you want it to be sent, and (l)=> MailDao.RemoveLetter(l) as a callback.
                      The problem with this code is that if the person leaves his save to load another, you has to manually remove the letters, otherwise the letter will be sent to the new character.
                      Edit: Also, if the person quit the game without reading the letter, you have to check to add the letter again.
                       
                        HopeWasHere likes this.
                      • Digus

                        Digus Spaceman Spiff

                        Status:
                        I already updated my code for 1.3, but hadn't been able to test it yet.
                        PyTK is not loading for me (says it is not updated, even when using the last version), and all my tools are pretty dependent on it for loading, as well as the TV.
                        I might try to work around it if I can't solve the problem other way.
                        I'm not sure if it's a problem with PyTK or SMAPI.

                        I'm planning on releasing a beta version compatibly with single player first.
                        Then, I will try to make it multiplayer compatible, but expect it to only fully work for Meat. Pregnancy and Feeding require data saving, so it will only be possible to be done by the farmer owner. When SMAPI support some data sync, it might be possible to be added to farmhands as well.

                        I'm also having some problems with PC memory when developing.
                        It is possible I won't be able to test multiplayer stuff without some help. So it might take more time.
                         
                          lexiejetts, genman, xixvimmm and 2 others like this.
                        • Digus

                          Digus Spaceman Spiff

                          Status:
                          PyTK still does not have a working version released.
                          I manage to work around the problem downloading the git version and updating it myself. It is enough for me to test Animal Husbandry Mod, but I will only release a beta version when an official working version of PyTK is released.

                          The mod is mostly working. I have done two wrong things when updating the code and have already fixed. (involving textures and friendship)
                          I also found a bug with the moving animal from building. I'm still to fix it.
                          Have not tested saving the day to see if pregnancy and feeding is updating properly, but should not have any bugs as nothing changed here. But birth might be a problem.
                          I also have a weird behavior when feeding pets. If they are moving, the animation does not show properly. I have done some stuff to avoid it when developing it, but it's not working anymore.

                          As I said, I'm not testing multiplayer yet.
                           
                            lexiejetts and HopeWasHere like this.
                          • hwayunhae

                            hwayunhae Pangalactic Porcupine

                            @Digus, the mod compatibility page for SMAPI updated that PyTK has a working version. it's the optional download in the Nexus page. Just giving you a heads up.
                             
                            • Digus

                              Digus Spaceman Spiff

                              Yeah, I saw that yesterday and it worked fine. I'm still having memory problems, but also had little time to make any progress.
                              I hope I can release a beta version this weekend, even if I don't fix all the problems, I can list them as known issues as they are not game breaking.
                               
                              • hwayunhae

                                hwayunhae Pangalactic Porcupine

                                Take your time. I just wanted to let you know just in case you hadn't seen it. :D

                                I hope the memory problems resolve for you sooner, but no worries if they slow you down. Your mod is good enough that no matter how long it takes it'll be worth the wait. ^^
                                 
                                • Digus

                                  Digus Spaceman Spiff

                                  Thank you! :)

                                  Thanks to the memory gods I had no issue today, so I took the opportunity to work a lot.

                                  Status:
                                  Fixed the moving animal problem. It was a double bug. My code was not updated correctly when checking for the type of building an animal could live in. But version 1.3.9 of Stardew was also not doing so. But it is already fixed in version 1.3.10
                                  Fixed the feeding animation of pets. They changed how the current behave of the animal was updated. When I figured it out, it was an easy fix.
                                  Tested everything I could remember and the mod seems to be working fine.
                                  I'm doing to see if I can place some restrictions for multiplayer games.
                                  Then I will prepare a beta release.
                                  I'm working on the version with unfinished code of the animal contest events. So I have to disable everything before releasing. But it shouldn't take time.
                                  You can still expect a beta version until the weekend.
                                   
                                    Last edited: May 10, 2018
                                    hwayunhae likes this.
                                  • Digus

                                    Digus Spaceman Spiff

                                    Status:
                                    Tested the game in multiplayer just to see what I could do to disable stuff. Ended up fixing a lot of stuff there.
                                    Meat was working fine in multiplayer, as well as receiving letters. Even the Meat Cleaver animation is working fine.
                                    There was some problems with the insemination syringe and the feeding basket animation, but that is now fixed. But I haven't seen the animal feeding animation, I'm still to add animals to my multiplayer farm.
                                    I found one major problem for the tools to work in multiplayer. They are not being loaded and saved properly. If a game has a custom tool in it's world at the time someone joins, the game crashs. And when trying to save after a day, it also crashs. That is a problem with the PyTK. I already reported it.
                                    The good news is that if a disable the tools, you can probably still use the meat button in multiplayer. But I have to test that.
                                    I can probably already release a beta version that work fine on singleplayer, but I don't want to rush things. I prefer to test things myself first so when someone report something I have at least an idea of what might be happening.

                                    MailFrameworkMod:
                                    I also investigated how the letters background work. All the code is internal and not customizable, but it's easy to work around id. So in the future I might add options to change background and text color on letters, maybe even custom backgrounds.
                                     
                                      HopeWasHere likes this.
                                    • Digus

                                      Digus Spaceman Spiff

                                      Status:
                                      Just uploaded the beta version to nexus.
                                      Platonymous asked me to update the latest version to git so he can take a look on the problems I reported. So I'm waiting on that.
                                      I will probably fool around with smaller features on this mod and MailFramework. It would be nice if the interdenominational friend had an custom letter background. I might add meat and feeding for the dinosaurs, some one asked for it.
                                       

                                      Share This Page