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 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_SHOTGUNChoose ammo type for the shotgun.ItemAction.CHOOSE_AMMO_CROSSBOWChoose ammo type for the crossbow.ItemAction.CHOOSE_AMMO_GRENADEGUNChoose ammo type for the grenade launcher.ItemAction.CHOOSE_AMMO_UZIChoose ammo type for the Uzi.ItemAction.CHOOSE_AMMO_PISTOLSChoose ammo type for the pistols.ItemAction.CHOOSE_AMMO_REVOLVERChoose ammo type for the revolver.ItemAction.CHOOSE_AMMO_HKChoose ammo type for the HK gun.ItemAction.CHOOSE_AMMO_HARPOONChoose ammo type for the harpoon gun.ItemAction.CHOOSE_AMMO_ROCKETChoose ammo type for the rocket launcher.