GreenM4N4 Posted December 6, 2023 Report Share Posted December 6, 2023 Hey, I've been tinkering with making a bag mod and I am trying to get storage flags working and have been having a heck of a time trying to make them work. I am using 3 of the extra enum values specified in the function public enum EnumItemStorageFlags; 4096, 8192, and 16384. I patched several JSON files to add storageFlag:4096 for example and now I cannot move the items or interact with them, other than scrolling over them. Even items in containers I cannot move any longer. I was trying to find what could be breaking it and hitting a wall. I can move items that were previously tagged with storageFlags, for example, I can move the item:stone-andesite and put it in my custom bag which is a larger mining bag, and the code is identical to the 3 other variants that I am trying to use the storageFlags for. On the other hand, I added a storageFlag: 4096 to redmeat.json and can no longer move the item. This is my first mod so it is most likely something dumb that I am missing, but, how could modifying the storage flag break any item I patch? Thanks for any help that can be provided. Link to comment Share on other sites More sharing options...
Spear and Fang Posted December 6, 2023 Report Share Posted December 6, 2023 (edited) Now I'm no expert on storage flags but my gut tells me that you need to stick to one of the predefined ones on the list that's less than 1024. Or combine some that are less than 1024 (if I remember correctly it's a bitwise thing). If you use one of the custom ones then you'll likely need some supporting c# code to make it function properly EDIT: Oh maybe you don't need any c#, just try adding 1 to your existing values (so bitwise that's your new storage option AND General). For your patches of course, not your bags. General = 1, /// The item can be placed into a backpack slot Backpack = 2, /// The item can be placed in a slot related to mining or smithing Metallurgy = 4, /// The item can be placed in a slot related to jewelcrafting Jewellery = 8, /// The item can be placed in a slot related to alchemy Alchemy = 16, /// The item can be placed in a slot related to farming Agriculture = 32, /// Moneys Currency = 64, /// Clothes, Armor and Accessories Outfit = 128, /// Off hand slot Offhand = 256, /// Arrows Arrow = 512, /// Reserved for vanilla Reserved2 = 1024, /// Custom storage flag for mods Custom1 = 2048, /// Custom storage flag for mods Custom2 = 4096, /// Custom storage flag for mods Custom3 = 8192, /// Custom storage flag for mods Custom4 = 16384, /// Custom storage flag for mods Custom5 = 32768, /// Custom storage flag for mods Custom6 = 65536, /// Custom storage flag for mods Custom7 = 131072, /// Custom storage flag for mods Custom8 = 262144, /// Custom storage flag for mods Custom9 = 524288, /// Custom storage flag for mods Custom10 = 1048576 Edited December 6, 2023 by Spear and Fang 1 Link to comment Share on other sites More sharing options...
GreenM4N4 Posted December 6, 2023 Author Report Share Posted December 6, 2023 That was the fix! Thank you so much for the assistance on this. I know a little programming but the enum stuff and bitwise were brand new to me, when I started looking at the storageFlag code I thought they were just normal integer variables, I was very wrong and wasted an hour trying to change the enumerated values! Anyway, thank you again very much! 1 Link to comment Share on other sites More sharing options...
Recommended Posts