Inventory Item Parameters

Last Updated: 15 November 2025

Example #

level.objects =
{
level.InventoryItem.new(
    "tut1_ba_cartouche2",       -- corresponding string from strings.lua
    ObjID.SMALLMEDI_ITEM,       -- Object Slot
    256,                        -- bigger value moves the item down
    1.0,                        -- bigger value is closer
    Rotation.new(
        90,                    -- x rotation axis
        90,                    -- y rotation axis
        0                      -- z rotation axis
    ),
    RotationAxis.X,            -- X: rotates forward/back. Y: left/right. Z: rotate right/left
    -1, -- Always put -1 here. These are used for showing/hiding parts of meshes (ie: Revolver and Revolver with Lasersight)
    ItemAction.USE | ItemAction.EXAMINE -- Item Actions ( see below)
)
}

ItemActions #

ItemActions determine how the item can be interacted with, inside the inventory:

  • ItemAction.USE Use the item.
  • ItemAction.EQUIP Equip the item.
  • ItemAction.EXAMINE Examine the item.
  • ItemAction.COMBINE Combine the item with another item.
  • ItemAction.SEPARATE Separate items.
  • ItemAction.LOAD Load game.
  • ItemAction.SAVE Save game.
  • ItemAction.STATISTICS Show statistics screen.

Multiple ItemActions #

You can combine multiple items actions with the PIPE ( |) character. So the user can use and examine the same item
 
ItemAction.USE | ItemAction.EXAMINE
Lua API Reference

Modifying Weapons #

If you are modifying a weapon and you do not see the ammo underneath the weapon in the inventory: you must use the ItemAction.CHOOSE_AMMO itemAction.

 

  • ItemAction.CHOOSE_AMMO_SHOTGUN Choose ammo type for the shotgun.
  • ItemAction.CHOOSE_AMMO_CROSSBOW Choose ammo type for the crossbow.
  • ItemAction.CHOOSE_AMMO_GRENADEGUN Choose ammo type for the grenade launcher.
  • ItemAction.CHOOSE_AMMO_UZI Choose ammo type for the Uzi.
  • ItemAction.CHOOSE_AMMO_PISTOLS Choose ammo type for the pistols.
  • ItemAction.CHOOSE_AMMO_REVOLVER Choose ammo type for the revolver.
  • ItemAction.CHOOSE_AMMO_HK Choose ammo type for the HK gun.
  • ItemAction.CHOOSE_AMMO_HARPOON Choose ammo type for the harpoon gun.
  • ItemAction.CHOOSE_AMMO_ROCKET Choose ammo type for the rocket launcher.