RELEASED [SMAPI 0.40+] Chest Pooling/ GateOpener/ ToolCharging

Discussion in 'Gameplay Mechanics' started by mralbobo, Mar 29, 2016.

  1. mralbobo

    mralbobo Scruffy Nerf-Herder

    Chest Pooling
    Basically what it does is provide a means of pooling all of your individual chests together when depositing. So for example you can return from mining, walk up to a single chest, throw in everything. The mod will then for example move the minerals to the mineral chest, the ore and bars to their chest, the food items to the food chest, etc. It essentially keys off of where your existing items are and adds additional items to existing stacks. It should also be noted that the mod should not take effect when moving less then a full stack (right click), this allows you to effectively override the mods auto-sorting at will.



    preview.gif


    In slightly more detail:
    • item added to chest, if there's an existing stack or the item does not exist in another chest (or all the other stacks are full), it's added normally.
    • if the item exists in another chest and there's room for it, it gets moved to the other chest
    • if there's only partial room the stack gets split and whatever overflows stays in the current chest
    Seems basically stable at this point.

    Download: https://github.com/mralbobo/stardew-chest-pooling/releases
    Github: https://github.com/mralbobo/stardew-chest-pooling


    It's worth noting that the SMAPI version speced is not necessarily required, it's just the version I happened to build it with.
    1.4 - mac support
    1.3better - smapi 1.9
    1.2.0 (SMAPI 0.40.x) - sdv 1.1 support
    1.1.1-acatest ( (SMAPI 0.39.6) - support for http://community.playstarbound.com/threads/access-chest-anywhere-smapi-0-40-0.112555/
    1.1.1 (SMAPI 0.39.6) - add "IGNORED" support
    1.1 (SMAPI 0.39.2) - everything works
    1.0 (SMAPI 0.39.2) - first (has broken indoor chests and no fridge)


    GateOpener
    It opens gates when you're near them, closes them when you get further away.

    Download: https://github.com/mralbobo/stardew-gate-opener/releases
    Github: https://github.com/mralbobo/stardew-gate-opener


    1.1 - fixed (added) sound
    1.0 - first


    ToolCharging

    Increases the rate at which tools charge when your using them.
    Has a config for once. Can set IncreaseBy to something in the range of -15 to 599. Where -15 is painfully slow, and 599 is effectively instant. It defaults to 40 which is roughly 3x the default rate.

    Download: https://github.com/mralbobo/stardew-tool-charging/releases
    Github: https://github.com/mralbobo/stardew-tool-charging
     
      Last edited: Nov 28, 2018
      Leyana, Exiom, cch413 and 31 others like this.
    • Harunan

      Harunan Void-Bound Voyager

      If this work, it'll be awesome, will test it soon!
      Thanks alot
       
      • Cardinite

        Cardinite Industrial Terraformer

        Seems to work perfectly for me, I have 18 storage chests and one "auto" chest by the entrance that I deposit everything into in my farm cave (specifically the extended farm cave mod) . Checked with each category and new items automatically sort into the correct chest every time. Great mod, thanks for this!
         
          dsrules likes this.
        • Harunan

          Harunan Void-Bound Voyager

          Yes it works great, thanks for this mod.
           
          • dem0z

            dem0z Star Wrangler

            great work this really saves a lot of time, but just wondering if it is possible to make so that there is only one specific chest for auto sorting that the sorting only works on and rest of the chests in-game are not affected by the sorting, meaning everything is just tied to this one chest and that chest only.

            Just an idea :D
             
            • mralbobo

              mralbobo Scruffy Nerf-Herder

              Biggest problem with something like that is figuring out how you designate that one chest as "special" since as far as I've been able to tell chests have nothing that uniquely identifies them. They "might", be sorted by the game in the order they were created, but that feels a little too fragile for my taste.

              My original plan for this was actually to have the chests connected based on proximity, with the intent that placing a bunch of chests beside each other would allow to create as large or as many pooled chests as you wanted. But eh, connecting all* of them was easier and frankly I think I prefer it.

              Pushed a 1.1 release, fixes chests inside constructed buildings, and connects the fridge.
               
                Last edited: Mar 31, 2016
              • Athemoe

                Athemoe Void-Bound Voyager

                This mod somehow makes my game crash whenever I try to load my savefile, do you think it might be in conflict with another mod I'm using?
                 
                • mralbobo

                  mralbobo Scruffy Nerf-Herder

                  Possibly, what's your list of mods?
                   
                  • Athemoe

                    Athemoe Void-Bound Voyager

                    Portrait mod and one that labels chests. I removed the label mod but my game still crashes when I use this mod :/
                     
                    • mralbobo

                      mralbobo Scruffy Nerf-Herder

                      Went and tried the labels mod (orspeeders specifically), worked fine, and I'm assuming portrait mod is just one of the various portrait replacement things. Which I can't imagine would screw up something like this... Feel free to try a "clean" test though.

                      Only things I can think of are that you're using some other version of smapi, for some reason your system doesn't like the debug dll 1.0 is (in which case try 1.1). Or this somehow pushed your system over the edge in terms of complexity...

                      Some various fringe cases I didn't test, if any of these sound accurate let me know...
                      - you have no chests
                      - starting a new game
                      - what including the fridge does before you have access to a fridge

                      Suppose you could also try sending me your save and I could see if it launches on my system. That's about all I've got.
                       
                      • tandpastatester

                        tandpastatester Scruffy Nerf-Herder

                        If all of the above doesnt work a clean reinstall might be worth a try as well.
                         
                        • stunvn

                          stunvn Void-Bound Voyager

                          Any picture please?
                           
                          • ThatNorthernMonkey

                            ThatNorthernMonkey Aquatic Astronaut

                            Each chest has it's own place in the world that makes it unique, i've mostly gone by the boundingBox! You could even create a tracking class that saves the boundingBox and your own unique identifying system and serialise it to disk. Might be a bit much though when the combination of Location.Name + (Chest.boundingBox.x + Chest.boundingBox.y) is a unique identifier in itself :)
                             
                            • tandpastatester

                              tandpastatester Scruffy Nerf-Herder

                              Took me less than a minute to become so dependent on this mod that I can't imagine playing this game without it anymore. Good job OP, this is exactly what I needed.

                              On a sidenote, I also used the SmartMod for the 'quick stash' hotkey that automatically moved items from your inventory into a chest when there is an existing stack for it inside. I was hoping these two mods to be compatible with each other, because that means I would be able to push everything into their right chests with the press of a button. Unfortunately, pressing the quick stash key does nothing when your mod is active.

                              Is this a big compatibility issue or would a simple fix be enough to use them both?
                               
                              • Cardinite

                                Cardinite Industrial Terraformer

                                I think it's based on an entire stack being emptied into the chest. I believe you can create a new stack in any chest using right click to override the pooling mod. Seems to be the reason why CJB's Automation mod doesn't automatically sort to existing stacks in other chests.
                                 
                                • OrSpeeder

                                  OrSpeeder Phantasmal Quasar

                                  OP, if you want you can add support for my chest label mod, you don't even need to reference my mod directly, just use chest name variable (that defaults to "chest", but my mod allow you to put whatever you want).

                                  So you can loop through all chests, detect ones with certain names, and use those.
                                   
                                    MayaMayhem, Borodin and zyymurgy like this.
                                  • mralbobo

                                    mralbobo Scruffy Nerf-Herder

                                    In retrospect I probably should have realized that...thanks
                                    Eh, if there's enough interest I could look into it. Can't say the feature that requires that is something I personally have any interest in.

                                    Not sure what SmartMod is, shoot me a link and I can look into it.

                                    As far as the theories go, I'm keying off of the player inventory changed event (whatever it's actually called), and ignoring any event where an entire stack isn't removed (both out of laziness and performance). So basically if the thing your doing doesn't involve an item being entirely removed from the players inventory no pooling. Of course if any of the modders here know of a better event, I could probably use that instead (doesn't really seem worth polluting update).

                                    Support in what sense? As far as I'm aware everything works when both are enabled.
                                     
                                    • OrSpeeder

                                      OrSpeeder Phantasmal Quasar

                                      I mean deliberately explaining to people they can give special names to chests, so you can find the chests by name (instead of finding by stack!)
                                       
                                      • tandpastatester

                                        tandpastatester Scruffy Nerf-Herder

                                        No problem, here's a link to the SmartMod I'm talking about.

                                        The most useful feature offered by this mod is the Quick Stash command (default TAB ). When interacting with a chest, this allows you to transfer all your backpack items into the chest if it contains a corresponding stack of the same item. A feature I use a lot because it saves a lot of time.

                                        It still requires the player to open every chest though, which is exactly the frustration for which your Chest Pooling mod offers a nice solution.

                                        Being able to benefit from both advantages would be the ultimate form of inventory management. Then all it takes is pressing one button to move all items into the corresponding chest. However, as you're saying, you both might address a different mechanic at the moment making the synergy more complicated. But since your mod is already capable of moving items onto corresponding stashes, wouldn't it be possible to add some kind of 'transfer all' command to your mod?
                                         
                                          Borodin likes this.
                                        • mralbobo

                                          mralbobo Scruffy Nerf-Herder

                                          Did some testing there, got a pretty good read on what's happening. Smartmod, on hitting tab is doing a check of the current chest, if it sees the same item, it removes the item from the inventory, and adds it to the chest. My mod watches for removes from the inventory, and re-positions items.

                                          So...his remove isn't happening because my "scan all chests" code isn't being used. And my post-delete sorting isn't running because his remove didn't run. Not really a good way to coordinate the two without literally coordinating the two. So...kind of a non-starter.
                                          Thinking about it...I'm moderately curious exactly what would happen if I just... "replaced" the open chest's entire item list with my own calculated version.

                                          Interestingly, that does work and results in a chest containing the items of every other chest, where they are literally the same item. Like... modifying one modifies the other. With some better events I might be able to work with that and be able to effectively hand off the list of all items fairly seamlessly to other mods... Eh, we'll see what the impending "new" smapi throws out this week.
                                           
                                            Last edited: Apr 1, 2016
                                            tandpastatester likes this.

                                          Share This Page