Modding Discussion Modders, have at it with Butchering- CA officially says he's not going to add it in.

Discussion in 'Mods' started by FinalMantasyX, Mar 20, 2016.

  1. Zhuria

    Zhuria Cosmic Narwhal

    ok maybe I was wrong about adding buildings I crashed my game roffll
     
    • Declension

      Declension Cosmic Narwhal

      Oh my xD Yeah I thought adding buildings would be more of a challenge than a tool. But still keep at it!
       
      • ThatNorthernMonkey

        ThatNorthernMonkey Aquatic Astronaut

        So we can now create the meat objects! Will work on the Tool properly tomorrow I think. A slaughterhouse building with a new location would be interesting too.
         
          Declension likes this.
        • Zhuria

          Zhuria Cosmic Narwhal

          I will, and I'll let you guys know if I make any progress!
           
            BoffoBoy and Declension like this.
          • Declension

            Declension Cosmic Narwhal

            Can you share the file so we can at least be able to butcher them with a sword for now. I'm no coder, so I dunno how to activate meat drops.
             
            • Declension

              Declension Cosmic Narwhal

              Also slapping this link on, since some of reddit is commenting. Hopefully new ideas, etc.
              https://www.reddit.com/r/StardewValley/comments/4befst/butchery_modding_possible/

              Decided just to edit this so I'm not clogging up too much of this forum. For people who want to mess with the code and such.

              This is for the meat data in the objectinformation.xml (Adding descriptions should be easy to not worry right away).

              Code:
              <Item>
                    <Key>639</Key>
                    <Value>Beef/200/15/Basic -14/Meat from a cow. Fatty and slightly sweet.</Value>
                  </Item>
                  <Item>
                    <Key>640</Key>
                    <Value>Pork/300/15/Basic -14/Meat from a pig.</Value>
                  </Item>
                  <Item>
                    <Key>641</Key>
                    <Value>Chicken/100/15/Basic -14/The meat of a chicken. It's mild.</Value>
                  </Item>
                  <Item>
                    <Key>642</Key>
                    <Value>Duck/150/15/Basic -14/The meat of a duck. It's darker and richer than chicken meat.</Value>
                  </Item>
                  <Item>
                    <Key>643</Key>
                    <Value>Rabbit/150/15/Basic -14/The meat of a rabbit. It's very lean.</Value>
                  </Item>
                  <Item>
                    <Key>644</Key>
                    <Value>Cheap Meat/75/15/Basic -14/This came from an animal that wasn't intended for meat production.</Value>
                  </Item>
                  <Item>
                    <Key>652</Key>
                    <Value>Meatloaf/370/90/Cooking -7/A dense meat casserole with a sweet tomato glaze.</Value>
                  </Item>
                  <Item>
                    <Key>653</Key>
                    <Value>Orange Chicken/250/65/Cooking -7/It has a sweet, tangy sauce.</Value>
                  </Item>
                  <Item>
                    <Key>654</Key>
                    <Value>Monte Cristo/620/120/Cooking -7/(?description?).</Value>
                  </Item>
                  <Item>
                    <Key>655</Key>
                    <Value>Bacon Cheeseburger/660/130/Cooking -7/(?description?).</Value>
                  </Item>
                  <Item>
                    <Key>656</Key>
                    <Value>Roast Duck/410/100/Cooking -7/(?description?).</Value>
                  </Item>
                  <Item>
                    <Key>657</Key>
                    <Value>Rabbit au Vin/570/110/Cooking -7/(?description?).</Value>
                  </Item>
                  <Item>
                    <Key>658</Key>
                    <Value>Steak Fajitas/415/100/Cooking -7/(?description?).</Value>
                  </Item>
                  <Item>
                    <Key>659</Key>
                    <Value>Glazed Ham/550/105/Cooking -7/(?description?).</Value>
                  </Item>
                  <Item>
                    <Key>660</Key>
                    <Value>Summer Sausage/360/90/Cooking -7/(?description?).</Value>
                  </Item>
                  <Item>
                    <Key>661</Key>
                    <Value>Sweet and Sour Pork/450/105/Cooking -7/(?description?).</Value>
                  </Item>
                  <Item>
                    <Key>662</Key>
                    <Value>Rabbit Stew/360/90/Cooking -7/(?description?).</Value>
                  </Item>
                  <Item>
                    <Key>663</Key>
                    <Value>Winter Duck/360/90/Cooking -7/(?description?).</Value>
                  </Item>
                  <Item>
                    <Key>664</Key>
                    <Value>Steak with Mushrooms/510/105/Cooking -7/(?description?).</Value>
                  </Item>
                  <Item>
                    <Key>665</Key>
                    <Value>Cowboy Dinner/305/80/Cooking -7/(?description?).</Value>
                  </Item>
                  <Item>
                    <Key>666</Key>
                    <Value>Bacon/300/75/Cooking -7/(?description?).</Value>
                  </Item>

              This is for the weapon (Originally sword) in the FarmAnimal Class(?) Aka: Meat Cloud

              Code:
              public void hitWithWeapon(Tools.MeleeWeapon t)
                      {
                          health--;
                          hitGlowTimer = 300;
                          if (sound != null && !sound.Equals(""))
                          {
                              if (Game1.soundBank != null)
                              {
                                  http://Microsoft.Xna.Framework.Audio .Cue hurtSound = Game1.soundBank.GetCue(sound);
                                  hurtSound.SetVariable("Pitch", 1800);
                                  http://hurtSound.Play ();
                              }
                          }
                          if (health <= 0)
                          {
                              int numClouds = frontBackSourceRect.Width / 2;
                              for (int i = 0; i < numClouds; i++)
                              {
                                  int nonRedness = Game1.random.Next(0, 80);
                                  Game1.currentLocation.temporarySprites.Add(new TemporaryAnimatedSprite(5, position + new Vector2(Game1.random.Next(-Game1.tileSize / 2, frontBackSourceRect.Width * 3), Game1.random.Next(-Game1.tileSize / 2, frontBackSourceRect.Height * 3)), new Color(255, 255 - nonRedness, 255 - nonRedness), 8, false,  Game1.random.NextDouble() < .5 ? 50 : Game1.random.Next(30, 200), 0, Game1.tileSize, -1, Game1.tileSize, Game1.random.NextDouble() < .5 ? 0 : Game1.random.Next(0, 600))
                                  {
                                      scale = Game1.random.Next(2, 5) * .25f, alpha = Game1.random.Next(2, 5) * .25f, motion = new Vector2(0, (float)-Game1.random.NextDouble())
                                  });
                              }
                              (home.indoors as AnimalHouse).animalsThatLiveHere.Remove(myID);
                              Game1.currentLocation.temporarySprites.Add(new TemporaryAnimatedSprite(sprite.Texture, sprite.SourceRect, position , FacingDirection == Game1.left, .025f, Color.LightPink) { scale = 4f});
              
                              Game1.playSound("killAnimal");
                              Random r = new Random((int)myID / 2 + (int)Game1.stats.DaysPlayed);
                              int numMeats = age >= ageWhenMature ? type.Equals("Hog") ? r.Next(6, 9) : r.Next(3, 6) : 1;
              
                              //PROFESSION
                              if (t.getLastFarmerToUse().professions.Contains(Farmer.butcher)) numMeats++;
              
                              while (r.NextDouble() < (t.getLastFarmerToUse().FarmingLevel + t.getLastFarmerToUse().LuckLevel) / 50f) numMeats++;
                              Game1.createRadialDebris(Game1.currentLocation,meatIndex, getTileX() - 1, getTileY() - 1, numMeats,false, -1, true);
              
                          }
                      }

              Other than that, I got some extra little tid bits that maybe can give ideas to others about animals and more hardcoded things. Probably pretty difficult, I'm no coder.

               
                Last edited: Mar 21, 2016
                Drogean likes this.
              • alacazain

                alacazain Void-Bound Voyager

                Don't forget cured hams! We should be able to hang meat with salt aswell. Maybe in the cave, or make a whole new butchery building.
                 
                  witchss likes this.
                • Declension

                  Declension Cosmic Narwhal

                  That's an idea. There was someone who not only expanded the cave on the farm, but even added a second floor and maybe has plans for a basement level. Might be a good place for artisan machines and the like as well. (So far adding functional buildings are in testing c: )
                   
                  • Reidlos Toof

                    Reidlos Toof Void-Bound Voyager

                    I'm looking forward to this. I literally had animals for long enough to get my community center and shipping requirements done, plus stock up on their items for cooking then sold them all and converted the barn into a brewery because the cost outweighed the profit of keeping them.
                     
                      Declension likes this.
                    • Declension

                      Declension Cosmic Narwhal

                      I was able to get the meat and stuff in.. I have no idea on how to add the weapon hit :< if anyone can help that would be great
                       
                      • Zero Zet

                        Zero Zet Space Spelunker

                        Buuut, there is already a Score in place, modders can just tap into that, so freshly bought animal, for example, gives just one chunk of meat, not selling for enough to cover the cost of an animal by itself, while fully cared-for animal explode into shower of chunks...
                        Well, if star quality affected of ingredients affected things we could just slap a bonding to star rating function to meat and call it a day, really.

                        As far as Artisan buildings for meat go... Hm, a Smokery to preserve your meat (and fish!) and Sausage Maker, maybe?
                         
                          Superior_s likes this.
                        • ThatNorthernMonkey

                          ThatNorthernMonkey Aquatic Astronaut

                          Sorry mate, I went to bed not long after my previous post! Ill adjust and add the rest of the meats using data from his file and upload a WIP version if you like? SMAPI 0.38.3 (unless there's been a SMAPI update this morning, going through alerts so yet to check!).

                          Zero Zet, all good ideas. :) will add all the various ideas to a text file later and give them a good look over.
                           
                          • Superior_s

                            Superior_s Sandwich Man

                            0.38.5 that would be awesome though.
                             
                              ThatNorthernMonkey likes this.
                            • Declension

                              Declension Cosmic Narwhal

                              Never thought I would have to use that but I'm willing to dive into it if it brings butchery to the game and all these ideas. I'm very noobish at things other than art so forgive me if I come to you for questions (or more so translations for the not so tech savvy)!
                               
                              • Avarwen

                                Avarwen Pangalactic Porcupine

                                Why not just have a slaughter house in goes animal out comes meat no visual violence required.
                                 
                                • Ghostly Fox

                                  Ghostly Fox Heliosphere

                                  Glad that butchering modding is getting done so that people who want it can have it. Personally probably wo nt use it, but I don't know that for a fact.

                                  That said, it may be a good idea to keep butchery things kept to buildings specifically designed for the mod, if only so you don't have to deal with the inevitable people who will comp!win that they want a feature from the mod (like an expandable cave of abasement) without 'moral bankruptcy' that downloading the mod would 'require.'

                                  On a more serious level, killing your animals in the same place your prep and or cure the meat would be a sanitation nighmare. That said, a smoke curing shed would be an interesting idea, especially since where I live the ranchers use metal or stone silos. That might be a local method, though.
                                   
                                  • ThatNorthernMonkey

                                    ThatNorthernMonkey Aquatic Astronaut

                                  • Declension

                                    Declension Cosmic Narwhal

                                    Thank you for posting this.

                                    As for buildings it's still in experimental phase. We have to figure out how to add them, and probably make new code to make them function (as some ideas were to send the animals to them).

                                    I think it's much easier to work with a tool for now and get that working before experimenting with the building process of functioning, dialog from butcher, etc.

                                    I'm hoping to make all these possible options so there isn't just one way? Remember we're starting with just the basics, and learning things along the way. I've been keeping contact with Ape to get his coding ideas and such to make the process easier.

                                    Thanks for the ideas! Hope they can get along with the mod, just for now getting the base of the code which is meat drops and tool/weapon hit is just the start.
                                     
                                    • Zero Zet

                                      Zero Zet Space Spelunker

                                      Well, if one really want to go away with more visceral bits of the deed, one could always just go at it like selling goes currently. Just mark the offending animal for culling and receive its meat in exchange.
                                      But I like the "hands-on" approach better. So butcher's knife might be a better solution. Use it on your favorite future beef to instantly slice it's throat and end it's life painlessly. And then, to get to that delish meat, dismember the resulting corpse with your trusty lumber axe! Mwa-ha-ha-ha-ah, sorries). Could also produce bones for further crafts or bonemeal fertilizer
                                      But true, such deed might better be done in a designated place. So you'll have to get an animal to follow you (Shepard's crook, anyone?) and bring it there to its doom and your future meal)
                                       
                                      • Zhuria

                                        Zhuria Cosmic Narwhal

                                        Would loooove something like a shepherds crook or some kind of lead!
                                         

                                        Share This Page