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

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

  1. ericling

    ericling Intergalactic Tourist

    Thanks for the mod, but could you fix the 999 Stones price at its original price? Feels like cheating when buying 999 stones at 9990g instead of 19980g.
     
    • Entoarox

      Entoarox Oxygen Tank

      That has already been fixed, the price of stacks is multiplied by the original price of the item, the screenshot is simply from before that was fixed. :p
       
      • ericling

        ericling Intergalactic Tourist

        It is still 9990g for 999stones in version 1.3.
         
        • Entoarox

          Entoarox Oxygen Tank

          I checked my code, looks like I got some conditions reversed when checking for items with a sale price of `0` causing all items to be assigned a fixed sale price of `10`.

          Unfortunately, I am in the middle of a rather large change to how shops are identified, meaning that I cannot simply release a patch immediately.
           
          • scrptrx

            scrptrx Void-Bound Voyager

            darn, I rather liked being able to cheat Pierre out of his money by buying stacks of seeds at one price and selling it right back at an inflated price. ;) ;) ;) ;)

            (okay, but really, it's better to be fixed lol)
             
            • Ookami96k

              Ookami96k Guest

              is this still compatible with 1.1?
               
              • Entoarox

                Entoarox Oxygen Tank

                Since nobody has told me of any issues I have to assume so? Especially since this mod does not use any features that 1.1 is known to have broken.
                 
                • Swadius

                  Swadius Scruffy Nerf-Herder

                  Causes the game to crash from what I know. Though that was when I was testing to see which mods work, so I might want to give it another try to confirm.
                   
                  • Soo-

                    Soo- Space Spelunker

                    does not work with SMAPI 0.40.1.1-3..
                    You have no problem?
                     
                    • eLe

                      eLe Scruffy Nerf-Herder

                      It works for me in [...].1-3???
                      upload_2016-11-5_21-37-9.png
                       
                      • Ichimatsu

                        Ichimatsu Pangalactic Porcupine

                        after holding down right click for eons in order to buy 999 of wood at robin's I missclicked and sold the whole thing. Twice. Good thing I remembered about this mod! Was about to throw the laptop out the window :D
                         
                          EpicAdventure likes this.
                        • fudge5962

                          fudge5962 Phantasmal Quasar

                          So, out of curiosity, how do you go about accessing and editing shop inventories? Have been wanting to figure this out for myself. I want to change shops to make it easier to follow a specific playstyle (all vegan farm, sheep farmer, gardener, etc.) while still having access to everything you need to progress. Trying to decide if it would be better to learn how to do this myself and create a standalone mod, or to download your mod and make a custom config file for it.
                           
                          • Entoarox

                            Entoarox Oxygen Tank

                            The config is quite easy to work with, just download the mod and run it once to let the default config generate, then you can look at it and see that it works pretty easily :)
                             
                            • fudge5962

                              fudge5962 Phantasmal Quasar

                              Hey, thanks for the quick reply! I got your mod and I'm sure it will be perfect for what I need. I am having a problem though.

                              I notice in order to add something to the shop, you need to add the shop to the list via a location name. I don't know where to find these location names, so the only ones I know are the "SeedShop" and "ScienceHouse" which I'm guessing are Pierre and Robin. Is there a list of the other location names somewhere on the forum?

                              Edit: Got a list off of the Discord Server. Thanks a lot to Bouhm!!
                               
                                Last edited: Nov 16, 2016
                              • fudge5962

                                fudge5962 Phantasmal Quasar

                                So, I just made a config file, and when I go to load it up I get an error. When I try to go to one of my modded shops it crashes. Here is the error:


                                Created log instance
                                [11:27:08.991 PM] SDV Version: 1.11
                                [11:27:08.991 PM] SMAPI Version: 0.40.0 1.1-3
                                [11:27:08.991 PM] Validating api paths...
                                [11:27:08.995 PM] Initializing SDV Assembly...
                                [11:27:08.995 PM] Injecting New SDV Version...
                                [11:27:08.995 PM] Starting SDV...
                                [11:27:09.058 PM] Patching SDV Graphics Profile...
                                [11:27:09.060 PM] LOADING MODS
                                [11:27:09.060 PM] Found Manifest: D:\SteamLibrary\steamapps\common\Stardew Valley\Mods\NPCMapLocations\manifest.json
                                [11:27:09.258 PM] Created psconfigs directory @D:\SteamLibrary\steamapps\common\Stardew Valley\Mods\NPCMapLocations\psconfigs
                                [11:27:09.259 PM] Loading Mod DLL...
                                [11:27:09.260 PM] LOADED MOD: NPC Map Locations Mod by Bouhm - Version StardewModdingAPI.Version | Description: Shows NPC locations on the map (@ D:\SteamLibrary\steamapps\common\Stardew Valley\Mods\NPCMapLocations\NPCMapLocations.dll)
                                [11:27:09.305 PM] Found Manifest: D:\SteamLibrary\steamapps\common\Stardew Valley\Mods\ShopExpander\manifest.json
                                [11:27:09.314 PM] Created psconfigs directory @D:\SteamLibrary\steamapps\common\Stardew Valley\Mods\ShopExpander\psconfigs
                                [11:27:09.315 PM] Loading Mod DLL...
                                [11:27:09.315 PM] LOADED MOD: Shop Expander by Entoarox - Version StardewModdingAPI.Version | Description: Adds bulk options for wood & stone to the carpenter. (@ D:\SteamLibrary\steamapps\common\Stardew Valley\Mods\ShopExpander\ShopExpander.dll)
                                [11:27:09.338 PM] Found Manifest: D:\SteamLibrary\steamapps\common\Stardew Valley\Mods\StardewCJB\manifest.json
                                [11:27:09.346 PM] Created psconfigs directory @D:\SteamLibrary\steamapps\common\Stardew Valley\Mods\StardewCJB\psconfigs
                                [11:27:09.347 PM] Loading Mod DLL...
                                [11:27:09.347 PM] LOADED MOD: CJB Show Item Sell Price by CJ Bok - Version StardewModdingAPI.Version | Description: Show item sell price in your inventory! (@ D:\SteamLibrary\steamapps\common\Stardew Valley\Mods\StardewCJB\StardewCJB.dll)
                                [11:27:09.347 PM] Found Manifest: D:\SteamLibrary\steamapps\common\Stardew Valley\Mods\TimeSpeed\manifest.json
                                [11:27:09.357 PM] Created psconfigs directory @D:\SteamLibrary\steamapps\common\Stardew Valley\Mods\TimeSpeed\psconfigs
                                [11:27:09.358 PM] Loading Mod DLL...
                                [11:27:09.358 PM] LOADED MOD: TimeSpeed Mod by cantorsdust and Syndlig - Version StardewModdingAPI.Version | Description: Allows for a configurable ten minute tick length. (@ D:\SteamLibrary\steamapps\common\Stardew Valley\Mods\TimeSpeed\TimeSpeed.dll)
                                TimeSpeed Has Loaded
                                [11:27:09.369 PM] Found Manifest: D:\SteamLibrary\steamapps\common\Stardew Valley\Mods\TrainerMod\manifest.json
                                [11:27:09.378 PM] Created psconfigs directory @D:\SteamLibrary\steamapps\common\Stardew Valley\Mods\TrainerMod\psconfigs
                                [11:27:09.379 PM] Loading Mod DLL...
                                [11:27:09.383 PM] Registered command: show
                                [11:27:09.384 PM] Registered command: save
                                [11:27:09.384 PM] Registered command: load
                                [11:27:09.384 PM] Registered command: exit
                                [11:27:09.384 PM] Registered command: stop
                                [11:27:09.385 PM] Registered command: player_setname
                                [11:27:09.385 PM] Registered command: player_setmoney
                                [11:27:09.385 PM] Registered command: player_setstamina
                                [11:27:09.383 PM] Registered command: hide
                                [11:27:09.386 PM] Registered command: player_setmaxstamina
                                [11:27:09.391 PM] Registered command: player_setimmunity
                                [11:27:09.391 PM] Registered command: player_setlevel
                                [11:27:09.392 PM] Registered command: player_setspeed
                                [11:27:09.392 PM] Registered command: player_changecolour
                                [11:27:09.392 PM] Registered command: player_changestyle
                                [11:27:09.393 PM] Registered command: player_additem
                                [11:27:09.393 PM] Registered command: player_addmelee
                                [11:27:09.393 PM] Registered command: player_addring
                                [11:27:09.393 PM] Registered command: out_items
                                [11:27:09.394 PM] Registered command: out_melee
                                [11:27:09.394 PM] Registered command: out_rings
                                [11:27:09.379 PM] LOADED MOD: Trainer Mod by Zoryn - Version StardewModdingAPI.Version | Description: Registers several commands to use. Most commands are trainer-like in that they offer forms of cheating. (@ D:\SteamLibrary\steamapps\common\Stardew Valley\Mods\TrainerMod\TrainerMod.dll)
                                [11:27:09.395 PM] Registered command: world_settime
                                [11:27:09.395 PM] Registered command: world_freezetime
                                [11:27:09.396 PM] Registered command: world_setday
                                [11:27:09.396 PM] Registered command: world_setseason
                                [11:27:09.396 PM] Registered command: world_downminelevel
                                [11:27:09.396 PM] Registered command: world_setminelevel
                                [11:27:09.397 PM] LOADED 5 MODS
                                [11:27:09.386 PM] Registered command: player_sethealth
                                [11:27:09.400 PM] Initializing Console Input Thread...
                                [11:27:09.400 PM] Registered command: help
                                [11:27:09.401 PM] Applying Final SDV Tweaks...
                                [11:27:09.386 PM] Registered command: player_setmaxhealth
                                [11:27:09.394 PM] Registered command: newitem
                                [11:27:09.397 PM] SDV Loaded Into Memory
                                [11:27:09.381 PM] Registered command: types
                                [11:27:09.481 PM] XNA Initialize
                                [11:27:09.484 PM] XNA LoadContent
                                [11:27:09.648 PM] [ShopExpander/INFO] Object registered: 12 Egg:176@SeedShop[83,12]#!tuesday,!thursday,!sunday
                                [11:27:09.649 PM] [ShopExpander/ERROR] Object failed to generate: System.Collections.Generic.List`1[System.String], The error message follows below
                                [11:27:09.648 PM] [ShopExpander/INFO] Object registered: 12 Egg:180@SeedShop[83,12]#!monday,!friday,!saturday
                                [11:27:09.648 PM] [ShopExpander/INFO] Object registered: 6 Large Egg:174@SeedShop[166,6]#!tuesday,!thursday,!sunday
                                [11:27:09.656 PM] [ShopExpander/INFO] Object registered: 1 Milk:184@SeedShop[999,1]#
                                [11:27:09.656 PM] [ShopExpander/INFO] Object registered: 3 Large Milk:186@SeedShop[333,3]#sunday
                                [11:27:09.657 PM] [ShopExpander/INFO] Object registered: 1 Potato:192@SeedShop[999,1]#
                                [11:27:09.657 PM] [ShopExpander/INFO] Object registered: 1 Corn:270@SeedShop[999,1]#
                                [11:27:09.657 PM] [ShopExpander/INFO] Object registered: 1 Egg:176@AnimalShop[999,1]#
                                [11:27:09.658 PM] [ShopExpander/INFO] Object registered: 1 Large Egg:174@AnimalShop[999,1]#
                                [11:27:09.659 PM] [ShopExpander/INFO] Object registered: 1 Egg:180@AnimalShop[999,1]#
                                [11:27:09.659 PM] [ShopExpander/ERROR] Object failed to generate: System.Collections.Generic.List`1[System.String], The error message follows below
                                [11:27:09.659 PM] [ShopExpander/ERROR] ThrowArgumentException:An item with the same key has already been added.
                                at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
                                at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
                                at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
                                at Entoarox.ShopExpander.ShopExpander.generateObject(String location, Int32 replacement, Int32 stackAmount, String requirements)
                                at Entoarox.ShopExpander.ShopExpander.Event_LoadContent(Object sender, EventArgs e)
                                [11:27:09.660 PM] [ShopExpander/INFO] Object registered: 1 Large Egg:182@AnimalShop[999,1]#
                                [11:27:09.660 PM] [ShopExpander/ERROR] Object failed to generate: System.Collections.Generic.List`1[System.String], The error message follows below
                                [11:27:09.651 PM] [ShopExpander/INFO] Object registered: 6 Large Egg:182@SeedShop[166,6]#!monday,!friday,!saturday
                                [11:27:09.661 PM] [ShopExpander/INFO] Object registered: 1 Milk:184@AnimalShop[999,1]#
                                [11:27:09.661 PM] [ShopExpander/ERROR] Object failed to generate: System.Collections.Generic.List`1[System.String], The error message follows below
                                [11:27:09.662 PM] [ShopExpander/ERROR] ThrowArgumentException:An item with the same key has already been added.
                                at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
                                at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
                                at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
                                at Entoarox.ShopExpander.ShopExpander.generateObject(String location, Int32 replacement, Int32 stackAmount, String requirements)
                                at Entoarox.ShopExpander.ShopExpander.Event_LoadContent(Object sender, EventArgs e)
                                [11:27:09.662 PM] [ShopExpander/INFO] Object registered: 1 Large Milk:186@AnimalShop[999,1]#
                                [11:27:09.663 PM] [ShopExpander/INFO] Object registered: 1 Wool:440@AnimalShop[999,1]#
                                [11:27:09.663 PM] [ShopExpander/INFO] Object registered: 1 Goat Milk:436@AnimalShop[999,1]#
                                [11:27:09.663 PM] [ShopExpander/INFO] Object registered: 1 L. Goat Milk:438@AnimalShop[999,1]#
                                [11:27:09.664 PM] Initializing Debug Assets...
                                [11:27:09.656 PM] [ShopExpander/ERROR] ThrowArgumentException:An item with the same key has already been added.
                                at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
                                at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
                                at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
                                at Entoarox.ShopExpander.ShopExpander.generateObject(String location, Int32 replacement, Int32 stackAmount, String requirements)
                                at Entoarox.ShopExpander.ShopExpander.Event_LoadContent(Object sender, EventArgs e)
                                [11:27:09.651 PM] [ShopExpander/ERROR] Object failed to generate: System.Collections.Generic.List`1[System.String], The error message follows below
                                [11:27:09.661 PM] [ShopExpander/ERROR] ThrowArgumentException:An item with the same key has already been added.
                                at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
                                at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
                                at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
                                at Entoarox.ShopExpander.ShopExpander.generateObject(String location, Int32 replacement, Int32 stackAmount, String requirements)
                                at Entoarox.ShopExpander.ShopExpander.Event_LoadContent(Object sender, EventArgs e)
                                [11:27:09.651 PM] [ShopExpander/ERROR] ThrowArgumentException:An item with the same key has already been added.
                                at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
                                at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
                                at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
                                at Entoarox.ShopExpander.ShopExpander.generateObject(String location, Int32 replacement, Int32 stackAmount, String requirements)
                                at Entoarox.ShopExpander.ShopExpander.Event_LoadContent(Object sender, EventArgs e)
                                Setting breakpad minidump AppID = 413150
                                Steam_SetMinidumpSteamID: Caching Steam ID: 76561198288911006 [API loaded no]
                                [11:27:10.262 PM] Game Loaded
                                [11:27:10.262 PM] Type 'help' for help, or 'help <cmd>' for a command's usage


                                Here is a dump of my config file:


                                {
                                "debugMode": true,
                                "shops": [
                                "AnimalShop",
                                "ScienceHouse",
                                "SeedShop"
                                ],
                                "objects": [
                                [
                                "SeedShop",
                                "176",
                                "12",
                                "!tuesday,!thursday,!sunday"
                                ],
                                [
                                "SeedShop",
                                "174",
                                "6",
                                "!tuesday,!thursday,!sunday"
                                ],
                                [
                                "SeedShop",
                                "180",
                                "12",
                                "!monday,!friday,!saturday"
                                ],
                                [
                                "SeedShop",
                                "182",
                                "6",
                                "!monday,!friday,!saturday"
                                ],
                                [
                                "SeedShop",
                                "184",
                                "1",
                                ""
                                ],
                                [
                                "SeedShop",
                                "186",
                                "3",
                                "sunday"
                                ],
                                [
                                "SeedShop",
                                "192",
                                "1",
                                ""
                                ],
                                [
                                "SeedShop",
                                "270",
                                "1",
                                ""
                                ],
                                [
                                "AnimalShop",
                                "176",
                                "1",
                                ""
                                ],
                                [
                                "AnimalShop",
                                "174",
                                "1",
                                ""
                                ],
                                [
                                "AnimalShop",
                                "180",
                                "1",
                                ""
                                ],
                                [
                                "AnimalShop",
                                "182",
                                "1",
                                ""
                                ],
                                [
                                "AnimalShop",
                                "184",
                                "1",
                                ""
                                ],
                                [
                                "AnimalShop",
                                "186",
                                "1",
                                ""
                                ],
                                [
                                "AnimalShop",
                                "440",
                                "1",
                                ""
                                ],
                                [
                                "AnimalShop",
                                "436",
                                "1",
                                ""
                                ],
                                [
                                "AnimalShop",
                                "438",
                                "1",
                                ""
                                ]
                                ]
                                }


                                Not sure where I went wrong, but I was hoping somebody might be able to help out.
                                 
                                • stephanreiken

                                  stephanreiken Pangalactic Porcupine

                                  Based on the error, it looks like the way it works you cannot add the same item twice. So don't add Egg to both the animalshop and the seedshop or any other item and that should work.
                                   
                                  • Entoarox

                                    Entoarox Oxygen Tank

                                    No idea what is going on with the duplicate key error, but I do recall that the last released version does not work properly with single item stacks, I never got around to fixing that as few people use this for single-item stacks in the first place, and other mods have ended up taking priority :rofl:
                                     
                                    • fudge5962

                                      fudge5962 Phantasmal Quasar

                                      Seems like a simple fix. Will give it a shot.
                                      Well, that makes sense. [emoji23] I can use bigger stacks and that will probably fix it. This is just the only mod I know of that lets me edit shop inventories, so I'm kinda using it for my own purposes.

                                      Edit:It seems I have found the problem!!

                                      It looks like having no conditions in the conditions field will cause an error. So, you can't have the shops sell something under all circumstances (except Pierre's, because !wednesday won't affect him much).
                                       
                                        Last edited: Nov 16, 2016
                                      • Entoarox

                                        Entoarox Oxygen Tank

                                        Hmmm, that is weird and should not be happening, but the conditions system has undergone quite a lot of changes over time, and it has been a long time since SE's implementation of it was updated...
                                         
                                        • fudge5962

                                          fudge5962 Phantasmal Quasar

                                          Yeah, I thought it would accept a blank field, but after testing that was definitely the source of the crash. As stephanreikan mentioned earlier, you also can't add the same item twice, but the only real issue that could cause is that you can't add both brown and white eggs to shops. It will just default to whichever loads first.

                                          I'm curious about how you added a default price to unlisted items, and if there is a way to change it to something other than 10g.

                                          Sent from my Nexus 7 using Tapatalk
                                           

                                          Share This Page