I didn't patch the menu's logic so the shipping bin menu still renders it as semi-transparent (the default logic that the game does for any non-shippable item in that menu), but you should be able to right-click it anyways
[Satchels] This mod failed in the GameLoop.UpdateTicked event. Technical details: ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index') at Satchels.SatchelMenu..ctor(Satchel satchel) in C:\Users\space\Programming\StardewValley\StardewValleyMods\Satchels\SatchelMenu.cs:line 52 at Satchels.Mod.GameLoop_UpdateTicked(Object sender, UpdateTickedEventArgs e) in C:\Users\space\Programming\StardewValley\StardewValleyMods\Satchels\Mod.cs:line 105 at StardewModdingAPI.Framework.Events.ManagedEvent`1.Raise(TEventArgs args) in SMAPI\Framework\Events\ManagedEvent.cs:line 101 [Satchels] This mod failed in the GameLoop.UpdateTicked event. Technical details: ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index') at Satchels.SatchelMenu..ctor(Satchel satchel) in C:\Users\space\Programming\StardewValley\StardewValleyMods\Satchels\SatchelMenu.cs:line 52 at Satchels.Mod.GameLoop_UpdateTicked(Object sender, UpdateTickedEventArgs e) in C:\Users\space\Programming\StardewValley\StardewValleyMods\Satchels\Mod.cs:line 105 at StardewModdingAPI.Framework.Events.ManagedEvent`1.Raise(TEventArgs args) in SMAPI\Framework\Events\ManagedEvent.cs:line 101
Some mod items seem to be unable to fit into the backpack... I don't know why, but a rose seed from Cornucopia - More Flowers, along with some fish and other similar items, is an issue that occurred after the 1.6 update
Has anyone noticed that some items in the bag won't be lost when crafting?
eg: If there is 1 Worm Bin in your bag after crafting an Deluxe Worm Bin and turning the crafting frame off and on again, you will see there is still 1 Worm Bin in there.
Huh, weird. It looks like the vanilla game code isn't reducing the item quantity when crafting if the last of the input item is consumed, so items inside bags never have their quantity reduced to 0. Seems like it's affecting all items, for example if I have 4 iron bars in a bag, and I craft iron fence 4 times, the first 3 iron bars are correctly consumed but the last one doesn't set quantity from 1 to 0. I don't think the game used to do that before the 1.6 update, very strange.
I'll see if I can come up with a fix.
For any other modders who are curious...
Spoiler:
Show
Decompile the game code for StardewValley.Item, and look at the Item.ConsumeStack(int amount) instance method:
public Item ConsumeStack(int amount) { if (amount == 0) { return this; } if (Stack - amount <= 0) { return null; } Stack -= amount; return this; }
Notice that the line Stack -= amount; does not execute if the amount parameter is >= the current Stack quantity. I haven't done much investigation yet but I'm assuming this unusual logic is the culprit for this bug in my mod's crafting logic.
EDIT: After more investigation, this does appear to be causing the issues. StardewValley.Menus.CraftingPage.clickCraftingRecipe invokes StardewValley.CraftingRecipe.consumeIngredients, which then calls StardewValley.Item.ConsumeStack (rather than calling IInventory.ReduceId). Then ConsumeStack doesn't reduce the Stack if the amount to consume is greater than or equal to the Item's current Stack amount. So when my mod attempts to update the quantities of items inside of bags after the crafting menu is closed, the quantities are incorrect.
Just wanted to say this mod is so enjoyable, every single time. From the excitement of getting a bag upgrade from a monster, to finally being able to stash away all sorts of stuff and feeling rewarded by obtaining the bags, to configuring the price of the massive bundle bag to be almost free because I can't play without it. Even with the new challenging bundles I play with, that include modded items, the wonderful bundle bag just automatically understands and lets me focus on filling it up.
Thank you so much, both for the mod in general, and also for keeping it so up to date! <3
Thank you so much! As a item hoarder, this is really a lifesaver. I have a question - is it possible to open the bags while you're in the shipping bin? I always have to go to my inventory, empty out the item bags until it's full, then go to the shipping bin and dump everything in there; if I have a lot of items in them, it can take a while with me having to go back and forth.
Is there also a way to quickstack items from the bags too?
Would love to see this mod become compatible with Better Crafting mod. Would be nice to be able to craft from my bags again while also being able to keep my better chests mod.
821 comments
Mine is still not letting me do that? It's still greyed out for me.
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at Satchels.SatchelMenu..ctor(Satchel satchel) in C:\Users\space\Programming\StardewValley\StardewValleyMods\Satchels\SatchelMenu.cs:line 52
at Satchels.Mod.GameLoop_UpdateTicked(Object sender, UpdateTickedEventArgs e) in C:\Users\space\Programming\StardewValley\StardewValleyMods\Satchels\Mod.cs:line 105
at StardewModdingAPI.Framework.Events.ManagedEvent`1.Raise(TEventArgs args) in SMAPI\Framework\Events\ManagedEvent.cs:line 101
[Satchels] This mod failed in the GameLoop.UpdateTicked event. Technical details:
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at Satchels.SatchelMenu..ctor(Satchel satchel) in C:\Users\space\Programming\StardewValley\StardewValleyMods\Satchels\SatchelMenu.cs:line 52
at Satchels.Mod.GameLoop_UpdateTicked(Object sender, UpdateTickedEventArgs e) in C:\Users\space\Programming\StardewValley\StardewValleyMods\Satchels\Mod.cs:line 105
at StardewModdingAPI.Framework.Events.ManagedEvent`1.Raise(TEventArgs args) in SMAPI\Framework\Events\ManagedEvent.cs:line 101
eg: If there is 1 Worm Bin in your bag after crafting an Deluxe Worm Bin and turning the crafting frame off and on again, you will see there is still 1 Worm Bin in there.
I'll see if I can come up with a fix.
For any other modders who are curious...
public Item ConsumeStack(int amount)
{
if (amount == 0)
{
return this;
}
if (Stack - amount <= 0)
{
return null;
}
Stack -= amount;
return this;
}
Notice that the line Stack -= amount; does not execute if the amount parameter is >= the current Stack quantity. I haven't done much investigation yet but I'm assuming this unusual logic is the culprit for this bug in my mod's crafting logic.
EDIT: After more investigation, this does appear to be causing the issues. StardewValley.Menus.CraftingPage.clickCraftingRecipe invokes StardewValley.CraftingRecipe.consumeIngredients, which then calls StardewValley.Item.ConsumeStack (rather than calling IInventory.ReduceId). Then ConsumeStack doesn't reduce the Stack if the amount to consume is greater than or equal to the Item's current Stack amount. So when my mod attempts to update the quantities of items inside of bags after the crafting menu is closed, the quantities are incorrect.
Thank you so much, both for the mod in general, and also for keeping it so up to date! <3
Is there also a way to quickstack items from the bags too?
For more info, check here (scroll down to the Standard Bags section, where it lists which shops sell which sizes)