Menu
Lumberyard
Developer Guide (Version 1.12)

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

Copy
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

Copy
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

Copy
ItemSystem.GetPackPrimaryItem(const char *packName)

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

GiveItem

Gives the specified item.

Syntax

Copy
ItemSystem.GiveItem(const char *itemName)

Parameter Description
itemName The name of the item.

GiveItemPack

Gives the item pack specified to the actor specified .

Syntax

Copy
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

Copy
ItemSystem.Reset()

SerializePlayerLTLInfo

Serializes player level to level (LTL) information.

Syntax

Copy
ItemSystem.SerializePlayerLTLInfo(bool reading)

Parameter Description
reading Boolean value.

SetActorItem

Sets an actor item.

Syntax

Copy
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

Copy
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.