This is a documentation of the design of the inventory system (INV).
The interface features slots for adventure (ADV) items and combat (COM) items.
There are no limits to the number of items the player can carry, except that weapons are limited; ammo is limited to maximum allowed by the battery version carried by the player. Clothing/armour is also limited to 1.
Weps have a maximum of 3 slots. A wep, depending on size ([s]mall, [m]edium, [l]arge), will have a slot cost.
- s wep = 1 slot
- m wep = 2 slots
- l wep = 3 slots
Thus a player may have the following configurations
- 3x small
- 1x med + 1x small
- 1x large
Weps have current ammo (ammo) and ammo capacity (ammo_max), which is amount of energy they can carry.
Weps have discharge rate (rof), which is the amount of energy they consume per discharge
Weps have cooldown rate (cool), which is the amount of time needed to be able to fire again.
Weps have a reload time (reloadtime), which is the amount of time needed to fully charge the weapon.
The INV screen will have a hotkey number (eg ‘1’, ‘2’, ‘3’) over the weapon slot to denote that the weapon can be armed using the key during adventure/combat.
Ammo is based on charges. This is the universal ammo for all weapons. As such they occupy a special slot for ammo. The capacity represents a kind of ‘rechargeable battery’ that the player has, which, in the course of the game gets increased as better kinds of ‘batteries’ are recovered.
Ammo have two components: current amount of ammo (invammo), and total capacity (invammo_max).
It is termed clothing to be more generic. However, clothing refers to armour as well. Only 1 reserved slot is available for clothing and the player cannot carry extra clothing.
As with extra items that have a reserved slot, these items must be stored in the world (eg post boxes).
The only time clothing can be removed, or worn, is if the player is at an adjacent tile to a container (eg postboxes) that contains the armour.
When wearing a new armour, this actually takes place in the world. The player clicks on a container that contains armour. The Trade screen comes up and the switch can be made here.
When dropping clothing or armour, it can happen the same way, through the Trade screen.
Advitems are any kind of item in the INV which are useful in things other than combat.
They can be used to accomplish missions (accomps) as ‘mission items’.
The Jaxbox is a special advitem, which is placed in a dedicated slot, and is used to hack computer systems. Like ammo ‘batteries’ these Jaxboxes are upgrade-able, and when a player finds a better Jaxbox, this slot is simply upgraded to the next one. The older one is discarded and deemed irrelevant since there is no real advantage of keeping the old one.
Money or credits have a dedicated slot in the INV. They occupy no space, and might actually be physical money, rather than electronic.
Useitem is subsystem of ADV in which any advitem is used on any kind of interactable item in the world. Interactable items may include:
- World props (eg terminals, doors, computers, rubbish bins, tables)
The Useitem system utilises interaction triggers, which announce to the world that a player interaction has taken place (eg ‘Useitem <advitem> <object>’).
Then the system can offer a basic/generic behaviour for certain triggers, for example, doors. This can be built into the main logic. However, it can also be overridden by a level script.
The level script involves the use of a trigger and a further filtering of the instance designed to accept the trigger. In the case of doors, the door must have a unique name if it is to have a level-specific behaviour.
The act of using an item may first originate from the INV interface. The player LMB on the advitem, which makes it the current item in the Use slot in the Adventure UI (ADVUI). If the Use slot is highlighted, that means that LMB on will be an act of Using an object on the selected NPC/prop/location.
Getting an item may only need to be a LMB on the object on the world screen.
If the selected item is ammo or money, then the respective quantity is updated.
If the selected item is a new type of battery, then the battery slot is upgraded. The same with Jaxboxes.
If the selected item is an advitem, then that is placed in a slot in the INV.
In INV mode, weapons can be reloaded and drawn. They can also be reloaded and drawn in the ADVUI.
When an item is clicked on a context menu will come up.
- Drop – when dropping at a location with no adjacent containers, the game will prompt whether you are sure, that dropping an object here will result in completely losing the item.
- Drop – only possible when player is adjacent to a container
- Jaxbox – no context menu
- Drop – same warning as weapons. If dropped at location without container, then item will be lost
- Use – will be put the item in the ‘Ready Item List’, which is located in the ADV gui.
C2 delineation of INV
In C2, the INV dictionaries for advitem, wep, and cloth, are separate and defined, respectively, as AdvitemInv, WepInv, ClothInv. This allows to easily distinguish their major types.
NPC inventory (NPCInv) is also a separate and is created on a per-npcmover basis.