RELEASED [SMAPI] Shop Expander: Buy stacks of 999 for common resources.

Discussion in 'Gameplay Mechanics' started by Entoarox, Apr 13, 2016.

  1. Entoarox

    Entoarox Oxygen Tank

    Please post your config contents in a code block so I can see what error it keeps throwing.
     
    • SasuraUchiha

      SasuraUchiha Cosmic Narwhal

      Code:
      {
        "debugMode": false,
        "shops": [
          "ScienceHouse",
          "SeedShop"
        ],
        "objects": [
          [
            "ScienceHouse",
            "388",
            "100",
            "!earthquake"
          ],
          [
            "ScienceHouse",
            "390",
            "100",
            "!earthquake"
          ],
          [
            "ScienceHouse",
            "388",
            "300",
            "!secondYear,earthquake"
          ],
          [
            "ScienceHouse",
            "390",
            "300",
            "!secondYear,earthquake"
          ],
          [
            "ScienceHouse",
            "388",
            "999",
            "secondYear"
          ],
          [
            "ScienceHouse",
            "390",
            "999",
            "secondYear"
          ],
          [
            "ScienceHouse",
            "709",
            "100",
            "secondYear"
          ],
          [
            "ScienceHouse",
            "771",
            "100",
            "secondYear"
          ],
          [
            "SeedShop",
            "472",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "473",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "474",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "475",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "427",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "429",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "477",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "480",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "482",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "483",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "484",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "479",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "302",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "453",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "455",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "487",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "488",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "490",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "299",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "301",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "492",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "491",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "493",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "425",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "472",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "473",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "474",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "475",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "427",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "429",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "477",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "476",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "480",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "482",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "483",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "484",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "479",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "302",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "453",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "455",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "485",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "487",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "488",
            "50",
            "secondYear
          ],
          [
            "SeedShop",
            "490",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "299",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "301",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "492",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "491",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "493",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "425",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "489",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "494",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "494",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "478",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "478",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "486",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "486",
            "50",
            "secondYear"
          ],
          [
            "SeedShop",
            "745",
            "10",
            "!secondYear"
          ],
          [
            "SeedShop",
            "745",
            "50",
            "secondYear"
          ]
        ]
      }
       
      • Entoarox

        Entoarox Oxygen Tank

        You are missing a " on line 312, I suggest you check your JSON at http://jsonlint.com/ before using it, because its so much, little mistakes like that are easy to miss :)
         
        • SasuraUchiha

          SasuraUchiha Cosmic Narwhal

          Oh, didn't know there was such a tool. Thanks!
           
          • SasuraUchiha

            SasuraUchiha Cosmic Narwhal

            Ok, now it works. Only thing is, the Strawberries seem to have no price... I could buy a stack of 50 for 0 gold... But other than that it works well now, thanks!
             
            • Entoarox

              Entoarox Oxygen Tank

              That is peculiar, I am using the getPrice() method for the object, that would mean strawberries dont have one :S
              Let me take a look at CA's code and see if that is a issue on my part or simply a weirdness in his code :p

              Edit: Strawberry seeds indeed do not have a sale price, I will edit my code to use a default price of 10 gold if the sale price is 0.
               
                Last edited: Apr 17, 2016
              • SasuraUchiha

                SasuraUchiha Cosmic Narwhal

                Well, the default price is 100g... But I think since you can only obtain them on the egg festival, it's written somewhere else in the code...
                 
                • Entoarox

                  Entoarox Oxygen Tank

                  Yes, the stardew valley vair event file does give it a price, unfortunately that price is not part of the item but part of the shop.

                  I could add the ability for a optional price/item to be added after the conditions string and simply make it so any items that have a `0` value cause a error in the log and then not add them...
                   
                  • SasuraUchiha

                    SasuraUchiha Cosmic Narwhal

                    Can't you just add the normal Event price manually? I don't have a clue about creating mods, so I don't know what's possible and what not... But if that is not possible, the option you stated is good, too.
                     
                    • Entoarox

                      Entoarox Oxygen Tank

                      Not without checking if someone is adding strawberry seeds every time a new object is loaded.
                      It isnt a massive overhead, but overhead still.
                      And it only deals with strawberry seeds, and those are not the only item with a 0 sale value.
                       
                      • SasuraUchiha

                        SasuraUchiha Cosmic Narwhal

                        Oh, ok. Yeah, than just go with the other option. Everyone knows how to use a calculator. xD
                         
                        • Entoarox

                          Entoarox Oxygen Tank

                          Actually, you wont need one, the price field will be the price for a single item, the code will automatically multiply it by how many items are in the stack for you :)

                          So all you'd need to do is set a price for the strawberry seeds (Say, 120 each, so that the 100 price during festival would be a discount) and the code will automatically multiply it by the given stack size :)
                           
                          • SasuraUchiha

                            SasuraUchiha Cosmic Narwhal

                            Ah ok. That's cool then! Then I will patiently wait for your to update it. <3
                             
                            • Sevardok

                              Sevardok Space Spelunker

                              Thanks a lot for this mod ! I've been looking for it since days !
                               
                              • Entoarox

                                Entoarox Oxygen Tank

                                No problem, it was a fun challenge :)
                                 
                                • Norfuer

                                  Norfuer Orbital Explorer

                                  Heyas! Does this include bait? I've got a bunch of automated crab pots that eat up three stacks a week, and it's getting tiresome buying 3000 bait in increments of 5. :3
                                   
                                    Androxilogin likes this.
                                  • Entoarox

                                    Entoarox Oxygen Tank

                                    You can easily whitelist willy's shop and then add the bait yourself.
                                    The latest versions include a config to control what shops are selling new items, and what those items are :)
                                     
                                    • Norfuer

                                      Norfuer Orbital Explorer

                                      Awesome, I'll give it a shot then. Thankies! :3

                                      Took me a few tries to get the config right, but it works, and it's awesome! Thank you! :D
                                       
                                        Last edited: Apr 29, 2016
                                      • Ordaeanu

                                        Ordaeanu Poptop Tamer

                                        Cant get this to work.Im trying to add a 99 stack of bait to the fish shop but it wont appear.I tried all kind of conditions and even tried adding it to the seedshop and science house but it wont show up.

                                        Here is my config file


                                        {
                                        "debugMode": true,
                                        "shops": [
                                        "ScienceHouse",
                                        "SeedShop",
                                        "FishShop"
                                        ],
                                        "objects": [
                                        [
                                        "ScienceHouse",
                                        "388",
                                        "111",
                                        "!earthquake"
                                        ],
                                        [
                                        "ScienceHouse",
                                        "390",
                                        "111",
                                        "!earthquake"
                                        ],
                                        [
                                        "ScienceHouse",
                                        "388",
                                        "333",
                                        "!secondYear,earthquake"
                                        ],
                                        [
                                        "ScienceHouse",
                                        "390",
                                        "333",
                                        "!secondYear,earthquake"
                                        ],
                                        [
                                        "ScienceHouse",
                                        "388",
                                        "999",
                                        "secondYear"
                                        ],
                                        [
                                        "ScienceHouse",
                                        "390",
                                        "999",
                                        "secondYear"
                                        ],
                                        [
                                        "ScienceHouse",
                                        "709",
                                        "50",
                                        "secondYear"
                                        ],
                                        [
                                        "ScienceHouse",
                                        "771",
                                        "111",
                                        "secondYear"
                                        ],
                                        [
                                        "SeedShop",
                                        "472",
                                        "10",
                                        "!secondYear,spring"
                                        ],
                                        [
                                        "SeedShop",
                                        "473",
                                        "10",
                                        "!secondYear,spring"
                                        ],
                                        [
                                        "SeedShop",
                                        "474",
                                        "10",
                                        "!secondYear,spring"
                                        ],
                                        [
                                        "SeedShop",
                                        "475",
                                        "10",
                                        "!secondYear,spring"
                                        ],
                                        [
                                        "SeedShop",
                                        "427",
                                        "10",
                                        "!secondYear,spring"
                                        ],
                                        [
                                        "SeedShop",
                                        "429",
                                        "10",
                                        "!secondYear,spring"
                                        ],
                                        [
                                        "SeedShop",
                                        "477",
                                        "10",
                                        "!secondYear,spring"
                                        ],
                                        [
                                        "SeedShop",
                                        "480",
                                        "10",
                                        "!secondYear,summer"
                                        ],
                                        [
                                        "SeedShop",
                                        "482",
                                        "10",
                                        "!secondYear,summer"
                                        ],
                                        [
                                        "SeedShop",
                                        "483",
                                        "10",
                                        "!secondYear,summer"
                                        ],
                                        [
                                        "SeedShop",
                                        "484",
                                        "10",
                                        "!secondYear,summer"
                                        ],
                                        [
                                        "SeedShop",
                                        "479",
                                        "10",
                                        "!secondYear,summer"
                                        ],
                                        [
                                        "SeedShop",
                                        "302",
                                        "10",
                                        "!secondYear,summer"
                                        ],
                                        [
                                        "SeedShop",
                                        "453",
                                        "10",
                                        "!secondYear,summer"
                                        ],
                                        [
                                        "SeedShop",
                                        "455",
                                        "10",
                                        "!secondYear,summer"
                                        ],
                                        [
                                        "SeedShop",
                                        "487",
                                        "10",
                                        "!secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "488",
                                        "10",
                                        "!secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "490",
                                        "10",
                                        "!secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "299",
                                        "10",
                                        "!secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "301",
                                        "10",
                                        "!secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "492",
                                        "10",
                                        "!secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "491",
                                        "10",
                                        "!secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "493",
                                        "10",
                                        "!secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "425",
                                        "10",
                                        "!secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "472",
                                        "50",
                                        "secondYear,spring"
                                        ],
                                        [
                                        "SeedShop",
                                        "473",
                                        "50",
                                        "secondYear,spring"
                                        ],
                                        [
                                        "SeedShop",
                                        "474",
                                        "50",
                                        "secondYear,spring"
                                        ],
                                        [
                                        "SeedShop",
                                        "475",
                                        "50",
                                        "secondYear,spring"
                                        ],
                                        [
                                        "SeedShop",
                                        "427",
                                        "50",
                                        "secondYear,spring"
                                        ],
                                        [
                                        "SeedShop",
                                        "429",
                                        "50",
                                        "secondYear,spring"
                                        ],
                                        [
                                        "SeedShop",
                                        "477",
                                        "50",
                                        "secondYear,spring"
                                        ],
                                        [
                                        "SeedShop",
                                        "476",
                                        "50",
                                        "secondYear,spring"
                                        ],
                                        [
                                        "SeedShop",
                                        "480",
                                        "50",
                                        "secondYear,summer"
                                        ],
                                        [
                                        "SeedShop",
                                        "482",
                                        "50",
                                        "secondYear,summer"
                                        ],
                                        [
                                        "SeedShop",
                                        "483",
                                        "50",
                                        "secondYear,summer"
                                        ],
                                        [
                                        "SeedShop",
                                        "484",
                                        "50",
                                        "secondYear,summer"
                                        ],
                                        [
                                        "SeedShop",
                                        "479",
                                        "50",
                                        "secondYear,summer"
                                        ],
                                        [
                                        "SeedShop",
                                        "302",
                                        "50",
                                        "secondYear,summer"
                                        ],
                                        [
                                        "SeedShop",
                                        "453",
                                        "50",
                                        "secondYear,summer"
                                        ],
                                        [
                                        "SeedShop",
                                        "455",
                                        "50",
                                        "secondYear,summer"
                                        ],
                                        [
                                        "SeedShop",
                                        "485",
                                        "50",
                                        "secondYear,summer"
                                        ],
                                        [
                                        "SeedShop",
                                        "487",
                                        "50",
                                        "secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "488",
                                        "50",
                                        "secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "490",
                                        "50",
                                        "secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "299",
                                        "50",
                                        "secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "301",
                                        "50",
                                        "secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "492",
                                        "50",
                                        "secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "491",
                                        "50",
                                        "secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "493",
                                        "50",
                                        "secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "425",
                                        "50",
                                        "secondYear,fall"
                                        ],
                                        [
                                        "SeedShop",
                                        "489",
                                        "50",
                                        "secondYear,fall"
                                        ],
                                        [
                                        "FishShop",
                                        "685",
                                        "99",
                                        "!wednesday"
                                        ]
                                        ]
                                        }
                                         
                                        • Norfuer

                                          Norfuer Orbital Explorer

                                          Hmm... looks fine to me, from what I can tell. It might be your SMAPI or version of Stardew Valley. I've got bait stacks and bug meat just fine.
                                           

                                          Share This Page