Slots and backpacks

Pockets, base slots, backpack slots and the effects of carrying too much.

The player inventory is split into pockets, base slots and backpack slots. A worn backpack opens the last group and raises the weight limit; carrying too much slows the player down.

Slot layout

Default layout with inventory:slots set to 35

Slot groups

SlotsGroupOpened by
1 – 5Pockets (hotbar keys 1 – 5)Always open
6 – 25Base slotsAlways open
26 – 35Backpack slotsA worn backpack

Three values decide the layout:

ValueWhereDefaultMeaning
inventory:slotsserver.cfg convar35Total slots, the hard maximum
pocketsdata/obsi/core.lua5Number of pocket slots
baseSlotsdata/obsi/core.lua25Last slot that is always open

Everything after baseSlots stays locked until a backpack opens it. The interface shows those slots under NEED A BACKPACK, and the server rejects any move or add into a locked slot.

Pockets and backpack slots

Pockets and the locked backpack slots

Backpacks

A backpack is an item worn in the Bag slot of the clothes column. Its backpack field says how many slots it opens and how much weight it adds:

data/items.lua
['backpack_large'] = {
    label = 'Large backpack',
    weight = 1500,
    prop = 'prop_michael_backpack',
    backpack = { slots = 10, weight = 20000 },
    clothing = {
        kind = 'component', id = 5,
        male = { drawable = 82, texture = 0 },
        female = { drawable = 82, texture = 0 },
    },
},
ItemSlotsExtra weight
backpack_small510 kg
backpack_large1020 kg

The maximum weight is the player weight plus the worn backpack's backpack.weight.

Weight effects

When a player carries more than a share of their maximum weight, the inventory starts to push back.

EffectSettingDefault
Penalties start atoverloadPct85 % of the maximum
Walk styleclipsetmove_m@hobo@a (false keeps the current one)
Movement speedmoveRate× 0.85
No sprinting or jumping fromdisableSprintPct97 %
Stamina lost per second of runningstaminaDrain2.5
Sweatingsweat, sweatAmounton, 80

All of these live in the weight table of data/obsi/core.lua. Admins can switch the whole feature off live with the Weight effects addon.