beforeidecay96 Posted June 28, 2016 Share Posted June 28, 2016 (edited) My character has a follower that lets you store stuff in it (like chester), but now when I try to use the crock pot it has nine slots just like a chest instead of the four vertical slots it's supposed to have. It still functions like a crock pot except for the fact that you have to fill all nine spaces with an ingredient to cook. This is what it looks like when I open a crock pot with my mod on that server: This has been frustrating me for quite sometime now and I can't seem to figure out how to fix it. Can someone help me? Edited June 29, 2016 by beforeidecay96 Link to comment Share on other sites More sharing options...
DarkXero Posted June 28, 2016 Share Posted June 28, 2016 My guess is that you screwed up overriding the containers.widgetsetup function, and now all containers have the same widget. Post code. Link to comment Share on other sites More sharing options...
beforeidecay96 Posted June 28, 2016 Author Share Posted June 28, 2016 (edited) Here's the modmain, the characters prefab, and the follower's prefab: modmain.lua sting.lua summonlector.lua Let me know if you need any other files. Edited June 29, 2016 by beforeidecay96 Link to comment Share on other sites More sharing options...
DarkXero Posted June 28, 2016 Share Posted June 28, 2016 Well, I was right on the money. Remove this from modmain: local containers = GLOBAL.require("containers") local oldwidgetsetup = containers.widgetsetup containers.widgetsetup = function(container, prefab, data) prefab = "treasurechest" --replace with ur container prefab name oldwidgetsetup(container, prefab, data) end local containers = GLOBAL.require("containers") local oldwidgetsetup = containers.widgetsetup containers.widgetsetup = function(container, prefab) if not prefab and container.inst.prefab == "treasurechest" then prefab = "chester" end oldwidgetsetup(container, prefab) end And in summonlector, you have: if not TheWorld.ismastersim then return inst end -- code, code, code if not TheWorld.ismastersim then inst.OnEntityReplicated = function(inst) inst.replica.container:WidgetSetup("chester") end return inst end So the function returns before setting up the widget correctly. Move the content of the second IF inside the first. Link to comment Share on other sites More sharing options...
beforeidecay96 Posted June 29, 2016 Author Share Posted June 29, 2016 (edited) That fixed the issue with the crock pot, but now I messed something up with my follower. It won't spawn it when I log in to the server. I'm not entirely sure what I did that would cause it to mess up. Never mind, I fixed it. It all works now! Thank you so much for the help! ^-^ Edited June 29, 2016 by beforeidecay96 Link to comment 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