I am learning modding for SB, starting with easy examples, (something that is already done, but for learning purpose it doesn't matter) adding storage to barrels and I have an issue where player placed vanilla barrels in world / ship disappear after loading a mod that patches them, also same barrels in inventory / storage and barrels generated by going to new planet (probably because they are generated post patch) are fine. Did I miss something / made an error or it's just the way it is? Code: [ { "op" : "replace", "path" : "/category", "value" : "storage" }, { "op" : "add", "path" : "/objectType", "value" : "container" }, { "op" : "add", "path" : "/tooltipKind", "value" : "container" }, { "op" : "add", "path" : "/openSounds", "value" : ["/sfx/objects/metalbox_open.wav"] }, { "op" : "add", "path" : "/closeSounds", "value" : ["/sfx/objects/metalbox_close.wav"] }, { "op" : "add", "path" : "/slotCount", "value" : 12 }, { "op" : "add", "path" : "/uiConfig", "value" : "/interface/chests/chest%slots%.config" }, { "op" : "add", "path" : "/frameCooldown", "value" : 5 }, { "op" : "add", "path" : "/autoCloseCooldown", "value" : 3600 } ]
You are changing the fundamentals of the object, so anything already generated is technically now a completely different object. This is why when you make a change to... anything, even a weapon, you need to delete the old one and spawn in a new one. Ive not had luck with the /reload command refreshing the values of existing objects, so I start with a fresh item, then delete it before making changes and testing again.
I am pretty sure that is not how objects work (items, on the other hand, have parameters) but I will test to verify whether or not this is the case.
Thanks for the replies. I thought maybe if object name (I see it as closest thing to object id) isn't changing it will be fine.
I believe I have found the issue: Code: [14:35:51.148] Warn: Failed to deserialize entity: (JsonException) No such key in Json::get("opened") [0] 143422a [1] 1431718 [2] 1444c97 [3] 13d505a [4] 11d40fb [5] 121cb3e [6] 121d231 [7] 130c6c8 [8] 130bf40 [9] 1309907 [10] 13097c1 [11] 125cadf [12] 12526a1 [13] 100a62a [14] 100fc58 [15] 1001b36 [16] 1008216 [17] 1003f96 [18] 10140ea [19] 11c6fb0 [20] 1011549 [21] 147ff56 [22] 143dca2 [23] 757f7c04 BaseThreadInitThunk [24] 77baad1f RtlInitializeExceptionChain [25] 77baacea RtlInitializeExceptionChain Chests have an opening animation. Let me do some more editing and...
So... I have done everything I can think of and I am still getting that error. Changing an object into a container just might be one thing you can't do with an object which has already been placed. The solution is to pick up any existing objects, patch them then, and then place them again (you don't need new objects, just ones that aren't yet placed).