Jump to content

Recommended Posts

Hello! My character uses a lot of unique items that take up a slot each, and after play testing for an entire run the most annoying thing was my character only having about 10 slots to work with in their normal inventory, as at least 5 were taken up by the character's items.

I tried using

inst.components.inventory.maxslots = 18 -- in master_postinit
-- and
inst.maxslotsinv = 18 -- in common_postinit

But, although they DID work functionally, they leave this visual artifact image.thumb.png.e546bdce47e9ecbd66c944ceb10a1a26.png

How can I extend the background bar to match the slots?

I think you can try and hook the GetNumSlot function of inventory_replica.

Spoiler

function Inventory:GetNumSlots()
    if self.inst.components.inventory ~= nil then
        return self.inst.components.inventory:GetNumSlots()
    else
        return GetMaxItemSlots(TheNet:GetServerGameMode())
    end
end
-----------------------------------------------------------------------------
function GetMaxItemSlots(game_mode)
    return GetGameMode(game_mode).override_item_slots or MAXITEMSLOTS
end
------------------------------------------------------------------------------
local function RebuildLayout(self, inventory, overflow, do_integrated_backpack, do_self_inspect)
    local y = overflow ~= nil and ((W + YSEP) / 2) or 0
    local eslot_order = {}

    local num_slots = inventory:GetNumSlots()

 

It's used in the widget inventorybar to check how many inventory slots there are and is defined on the client by the GetMaxItemSlots function where you could only change it for all characters and not for one.

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