Inventory #

Read more about the Inventory system in Hiro here.

List items #

List all inventory items defined in the codex, optionally filtered by category.

1
2
3
4
5
var request = Hiro.InventoryListRequest.new()
request.item_category = "weapons"

var inventory_list = await hiro.inventoryList(session, request)
print(inventory_list)

List user inventory items #

List all inventory items owned by the player, optionally filtered by category.

1
2
3
4
5
var request = Hiro.InventoryListRequest.new()
request.item_category = "weapons"

var inventory_list = await hiro.inventoryListInventory(session, request)
print(inventory_list)

Consume inventory items #

Consume one or more inventory items owned by the player.

1
2
3
4
5
6
7
var request = Hiro.InventoryConsumeRequest.new()
request.items = {
    "health_potion": "1"
}

var consume_rewards = await hiro.inventoryConsume(session, request)
print(consume_rewards)

Grant inventory items #

Grant one or more inventory items to the player.

1
2
3
4
5
6
7
var request = Hiro.InventoryGrantRequest.new()
request.items = {
    "bronze_sword": "1"
}

var grant_rewards = await hiro.inventoryGrant(session, request)
print(grant_rewards)

Update inventory items #

Update the properties on one or more inventory items owned by the player.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
var request = Hiro.InventoryUpdateItemsRequest.new()
request.item_updates = {
    "bronze_sword": {
        "string_properties": {
            "example_property": "example_value"
        },
        "numeric_properties": {
            "numeric_properties": 10
        }
    }
}

var update_ack = await hiro.inventoryUpdate(session, request)
print(update_ack)