Menu
Lumberyard
Legacy Reference

ScriptBind_ItemSystem

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

Lists C++ functions for actor items and items in packs that you can call from Lua script.

GetPackItemByIndex

Gets a pack item from its index.

Syntax

ItemSystem.GetPackItemByIndex(const char *packName, int index)

Parameter Description
packName The name of the pack.
index The index of the item to retrieve.

GetPackNumItems

Get the number of items in the specified pack.

Syntax

ItemSystem.GetPackNumItems(const char* packName)

Parameter Description
packName The name of the pack whose item count to retrieve.

GetPackPrimaryItem

Gets the primary item of the specified pack.

Syntax

ItemSystem.GetPackPrimaryItem(const char *packName)

Parameter Description
packName The name of the pack whose primary item to retrieve.

GiveItem

Gives the specified item.

Syntax

ItemSystem.GiveItem(const char *itemName)

Parameter Description
itemName The name of the item.

GiveItemPack

Gives the item pack specified to the actor specified .

Syntax

ItemSystem.GiveItemPack(ScriptHandle actorId, const char *packName)

Parameter Description
actorId The actor identifier.
packName The name of the pack.

Reset

Resets the item system.

Syntax

ItemSystem.Reset()

SerializePlayerLTLInfo

Serializes player level to level (LTL) information.

Syntax

ItemSystem.SerializePlayerLTLInfo(bool reading)

Parameter Description
reading Boolean value.

SetActorItem

Sets an actor item.

Syntax

ItemSystem.SetActorItem(ScriptHandle actorId, ScriptHandle itemId, bool keepHistory)

Parameter Description
actorId The actor identifier.
itemId The item identifier.
keepHistory True to keep the history; otherwise, false.

SetActorItemByName

Sets an actor item by name.

Syntax

ItemSystem.SetActorItemByName(ScriptHandle actorId, const char *name, bool keepHistory)

Parameter Description
actorId The actor identifier.
name The name of the actor item.
keepHistory True to keep the history; otherwise, false.