Unlockables #

The Unlockables system manages items players can unlock, purchase, and claim based on game progression. Learn more in the Unlockables concept guide.

Overview #

The Unlockables system enables your game to:

  • Create random unlockables.
  • Track unlockable items in progress.
  • Start timers and handle purchases to unlock items.
  • Claim unlockable items after completion.

Before You Start #

Make sure you have:

  • Python project configured with Hiro SDK.
  • Nakama system integrated (guide).

Working with Unlockables #

Creating a Random Unlockable #

Create and assign a random unlockable item:

1
2
unlockables_list = await hiro_client.unlockables_create()
print(unlockables_list)

Retrieving In-progress Unlockables #

List unlockable items currently in progress:

1
2
unlockables_list = await hiro_client.unlockables_get()
print(unlockables_list)

Starting an Unlock #

Begin the unlock timer for a specified unlockable:

1
2
3
4
5
request = UnlockablesRequest()
request.instance_id = "unlockable_instance_1"

unlockables_list = await hiro_client.unlockables_unlock_start(request)
print(unlockables_list)

Purchasing an Unlockable #

Use soft currency to purchase an unlockable based on remaining time:

1
2
3
4
5
request = UnlockablesRequest()
request.instance_id = "unlockable_instance_1"

unlockables_list = await hiro_client.unlockables_purchase_unlock(request)
print(unlockables_list)

Purchasing a New Unlockable Slot #

Buy an additional slot for unlockable items:

1
2
unlockables_list = await hiro_client.unlockables_purchase_slot()
print(unlockables_list)

Claiming an Unlockable #

Claim an unlockable item after completion:

1
2
3
4
5
request = UnlockablesRequest()
request.instance_id = "unlockable_instance_1"

unlockables_list = await hiro_client.unlockables_claim(request)
print(unlockables_list)