Jump to content

Issue with storageFlags on newly tagged items/blocks


GreenM4N4

Recommended Posts

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


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 by Spear and Fang
  • Like 1
Link to comment
Share on other sites

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!

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.