Eranthis Posted March 5, 2018 Share Posted March 5, 2018 (edited) I'm completely clueless as to where exactly the crashing is coming from and I'd like to salvage the world I've been playing without ripping out mods. I'll provide the logs and errors if anyone wants to take a look and identify a problem. It's definitely custom item related as removing the item allows the world to play again. I still need to know why though. client_log.txt Edited March 8, 2018 by Eranthis Link to comment https://forums.kleientertainment.com/forums/topic/88317-solved-world-inaccessible-crashing-from-mod/ Share on other sites More sharing options...
Hunger Artist Posted March 5, 2018 Share Posted March 5, 2018 Try insert this to the end of modmain.lua local containers = GLOBAL.require("containers") local oldwidgetsetup = containers.widgetsetup containers.widgetsetup = function(container, prefab) if not prefab and container.inst.prefab == "healthkit" then prefab = "backpack" end oldwidgetsetup(container, prefab) end Link to comment https://forums.kleientertainment.com/forums/topic/88317-solved-world-inaccessible-crashing-from-mod/#findComment-1011350 Share on other sites More sharing options...
Eranthis Posted March 5, 2018 Author Share Posted March 5, 2018 4 minutes ago, Hunger Artist said: Try insert this to the end of modmain.lua local containers = GLOBAL.require("containers") local oldwidgetsetup = containers.widgetsetup containers.widgetsetup = function(container, prefab) if not prefab and container.inst.prefab == "healthkit" then prefab = "backpack" end oldwidgetsetup(container, prefab) end Still crashing. I'll provide another log file in case it helps. client_log.txt Link to comment https://forums.kleientertainment.com/forums/topic/88317-solved-world-inaccessible-crashing-from-mod/#findComment-1011354 Share on other sites More sharing options...
Hunger Artist Posted March 5, 2018 Share Posted March 5, 2018 Instead of this(in healthkit.lua) inst:AddComponent("container") inst.components.container:WidgetSetup("backpack") Try another code inst:AddComponent("container") healthkit = { widget = { slotpos = {}, animbank = "ui_backpack_2x4", animbuild = "ui_backpack_2x4", pos = Vector3(-5, -50, 0), }, issidewidget = true, type = "pack", } for y = 0, 3 do table.insert(params.backpack.widget.slotpos, Vector3(-162, -75 * y + 114, 0)) table.insert(params.backpack.widget.slotpos, Vector3(-162 + 75, -75 * y + 114, 0)) end inst.components.container:WidgetSetup("healthkit", healthkit) I took it from Starter Guide: Link to comment https://forums.kleientertainment.com/forums/topic/88317-solved-world-inaccessible-crashing-from-mod/#findComment-1011357 Share on other sites More sharing options...
Hunger Artist Posted March 5, 2018 Share Posted March 5, 2018 (edited) Or you can try something like this(paste it to the end of modmain) -- CONTAINERS: local containers = GLOBAL.require("containers") local oldwidgetsetup = containers.widgetsetup _G=GLOBAL mods=_G.rawget(_G,"mods")or(function()local m={}_G.rawset(_G,"mods",m)return m end)() mods.old_widgetsetup = mods.old_widgetsetup or containers.smartercrockpot_old_widgetsetup or oldwidgetsetup containers.widgetsetup = function(container, prefab, ...) if (not prefab and container.inst.prefab == "healthkit") or (prefab and container.inst.prefab == "healthkit") then prefab = "backpack" end return oldwidgetsetup(container, prefab, ...) end Source: Edited March 5, 2018 by Hunger Artist Link to comment https://forums.kleientertainment.com/forums/topic/88317-solved-world-inaccessible-crashing-from-mod/#findComment-1011370 Share on other sites More sharing options...
Eranthis Posted March 5, 2018 Author Share Posted March 5, 2018 2 hours ago, Hunger Artist said: Or you can try something like this(paste it to the end of modmain) -- CONTAINERS: local containers = GLOBAL.require("containers") local oldwidgetsetup = containers.widgetsetup _G=GLOBAL mods=_G.rawget(_G,"mods")or(function()local m={}_G.rawset(_G,"mods",m)return m end)() mods.old_widgetsetup = mods.old_widgetsetup or containers.smartercrockpot_old_widgetsetup or oldwidgetsetup containers.widgetsetup = function(container, prefab, ...) if (not prefab and container.inst.prefab == "healthkit") or (prefab and container.inst.prefab == "healthkit") then prefab = "backpack" end return oldwidgetsetup(container, prefab, ...) end Source: No dice with the suggested inst:AddComponent("container") code for the healthkit.lua (although I did still have your first suggested container code for the modmain.lua in case that might be a factor for it) but the good news is that the second container strings for the modmain seemed to work. I can go back into my old world, apply the item and start a new game without crashes. I'm not sure if I should jot this down as solved just yet just in case another expected error occurs but for now, I think my problem is solved. I really wish I had a better grasp on the code so I didn't have to desperately ask for every problem that occurs. Still you're a life saver, thanks! Link to comment https://forums.kleientertainment.com/forums/topic/88317-solved-world-inaccessible-crashing-from-mod/#findComment-1011426 Share on other sites More sharing options...
Hunger Artist Posted March 5, 2018 Share Posted March 5, 2018 (edited) 3 minutes ago, Eranthis said: although I did still have your first suggested container code for the modmain.lua in case that might be a factor for it You should delete it since it doesn't work properly. Edited March 5, 2018 by Hunger Artist Link to comment https://forums.kleientertainment.com/forums/topic/88317-solved-world-inaccessible-crashing-from-mod/#findComment-1011427 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