krylincy Posted April 27, 2020 Share Posted April 27, 2020 Hi there, i still have problems to convert my container mod from ds to dst. for the host it is working, but for the client I have a bunch of problems. the main problem is, that my container is not initialized correctly. as when i call the inventory_classified "has" function. inst._item is empty. local function Has(inst, prefab, amount) print('inst', inst) local count = inst._activeitem ~= nil and inst._activeitem.prefab == prefab and Count(inst._activeitem) or 0 print('inst._items', inst._items) print('inst._itemspreview', inst._itemspreview) if inst._itemspreview ~= nil then for i, v in ipairs(inst._items) do local item = inst._itemspreview[i] if item ~= nil and item.prefab == prefab then count = count + Count(item) end end elseif inst._items ~= nil then for i, v in ipairs(inst._items) do local item = v:value() if item ~= nil and item ~= inst._activeitem and item.prefab == prefab then count = count + Count(item) end end end local overflow = inst:GetOverflowContainer(inst) print('overflow', overflow) dump(overflow) if overflow ~= nil then local overflowhas, overflowcount = overflow:Has(prefab, amount) count = count + overflowcount end local overflowCasket = inst:GetOverflowContainerCasket(inst) print('overflowCasket', overflowCasket) dump(overflowCasket) if overflowCasket ~= nil then local overflowhas, overflowcount = Has(overflowCasket, prefab, amount) count = count + overflowcount end return count >= amount, count end my overflowCasket is the correct container, the output looks like this: [00:01:35]: overflow table: 4BFDA4F8 [00:01:35]: k usespecificslotsforitems [00:01:35]: v false [00:01:35]: k type [00:01:35]: v pack [00:01:35]: k acceptsstacks [00:01:35]: v true [00:01:35]: k _numslots [00:01:35]: v 12 [00:01:35]: k ondetachclassified [00:01:35]: v function: 4BFE9078 [00:01:35]: k _isopen [00:01:35]: v true [00:01:35]: k classified [00:01:35]: v 100917 - container_classified [00:01:35]: k issidewidget [00:01:35]: v true [00:01:35]: k _cannotbeopened [00:01:35]: v net_bool (4CC03608) [00:01:35]: k widget [00:01:35]: v table: 2EDE0BA8 [00:01:35]: k inst [00:01:35]: v 100915 - piggyback [00:01:35]: casket._numslots nil [00:01:35]: ###SetCasket [00:01:35]: overflowCasket table: 4BFD93C8 [00:01:35]: k usespecificslotsforitems [00:01:35]: v false [00:01:35]: k type [00:01:35]: v casket [00:01:35]: k acceptsstacks [00:01:35]: v true [00:01:35]: k ondetachclassified [00:01:35]: v function: 4C24B240 [00:01:35]: k _numslots [00:01:35]: v 120 [00:01:35]: k classified [00:01:35]: v 101411 - container_classified [00:01:35]: k _isopen [00:01:35]: v true [00:01:35]: k issidewidget [00:01:35]: v false [00:01:35]: k _cannotbeopened [00:01:35]: v net_bool (4CC02D10) [00:01:35]: k widget [00:01:35]: v table: 2E9B3948 [00:01:35]: k inst [00:01:35]: v 100905 - casket I have no idea where the ._items is set. i thougt it should be in the replica process ... any help would be great, or a full coding buddy for this project full code is here https://github.com/krylincy/local_casket the original ds mod is this one: https://steamcommunity.com/sharedfiles/filedetails/?id=1397815402 1 Link to comment https://forums.kleientertainment.com/forums/topic/117751-need-help-with-container-mod/ Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now