RELEASED [SMAPI] New machines (flour, sugar, vinegar, rice?)

Discussion in 'Mods' started by Igorious, Mar 31, 2016.

Tags:
  1. Igorious

    Igorious Sandwich Man

  2. foghorn

    foghorn Pangalactic Porcupine

    Last edited: Aug 8, 2016
    Snarkypie likes this.
  3. HiHaHi123

    HiHaHi123 Orbital Explorer

    Thank you!
     
    • Igorious

      Igorious Sandwich Man

      Hi to everyone!

      Yes, it's added in last version.
      Syntax:
      Code:
      Output: {
        Items: {
          JojaCola: {
            Switch: [
              {
                ID: "IronOre",
                Chance: 0.4,
              },
              {
                ID: "Slime",
                Chance: 0.6,
              },
            ],
          },
        },
        MinutesUntilReady: 60,
      },
      
      I've not inspect yet, how it works. So answer is «no» (maybe in future).

      I've added compatibility for old saves, so if you already have X hearts, recipe will be added.
      I haven't check, how it works in «native» mechanics, so if you have issues with it, please write here.

      Thanks, I've fixed it.

      I have enought work in my life :)
      This mod/API is just challenge: I found some forum threads, where people said, that to add/modify some things in game is impossible task. But I like impossible tasks :D

      Sorry, it was broken :(

      I've fixed that. Thanks for report.
      Mod compatibility is most hard part of work.

      I've rewritten size calculation function for this menu. It should work now. Thanks for report.

      It's possible, but requires too many work. I'm not sure, that I want to puzzle out Author's code in this area.

      Almost all options are changable via configuration files. Just change values in Configuration\SimpleMachines.json, "Drying Rack" section.

      I will understand you, even if you place all words in random order :D

      There's only one barrier to create hundrends of machines: it's my paint skills :)

      Thanks :proper:

      Congratulations! :up:

      Can't reproduce. Maybe it's glitch in game.

      OK, I found cause of issue. Thanks.

      It seems great.
      Just one issue: 3rd item in 2nd row also should be redrawed. It's «tint» sprite: game colors it and draws over previous sprite.

      -----------

      Version 4.2.1.

      - Compatibility with lastest ALL version.
      - Fixed issue with too high Level-up menu. Now «OK» button should be always visible.
      - I've added some error handlers, so it should help to find and fix errors faster.
      - Cooking recipes: you can use half of heart in way to get (e.g. 2.5 hearts); recipes will be added to old saves; fixed recipe duplication in Saloon.
      - You can use chances for output items (like in Recycling machine);
      - Fixed Mixer work.
      Note, that DAPI requires «EnsureThat.dll» to work, so please don't delete it :)
       
        lannihamm and foghorn like this.
      • SanicDaFish

        SanicDaFish Tentacle Wrangler

        This is something I've wanted for a while in game. Artisan products for all categories, to increases profit. This feature would be a real selling point for me. Though they would most likely unlock at a late level (i.e. 8 or 9).
         
        • Igorious

          Igorious Sandwich Man

          Please, provide some examples.
           
          • Snarkypie

            Snarkypie Scruffy Nerf-Herder

            EDIT: Ok, disregard that. I had to reload the game for unrelated reasons, and that seems to have fixed it. Cactus fruit seeds, yay.
             
              Last edited: Aug 17, 2016
            • Snarkypie

              Snarkypie Scruffy Nerf-Herder

              So I added in the Jewelry Bench from pg 25, and it worked so I decided to start making other rings for it. What am I missing? SMAPI is giving me
              Exception during reading SimpleMachines. Cause: Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: A. Path '[3]', line 150, position 6.
              at Newtonsoft.Json.JsonTextReader.ParseValue()

              Line 150 is the one that starts with Aerinite; the guide says check your commas and quotes, but I've compared it to the Diamond ring line that does work, and cannot tell what is messed up. What am I not seeing?


              {
              ID: 194,
              Name: "Jewelry Bench",
              Description: "Used to create jewelry.",
              Skill: "Mining",
              SkillLevel: 7,
              Materials: {
              Wood: 50,
              Hardwood: 10,
              IronBar: 2,
              },
              Output: {
              Items: {
              Diamond: {
              And: { ID: "GoldBar", Count: 1 },
              ID: 960,
              MinutesUntilReady: 720,
              }
              },
              },
              ResourceIndex: 30,
              ResourceLength: 3,
              Draw: { Working: 1, Ready: 2 },
              },
              Aerinite: {
              And: { ID: "Refined Quartz", Count: 1 },
              ID: 961,
              MinutesUntilReady: 720,
              },
              },
              },
              ResourceIndex: 30,
              ResourceLength: 3,
              Draw: { Working: 1, Ready: 2 },
              },
               
              • Igorious

                Igorious Sandwich Man

                @Snarkypie, seems, you've written Aerinite in wrong place. Note, that it should be placed in Output->Items section. Something like this:
                Code:
                {
                    ID: 194,
                    Name: "Jewelry Bench",
                    Description: "Used to create jewelry.",
                    Skill: "Mining",
                    SkillLevel: 7,
                    Materials:
                    {
                        Wood: 50,
                        Hardwood: 10,
                        IronBar: 2,
                    },
                    Output:
                    {
                        Items:
                        {
                            Diamond:
                            {
                                And: { ID: "GoldBar", Count: 1 },
                                ID: 960,
                                MinutesUntilReady: 720,
                            },
                            Aerinite:
                            {
                                And: { ID: "Refined Quartz", Count: 1 },
                                ID: 961,
                                MinutesUntilReady: 720,
                            },
                        },
                    },
                    ResourceIndex: 30,
                    ResourceLength: 3,
                    Draw: { Working: 1, Ready: 2 },
                },
                 
                  Snarkypie likes this.
                • Snarkypie

                  Snarkypie Scruffy Nerf-Herder

                  Thank you!

                  I changed it to fit what you posted and got it to run successfully....once. Now SMAPI is giving me this error and the game won't start unless I remove your mod. What did I manage to mess up now?

                  [03:28:27.457 PM] [DAPI] Using overrides from "Resources\Craftables.png"...
                  [03:28:27.615 PM] [DAPI] Using overrides from "Resources\Items.png"...
                  [03:28:27.836 PM] An exception occured in XNA LoadContent: System.Exception: Fail during overriding Items: 27 [3x2] ---> System.ArgumentException: The size of the data passed in is too large or too small for this resource.
                  at Microsoft.Xna.Framework.Graphics.Texture.ValidateTotalSize(_D3DSURFACE_DESC* __unnamed000, UInt32 dwLockWidth, UInt32 dwLockHeight, UInt32 dwFormatSize, UInt32 dwElementSize, UInt32 elementCount)
                  at Microsoft.Xna.Framework.Graphics.Texture2D.CopyData[T](Int32 level, Nullable`1 rect, T[] data, Int32 startIndex, Int32 elementCount, UInt32 options, Boolean isSetting)
                  at Igorious.StardewValley.DynamicAPI.Services.TexturesService.OverrideTexture(Texture2D& originalTexture, Dictionary`2 spriteOverrides, TextureType textureType)
                  --- End of inner exception stack trace ---
                  at Igorious.StardewValley.DynamicAPI.Services.TexturesService.OverrideTexture(Texture2D& originalTexture, Dictionary`2 spriteOverrides, TextureType textureType)
                  at Igorious.StardewValley.DynamicAPI.Services.TexturesService.OverrideSprites()
                  at Igorious.StardewValley.DynamicAPI.Services.TexturesService.OnLoadContent(Object sender, EventArgs eventArgs)
                  at System.EventHandler.Invoke(Object sender, EventArgs e)
                  at StardewModdingAPI.Events.GameEvents.InvokeLoadContent()
                   
                  • Igorious

                    Igorious Sandwich Man

                    @Snarkypie, thanks for report. I will try to avoid XNB texture overwriting at all in next version.

                    Error
                    means, that engine can't copy sprite with index 27 and size 3x2 from Items.png to XNB.

                    You can try open Configuration\Totems.json file and replace all content via empty list:
                    Code:
                    [ ]
                    Big totems will work only in Farmhand, so it should has no effect in game now.
                    Please report, if you have any other issues.
                     
                    • bobothemonkeygod

                      bobothemonkeygod Space Spelunker

                      How about a Fish Smoker. I really like the fishing mini game but it isn't very profitable. Also, what if the smoker increased the value of the fish based on its catch difficulty rather than using a set multiplier of the base value. For example an easy fish like a carp will only get a 50% increase in value from smoking while an octopus, one of the hardest regular fish, will get a 500%-1000% value increase.
                       
                      • Shocktread

                        Shocktread Poptop Tamer

                        Welp. I've gone and added in four kinds of Cheesecake and two kinds of cordial. Now I just need to start learning how to make other stuff.
                        ...
                        Be afraid, be very afraid.
                        (And another thank you to Igorius for all of this.)
                         
                        • tj724

                          tj724 Guest

                          I wish I could get this mod to work for me.It looks great! I'm always looking for new mods that will spice up my game.I've tried several installs and when I run Smapi it only says 7 mods loaded.It could be conflicting with another mod.I have Busstopstorage cjbitemspawner pierresgeneralstoremod taintedcellar timespeed trainermod wonderfulfarmlife installed
                           
                          • Shocktread

                            Shocktread Poptop Tamer

                            Best suggestions? Take them out and put them back in one at a time if possible. Start with this mod and gradually add the others in.
                             
                            • tj724

                              tj724 Guest

                              Thank you so much for the help.I took out all of the mods backed them up and started with this mod first,it worked this time and then I added the others back in.Now I just have to learn all the new formulas.
                               
                                Last edited by a moderator: Sep 1, 2016
                              • tj724

                                tj724 Guest

                                I would love to see gin added to the product list.I'm still a modding greenhorn but it would be a great idea and put a universal hated item to good use,convert Salmonberry to Juniper Berry and when put into the keg it produces gin.The vodka bottle would be great for the sprite but it should have a different colored label.Also sugar cane? could be used to make champagne.Coconut could make Malibu Rum.Just a few suggestions.SV needs more spirits!
                                 
                                • tj724

                                  tj724 Guest

                                  Moonshine from corn? Does someone have the right coding for this? I tried to do this myself and failed miserably.I ended up with blank sprites and wallpaper in artisan goods.
                                   
                                  • Shocktread

                                    Shocktread Poptop Tamer

                                    I could send you the sprite work and files I modded but some of the recipes I added assume the presence of the more crops mod.
                                     
                                    • tj724

                                      tj724 Guest

                                      I would love to try it out! Would that require both the standalone more crops mod and the one in this package to work?
                                       

                                      Share This Page