Wonderlarr Posted January 21, 2022 Share Posted January 21, 2022 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 How can I extend the background bar to match the slots? Link to comment https://forums.kleientertainment.com/forums/topic/137019-how-do-i-extend-the-inventory-bar/ Share on other sites More sharing options...
Monti18 Posted January 21, 2022 Share Posted January 21, 2022 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. Link to comment https://forums.kleientertainment.com/forums/topic/137019-how-do-i-extend-the-inventory-bar/#findComment-1534027 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