opx_infinityinventory
Items
Last updated on
The item and weapon catalogue — the row format of data/items.lua and data/weapons.lua, and what ships.
Catalogue files
- Items:
modules/inventory/data/items.lua(M.Data.ITEMS). Weapons:modules/inventory/data/weapons.lua(M.Data.WEAPONS). - The key is the item name: letters, digits,
_,-and., up to 48 bytes. - A malformed row is a boot warning and is left out.
- No way to add items at runtime.
Item fields
water = {
WEIGHT = 500, CATEGORY = 'drink', MODEL = 'food.drink_packaged',
USE = { STATUS = { thirst = 35 }, ANIMATION = { NAME = 'drink', DURATION_MS = 3000 } },
},| Field | Default | Effect |
|---|---|---|
WEIGHT | DEFAULT_ITEM_WEIGHT | Grams per unit. |
CATEGORY | misc | Which tab shows it. |
STACK | true | false: one unit per slot. |
DROP | true | false: cannot be dropped on the ground or moved into any memory-only container (no_drop). |
LABEL | locale inventory.item.<name>, else the name | A locale key or plain text. |
DESCRIPTION | locale inventory.item.<name>.description | A locale key or plain text. |
IMAGE | none | Image name for the screen. |
MODEL | DROPS.MODEL | A curated Open77.props alias drawn for a pile. A .mesh path is refused at load. See Pile models. |
USE | none | Makes the item usable. See below. |
USE sub-fields:
| Field | Default | Effect |
|---|---|---|
CONSUME | 1 | Units removed per use. A use handler can override it. |
CLOSE | true | false keeps the screen open after a use. |
STATUS | none | { needName = amount }, added by the server through the needs contract (reason use) after the unit is consumed. |
ANIMATION | none | { NAME, VARIANT?, DURATION_MS? }. With DURATION_MS a non-cancellable progress bar plays it; without, animations plays it once. |
An item with neither USE nor a registered use handler cannot be used (not_usable).
Weapons as items
M.Data.WEAPONS has three tables:
| Table | Fields | Meaning |
|---|---|---|
AMMO | WEIGHT, MAX, MODEL | Ammunition items. Category ammo, always stackable and usable. MAX is the rounds per box (1–100000, default 250 with a boot warning when not a whole number): an ammo slot holds at most MAX, never above MAX_STACK. Shipped: handgun 500, rifle 900, shotgun 190, sniper 170. |
CLASSES | AMMO, MODEL, MAGAZINE | Shared settings per class (handgun, rifle, melee, …). |
WEAPONS | RECORD, CLASS, WEIGHT, MAGAZINE?, MODEL? + item fields | One weapon item each. RECORD is an Items.* TweakDB record. A weapon whose class is unknown is left out. |
AMMO = { ammo_handgun = { WEIGHT = 10, MAX = 500, MODEL = 'crate.ammo_box' } },
CLASSES = { handgun = { AMMO = 'ammo_handgun', MODEL = 'military.case', MAGAZINE = 15 } },
WEAPONS = { weapon_chao = { RECORD = 'Items.Preset_Chao_Default', CLASS = 'handgun', WEIGHT = 1000 } },- A weapon is never stackable. Each unit gets metadata
{ serial, ammo }: a serial of two letters and eight hex digits, andammo = 0. Aserialpassed in metadata is kept only when one weapon is added. - Using a weapon draws it into game weapon slot
WEAPONS.SLOT. Using it again puts it away. Moving, giving or dropping a drawn weapon first puts it away and reads its rounds: that try is refused withholstering, the next one goes through with the rightammo. Other modules put it away withHolsterWeapon. - Using an ammunition item loads it into the drawn weapon of the matching class, up to the weapon's
MAGAZINE(or its class's). The rounds are kept on the weapon'sammometadata and read back from the game everyWEAPONS.AMMO_SYNC_MS; they only ever go down that way. - With
WEAPONS.REMOVE_UNBACKED = true, any equipped weapon no bag item backs is taken off the player everyWEAPONS.SCAN_MS. - Drawing a weapon needs the host's
Open77.weaponsrelay. Without it the use answersweapons_unavailable.
Shipped items
- Drinks, food, medical items (they heal:
HEALING), materials (scrap_metal,electronics),lockpick,hauling_crate(10 kg, used byhauling),phone,id_card,shard,vehicle_key,eddies, four ammunition types and 189 weapons. vehicle_keyis non-stackable and carries metadata{ plate, label }, written by vehiclekeys. The screen and the hotbar show a stack's ownmetadata.labelwhen it has one. UseCountWhereto find a key by plate.door_keyis non-stackable, has noUSEand carries metadata{ type, label }, cut by doorlock. A door that lists{ name = 'door_key', metadata = '<type>' }opens for a key of that type.
Pile models
Every droppable item names the nearest prop the platform hosts. The alias list is compiled into the Open77 client, so a resource cannot add one; most non-food items draw a stand-in.
| Items | MODEL |
|---|---|
| water, coffee | food.drink_packaged |
| nicola | food.soda_can |
| burrito / chips, kibble | food.street_food / food.snack |
| bandage, bounce_back, maxdoc | medical.container |
| scrap_metal | garbage.industrial_trash (stand-in) |
| electronics, phone | electronics.monitor.device (stand-in) |
| id_card, shard, vehicle_key, door_key | crate.valuable (stand-in) |
| lockpick | container.toolbox |
| hauling_crate | crate.small |
| ammunition | crate.ammo_box |
| handgun, revolver, SMG, melee classes | military.case |
| rifle, precision, LMG, sniper, shotgun classes | military.case.large |
| axes, hammers (approximate) / Caretaker's Spade | tool.fire_axe / tool.shovel |
| eddies | none (DROP = false) |
shard = { WEIGHT = 20, MODEL = 'crate.valuable' }, -- an alias name, never a .mesh path- A weapon's own
MODELwins over its class's. - Decorative weapons (a pile that looks like the weapon itself) are not possible from a resource: a raw
.meshdraws as a marker, a raw.entis refused (template_backend_disabled), and nothing registers a new alias. It needs one alias per weapon family in the platform. The note is at the top ofdata/weapons.lua.