Jjmarco Posted January 11, 2015 Share Posted January 11, 2015 Hello, I am trying to make an equip slot for backpacks, fairly simple. It works flawlessly for the host, however, for the client, the inventory and the crafting tab simply... don't appear at all. The log doesn't show anything wrong, though. I suspect it may be linked to the Close() method of the inventory component, as it does the exact same thing, but I am not sure. I looked through the code, tried to use the Open() method, with no success. I am not terribly familiar with the changes of the mod API on DST... Here is my modmain:Assets = {Asset("ATLAS", "images/backpack.xml")}local require = GLOBAL.requireGLOBAL.CHEATS_ENABLED = trueGLOBAL.require('debugkeys')GLOBAL.EQUIPSLOTS.PACK = "pack"-- Changes the equipslot of all backpack itemsAddPrefabPostInitAny(function(inst) if inst.components.container and inst.components.container.type == "pack" then inst.components.equippable.equipslot = GLOBAL.EQUIPSLOTS.PACK endend)AddClassPostConstruct("widgets/inventorybar", function(inst) inst:AddEquipSlot(GLOBAL.EQUIPSLOTS.PACK, "images/backpack.xml", "backpack.tex") inst.bg:SetScale(1.21,1.04,1) inst.bgcover:SetScale(1.21,1.04,1)end)Thanks! Link to comment https://forums.kleientertainment.com/forums/topic/48904-problem-with-custom-equip-slot/ Share on other sites More sharing options...
rezecib Posted January 11, 2015 Share Posted January 11, 2015 @Jjmarco, I ported RPG HUD a while back (before we had the workshop). You can look at that, part of it was adding equip slots. I don't think my port is still functional, but it worked at one point, so it may help Link to comment https://forums.kleientertainment.com/forums/topic/48904-problem-with-custom-equip-slot/#findComment-600159 Share on other sites More sharing options...
Jjmarco Posted January 11, 2015 Author Share Posted January 11, 2015 @rezecib: I tried your port, and unfortunatly it does the same thing for clients! Thanks, though, I'll try to pinpoint where the bug happens. I got one more question: I don't really understand the purpose of replicas; when should I use a replica instead of a component? Do I have to worry about them if the mod is client only? Link to comment https://forums.kleientertainment.com/forums/topic/48904-problem-with-custom-equip-slot/#findComment-600281 Share on other sites More sharing options...
rezecib Posted January 12, 2015 Share Posted January 12, 2015 I got one more question: I don't really understand the purpose of replicas; when should I use a replica instead of a component? Do I have to worry about them if the mod is client only? I wrote about this in my guide. Link to comment https://forums.kleientertainment.com/forums/topic/48904-problem-with-custom-equip-slot/#findComment-600756 Share on other sites More sharing options...
Jjmarco Posted January 12, 2015 Author Share Posted January 12, 2015 @rezecib, great, thanks! Link to comment https://forums.kleientertainment.com/forums/topic/48904-problem-with-custom-equip-slot/#findComment-601014 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