tModLoader Bags of Holding

Discussion in 'Released' started by JPAN, Mar 14, 2017.

  1. JPAN

    JPAN Steampunker

    I've been sitting on this one for a while, but it's now complete (and hopefully bug free). Presenting:

    Bags of Holding
    This mod adds several new accessories that automatically collect certain items for you and place them in their unique specialized inventories that can hold up more than many times the amount of blocks in several Terraria large worlds (about 9 Quintilion pieces of each item).

    There are 10 base bags divided into three broad Categories: Mining, Nature and Fishing, with each category having a collective bag. There are also two special bags.

    There are three base bags and one collective bag:
    • DirtBag.png The Soil Bag collects common soil blocks such as:
      • Dirt, Snow, Mud and Clay
      • Silt and Slush
      • Sand and all its variants (corrupt-hallow, hardened and sandstone)
      • Stone and all its variants (corrupt-hallow, marble and granite)
      • Ice and all its variants (corrupt-hallow)
    • GemBag.png The Gem Bag collects vanilla Gems (Amethyst to Diamond)
    • OreBag.png The Ore Bag collects all vanilla ores (Copper to Chlorophyte, including Luminite)
    • OmniBag.png The Omni Bag collects all that the above three bags collect
    There are four base bags and one collective Bag:
    • PlantBag.png The Plant Bag collects all Alchemy plants and their seeds, Pumpkin and their seeds, Vine rope and coils and sunflowers
    • WoodBag.png The Wood Bag collects all Wood types (including Spooky Wood), Acorns and Cactus
    • DyeMaterialBag.png The Dye Material Bag collects all dye-making natural items (such as Blueberries, Red husks and Black ink) and Strange Plants
    • MushroomBag.png The Mushroom Bag collects all Mushrooms and all Grass Seeds
    • NatureBag.png Their collective bag is the Nature Bag

    There are three base bags and a collective bag:
    • FishBag.png The Fish Bag collects all fish you can catch in the game
    • CrateBag.png The Crate Bag collects all crates you can fish up
    • BaitBag.png The Bait Bag collects all vanilla bait and some modded bait (even the Truffle Worm)
    • FishingBag.png Their collective bag is the Fishing Bag

    Special Bags
    • CoinBag.png The Coin Bag is a special bag that automatically picks up any coins you find in your adventures, saving them even on death. It automatically compresses coins into larger denominations, and in the case you reach the 5 quintillion platinum, it will start storing coins as Gold, then as Silver and finally as Copper before running out of space. To use the coins, however, you need to store them in a Piggy bank/Safe/Defender's Forge, or retrieve them from the bag and carry them with you. Deposit them directly on one of the player banks by using the bag while your cursor is selecting the respective tile.
    • TrueOmniBag.png The True Omni Bag is the ultimate Item pick-up solution, capable of holding any item that is stackable (even modded ones). The only problem with using it is that finding the item you need inside it is very hard.

    Every base bag (and the Coin Bag) are currently crafted with 15 Silk and one Fallen Star at a Workshop. The Collective bags are crafted with their section's base bags and a Fallen Star at the Thinkerer's Workshop. The True Omni Bag is crafted with one of each collective bags and two Broken Hero Swords. Note: when crafting the collective Bags and the True Omni Bag, all material bags' contents will be lost; Empty them before crafting.

    Using the bags is easy. All you need to do is equip them in your regular accessory slot (does not work with Cheat sheet's extra slots or in the vanity slots even with Antisocial) and it starts collecting the items you pick up in the world. It will even pick them up when your regular inventory is full (Thanks to the TModloader crew for making that possible).

    To retrieve the items, you can either empty the whole bag in the ground by left-clicking with your cursor not on a containter, or empty the contents into a container by left-clicking in a closed chest when nobody is using it, piggy bank, safe or defender's forge or even one of the Storage Accesses from the Magic Storage Mod. However, the recommended way of accessing your items is not by dropping them on the floor but by placing the bag in your hotbar and right-clicking, which opens the Bag UI:
    Image 1: Gem Bag UI from a totally filled Gem Bag. Hover over the item to see the amount of that item stored in the bag.

    Image 2: Omni bag filled with all vanilla items, has a second page. Click on the green "Next page" Arrow to switch to the next page. Not Pictured, when on the second page +, click on the green "Previous page" arrow to return to the previous page.

    The UI is pretty similar to the Chest UI. With no item in hand, Left-click to withdraw the maximum possible item (max stack or what is left in the bag). With an item that can be collected by that bag in your hand, left-click in any slot (empty or otherwise) to deposit that item in the bag. With either no item in the hand or with already some of the desired item, right click to collect one of that item, and hold right click to keep withdrawing more, same as with stacked items in a regular chest. Shift-click in the bag's inventory item to quickly move max stack (or what is left in the bag) to your inventory directly. As of version 1.2, Shift-clicking in the inventory sends items to the bag, not the trash.

    This mod has some Cross-Mod compatibility. Ores from Thorium, Calamity, Crystillium, GRealm, and Spirit mod are supported, as well as soils from Thorium's Aquatic Depths biome, Crystillium's Crystal biome and Spirit mod Spirit biome. Tremor support will be added later, when I'm able to play the mod and check the ores and new soils.
    Note: Thorium's Life Quartz is a Gem, and fits in the Gem Bag.

    Adding to Bags of Holding

    The old, barely functional Call system has been removed in favor of the new (v1.4) Config System. Now, in order to add items to the bags, simply edit that bag's "order" list with new entries with the TagID format that is displayed under the item's tooltip if the "main.json" has "displayTagOnTooltip" enabled.

    I request of the community to keep expanding the items these bags can hold by registering new mod's items and pasting the resulting id's in this thread or in the Issue tracker here.

    Special thanks
    Chupsy - For the French translation

    Attached Files:

    Last edited: Apr 27, 2018
  2. Grim 2

    Grim 2 Terrarian

    Hey man this is great but one thing that might help is a mob bag basically a bag to hold basic non boss drops
  3. The_One

    The_One Terrarian

    Also allowing it to not be limited to only being active while in the accessories slot :)
  4. Le tromp du Jawa

    Le tromp du Jawa Eye of Cthulhu

    thats a huge pool if you have mods installed
  5. Smackydafrog

    Smackydafrog Terrarian

    Finally a bag mod that looks good.
  6. Chime

    Chime Skeletron Prime

    So! I just tried to use this. And uh...the second I pulled an ore out I got a massive spam in chat about a bunch of an error report in game? Is that normal?
  7. JPAN

    JPAN Steampunker

    It's the built in exception detector for this mod. Can you post the message so I can try and fix it?
  8. Chime

    Chime Skeletron Prime

    Well. I did my best to capture the text. To note this happens whenever I pull out an item and mouse over where it was it spams this in my chat. It goes away if I close out the ui and open it again.

  9. JPAN

    JPAN Steampunker

    This happens because of some changes made to the TagCompound that made it impossible to recognize null entries (entries that are no longer in the bag). Added some checks to prevent it from happening.

    V1.0.1 Changlog:
    - Added checks to bag UI to avoid Exceptions.

    Edit: V1.0.2 Changelog
    - Slight refactor that makes use of some new features of TagCompound.
    Last edited: Mar 15, 2017
  10. Jofairden

    Jofairden Golem

    Cool stuff ;) I like how you also add the possibility for others to add bags. Keep it up!
  11. rgon842

    rgon842 Skeletron Prime

    Question: Does having multiples of the same type of bag equipped create different storage "chests" for each bag, or do all items end up in the same place regardless?
  12. JPAN

    JPAN Steampunker

    Each individual bag has its own inventory.
  13. rgon842

    rgon842 Skeletron Prime

    Thanks for the reply. Does the order in which a bag gathers items depend on which accessory slot it is equipped in? (i.e. a bag equipped in the topmost slot will fill up first before another bag equipped on the second slot).
  14. JPAN

    JPAN Steampunker

    Yes. From topmost to lowest, including extra accessories from demon heart and (modded) heart of nature.
  15. rgon842

    rgon842 Skeletron Prime

    Awesome. Thanks for creating this mod, its very useful for avoiding a cluttered inventory (always keep extra bags in your piggy bank and a Money Trough handy). I added a couple of other bags that would handle some of the more common loot collected while exploring (arrows, plants, rope, etc.) which has helped avoid the back and forth to storage chests and so on.

    I did see that Terraria lags a little when a bag's UI is opened but its not much of an issue during gameplay; just wanted to bring it up in case its an unintended effect.
  16. DoktorDare

    DoktorDare Terrarian

    I love this concept, is it possible though to not use as equipped accessories? Similar to how Watches work while in the inventory? Or in a vanity slot?

    Also I use a controller as well as MaxStack+ (are there any issues with this?)
    I tested this briefly, however I don't think I got the hang of the controls for it.
    I had one gold ore, equipped my ore bag to accessory, dropped the gold ore on the ground and picked up, it went in the bag, I equipped the bag in hand and with left click/use the ore emptied and went into my inventory.
    Right clicking/action opened the bag as I held it but I wasn't able to move or select any items.
    I reread the directions after ward and it seems that I messed up by holding it as an item instead of accessory.

    Sorry for rambling I just got confused when I tried it the first time. I will try again later
  17. Meteorhead

    Meteorhead Skeletron Prime

    Can you make a bag of Holding that can take any type of item? A true bag of holding.
  18. DoktorDare

    DoktorDare Terrarian

    I got to play around some more of this crafted an Omni Bag and I really like it! I think i figured it out It's a space saver for sure! Thanks again for making this! :D
  19. Bluesphex

    Bluesphex Terrarian

    Getting this bug when picking up items.
    also when trying to open the UI for the bag it instantly closes.
  20. JPAN

    JPAN Steampunker

    Are you using the tModLoader? This mod uses features that were implemented there. From what I could see from the error message, it seems to not be finding the ContainsKey method from TagIO, which was added in 0.9.2