WIP [SMAPI] Consillium's Pet Enhancement Mod

Discussion in 'Mods' started by Consillium, Apr 30, 2016.

  1. Consillium

    Consillium Poptop Tamer

    Hi Everyone!

    I've been working on a mod to enhance the pets of Stardew Valley! This is an ongoing process, but I decided to put up what I have as a work in progress.

    Assuming that your furry friend has enough friendship points (3 hearts worth), right clicking on him or her will entice the critter to follow you around your farm! If the little bugger gets in your way, you can always right click again to stop.



    -------------
    KNOWN ISSUES
    -------------

    - Believe or not, your favorite animal is a fat bastard. Your cat or dog has a bounding box with a width of more than a single game tile!! This means that he or she won't be following you through your gates or narrow passages, but he'll try to find a way around!

    - Fluffy isn't always keen to animate properly, and you might sometimes find her floating towards you with stiff limbs...I've scheduled a veterinarian appointment for this.

    --------------
    FUTURE GOALS
    --------------

    - Allow multiple pets to follow you at once (if you have multiple pets somehow)
    - Allow barn animals to follow you as well
    - Pets and and animals can follow you outside of your farm
    - Pets will bring you items based on their heart level
    - Additional pet behaviors when in "follow" mode.


    Thanks! I'm looking forward to continued work on this :)


    Mod Download Link: Download

    Source Code Link: GitHub
     
      Last edited: May 5, 2016
    • taintedwheat

      taintedwheat Master Astronaut

      YES YES YESYEYSYSYSES. I love this. I'd give you a kiss.

      Can you look into getting multiple pets of the same breed? I want my pug and my mutt to follow me everywhere <___>
       
        farmvillesux and Rosalie like this.
      • Consillium

        Consillium Poptop Tamer

        Sure! I can give it a shot :) to be honest it might take me a bit to figure out how to get multiple pets to pathfind at the same time.
         
          taintedwheat likes this.
        • taintedwheat

          taintedwheat Master Astronaut

          I feel it, I mean the fact that you can even do that much is amazing. @_@
          I'm not sure if this will help, but this was supposedly the code used by keyten to achieve that.
          Right now I'm using a pug as a cat, and since the animations are so different the spriting looks all weird to spend time to customize it to be a cat when its already is and animates like a dog >.<

          (not like i know what any of this really means either, but:)
          Code:
                      int CatNum = 1, DogNum = 1;
                      for (int i = 0; i < curloc.Characters.Count; i++)
                      {
                          string s;
          
                          if (curloc.Characters[i].Name=="Cattos")
                          {
                              s = "Cat_" + CatNum+".png";
                              CatNum++;
                              if (CatNum > 16) CatNum = 1;
                          }
                          else
                          {
                              s = "Dog_" + DogNum + ".png";
                              DogNum++;
                              if (DogNum > 14) DogNum = 1;
                          }
                          var path = Path.Combine(PathOnDisk, s);
                       
                          @event.ReturnValue = @event.Root.LoadResource(path);
                          Console.WriteLine(@event.ReturnValue);
                          OpenTexture = @event.Root.LoadResource(path);
          
                          var CustomAnSprite = @event.Proxy<AnimatedSpriteAccessor, AnimatedSprite>(new CustomAnSprite());
                          curloc.Characters[i].Sprite = CustomAnSprite;
                          curloc.Characters[i].Breather = false;
                      }
           
            Superior_s likes this.
          • Gantros

            Gantros Pangalactic Porcupine

            Could you make pigs follow you in the same manner as you intend for pets? The reason for this is to take a pig into the Secret Woods to find truffles, the success of which is the number of hearts you have gained from its care. On the pet side of things, the dog can sniff out artifacts and improve the chances of items you dig up in the mines and elsewhere even without the telltale worms and the cat can help you with fishing by making the fish easier to catch (by enlarging the catch bar or slowing the fish or something).
             
              Yoseiri, XaviiKinz and taintedwheat like this.
            • Consillium

              Consillium Poptop Tamer

              Those are some good ideas! I'll definitely add it to my list of things to consider in the near future : )
               
                Yoseiri likes this.
              • Rosalie

                Rosalie Cosmic Narwhal

                AAHHH YES YES THANK YOU!! when this is finished it's gonna push me to use SMAPI <3

                will the pet still follow you when you're on a horse?
                 
                • BlankSlater

                  BlankSlater Space Penguin Leader

                • SpringsSong

                  SpringsSong Cosmic Narwhal

                  Definitely keeping an eye on this mod! I'd love to be able to have multiple (different) cats on my farm, even if only one actually follows me <3
                   
                  • Consillium

                    Consillium Poptop Tamer

                    That is actually a good question, I haven't actually tested this yet. I'll give it some thought as to what the pet should do in this situation. One option is to increase the speed of the pet so it can keep up, or maybe I can do something cute like have the pet sit on the rear of the horse while riding :p.

                    I wouldn't count on it, not anytime soon anyways. With SMAPI I don't think there is a lot I can do to override the game's internal collision detection. I'm willing to take a look if there's a demand for it but it wouldn't be high on my list of priorities.
                     
                      Rosalie likes this.
                    • taintedwheat

                      taintedwheat Master Astronaut

                      omgggg that would be SUPER CUTE, or like have little a little wheelbarrow or wagon attached onto it xD
                       
                        Consillium likes this.
                      • alan88

                        alan88 Void-Bound Voyager

                        I love you..also this mod is superb :kitten2: :kitten:
                         
                        • GBDetective

                          GBDetective Void-Bound Voyager

                          The possibility of your dog/cat following you around the town/forest/mountain sounds absolutely adorable. I also agree that having multiple dogs/cats would be excellent as well, even if only one followed you. :kitten2: Thank you for looking into this!
                           
                          • Consillium

                            Consillium Poptop Tamer

                            I just updated the link to the download. The new version fixes a few things:
                            • Dogs will now follow you properly, I removed some debug code that made the mod only work for cats
                            • Pets will now be able to navigate around farm buildings such as the coop and barn
                            • Pets will follow you on a horse (albeit slowly...)
                            I initially thought about placing the pet on the horse with you...but the horse is about the size of the pets to begin with. Another option is to just speed up the pet while "you're" on your horse. Anyways, there are still some issues with the animation that I'd like to take a look at.
                             
                            • taintedwheat

                              taintedwheat Master Astronaut

                              I will check this out, but how will this work if you have both a cat and dog?
                              My pug <currently a cat b/c cant do two or more different breeds of the same species atm> was following me and then like my game started freezing up something about the pet not able to find my path?
                               
                              • Consillium

                                Consillium Poptop Tamer

                                Hmm, I still haven't tested it with multiple pets, which mod are you using for that? And would you be able to upload your save file?

                                Note: Also, I ran into a similar issue with my pet not being able to find a path, I fixed the issue so that if a pet can't find a path to you, it will just sit down where it is
                                 
                                • taintedwheat

                                  taintedwheat Master Astronaut

                                  No mod for the second pet, I just copy and pasted the NPC code for the dog in my save file and pasted it and edited the tag to be a cat and changed the name, otherwise you'll just get a second copy of the dog you have already. D:
                                  The only way I know how of the multiple breeds code above is someone was going to work on it but they never did. And that sucks, what the hell.

                                  But anyway, here it is attached n__n

                                  and the latest error log.
                                   

                                    Attached Files:

                                  • Consillium

                                    Consillium Poptop Tamer

                                    Thanks! I'll check it out, in the meantime, looking at the log, that specific issue with the pathfinding should be resolved...for the moment...
                                     
                                    • taintedwheat

                                      taintedwheat Master Astronaut

                                      okie dokie, forsure, i was just making sure for good measure n--n;

                                      thanks again!
                                       
                                      • taintedwheat

                                        taintedwheat Master Astronaut

                                        [​IMG]


                                        I love your mod thus far though.

                                        My dog isn't responsive still, but the pathing is so much more improved. Pug-cat seems to follow pretty well. Does moonwalking and what not, but that's cute.
                                        Can go as far as the end of the farm map goes!

                                        EDIT: it slows and basically freezes mad tough when I get around a group of my farm animals. Does this mod conflict with the farm animal love labels mod?

                                        My mod list:
                                        [​IMG]
                                         
                                          Last edited: May 5, 2016

                                        Share This Page