Jump to content

Recommended Posts

Hello again!

 

One of my mod character's craftable robots are to act as a container. But when shift-clicking items into it, they disappear and you have to hit it with a hammer to get them back out. Is there a way to fix this?

 

Here's the scripts in it's prefab that make it a container.  Is anything missing?

local function OnOpen(inst)    if not inst.components.health:IsDead() then        inst.sg:GoToState("open")    endendlocal function OnClose(inst)    if not inst.components.health:IsDead() then        inst.sg:GoToState("close")    endendlocal slotpos = {}for y = 2, 0, -1 do    for x = 0, 2 do        table.insert(slotpos, Vector3(80*x-80*2+80, 80*y-80*2+80,0))    endend--------------------------------------------------------------------    --("   container")    inst:AddComponent("container")    inst.components.container:SetNumSlots(#slotpos)        inst.components.container.onopenfn = OnOpen    inst.components.container.onclosefn = OnClose        inst.components.container.widgetslotpos = slotpos    inst.components.container.widgetanimbank = "ui_chest_3x3"    inst.components.container.widgetanimbuild = "ui_chest_3x3"    inst.components.container.widgetpos = Vector3(0,-180,0)    inst.components.container.widgetpos_controller = Vector3(0,200,0)    inst.components.container.side_align_tip = 160

Any help would be greatly appreciated!

 

 

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...