Menu
Lumberyard
Developer Guide (Version 1.12)

ScriptBind_Inventory

CryLua is deprecated and will be removed in a future version of Lumberyard.

Lists C++ inventory managment functions that you can call from Lua script.

Clear

Clears the inventory.

Syntax

Inventory.Clear()

Destroy

Destroys the inventory.

Syntax

Inventory.Destroy()

Dump

Dumps the inventory.

Syntax

Inventory.Dump()

GetAmmoCapacity

Gets the capacity for the specified ammunition.

Syntax

Inventory.GetAmmoCapacity(const char *ammoName)

Parameter Description
ammoName The name of the ammunition.

GetAmmoCount

Gets the amount of the specified ammunition name.

Syntax

Inventory.GetAmmoCount(const char *ammoName)

Parameter Description
ammoName The name of the ammunition.

GetCurrentItem

Gets the current item.

Syntax

Inventory.GetCurrentItem()

GetCurrentItemId

Gets the identifier of the current item.

Syntax

Inventory.GetCurrentItemId()

GetGrenadeWeaponByClass

Gets grenade weapon by class name.

Syntax

Inventory.GetGrenadeWeaponByClass(const char *className)

Parameter Description
className The name of the class.

GetItemByClass

Gets item by class name.

Syntax

Inventory.GetItemByClass(const char *className)

Parameter Description
className The name of the class.

HasAccessory

Checks if the inventory contains the specified accessory.

Syntax

Inventory.HasAccessory(const char *accessoryName)

Parameter Description
accessoryName The name of the accessory.

SetAmmoCount

Sets the amount of the specified ammunition.

Syntax

Inventory.SetAmmoCount(const char *ammoName, int count)

Parameter Description
ammoName The name of the ammunition.
count The count of the ammunition.