Jump to content

Recommended Posts

Hello! I'm making mod with custom cook pot, and all works perfectly on non-dedicated server, but on dedicated servers it crashing with

[string "scripts/widgets/containerwidget.lua"]:29: attempt to index local 'widget' (a nil value)

My prefab is here:

alchemypot.lua

full log here:

client_log.txt

Thanks everyone for your replys! If someone'll help me, I can give you some skins! :)

  • Like 1
Link to comment
https://forums.kleientertainment.com/forums/topic/75597-help-with-crash/
Share on other sites

Here's a slightly changed code from my Festivizer mod:

-- 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 == "alchemypot") or (prefab and container.inst.prefab == "alchemypot") then
		prefab = "cookpot"
    end
    return oldwidgetsetup(container, prefab, ...)
end

Paste this into modmain. This should fix the issue.

Edited by PanAzej
1 minute ago, PanAzej said:

Here's a slightly changed code from my Festivizer mod:


-- 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 == "alchemypot") or (prefab and container.inst.prefab == "alchemypot") then
		prefab = "cookpot"
    end
    return oldwidgetsetup(container, prefab, ...)
end

Paste this into modmain. This should fix the issue.

Oh god, thank you!

  • Like 1
13 minutes ago, PanAzej said:

Here's a slightly changed code from my Festivizer mod:


-- 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 == "alchemypot") or (prefab and container.inst.prefab == "alchemypot") then
		prefab = "cookpot"
    end
    return oldwidgetsetup(container, prefab, ...)
end

Paste this into modmain. This should fix the issue.

 I can give you some skins Do you want them? :) 

 

Edited by makar5000
  • Like 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...