Unlockables #

Read more about the Unlockables system in Hiro here.

Create a random unlockable #

Create a random unlockable to assign to a slot (or overflow) unless there are no slots.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
FHiroOnUnlockablesCreate OnUnlockablesCreate;
OnUnlockablesCreate.AddDynamic(this, &AMyActor::OnUnlockablesCreate);
FOnError OnError;

HiroClient->UnlockablesCreate(Session, OnUnlockablesCreate, OnError);

void AMyActor::OnUnlockablesCreate(const FHiroUnlockablesList& UnlockablesList)
{
    UE_LOG(LogTemp, Log, TEXT("%s"), *UnlockablesList.ToJson());
}

Get in progress unlockables #

Get the unlockables which are currently in progress for the player.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
FHiroOnUnlockablesGet OnUnlockablesGet;
OnUnlockablesGet.AddDynamic(this, &AMyActor::OnUnlockablesGet);
FOnError OnError;

HiroClient->UnlockablesGet(Session, OnUnlockablesGet, OnError);

void AMyActor::OnUnlockablesGet(const FHiroUnlockablesList& UnlockablesList)
{
    UE_LOG(LogTemp, Log, TEXT("%s"), *UnlockablesList.ToJson());
}

Start an unlock #

Start the unlock timer for an unlockable in the specified slot.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
FHiroUnlockablesRequest Request;
Request.InstanceId = TEXT("unlockable_instance_1");

FHiroOnUnlockablesUnlockStart OnUnlockablesUnlockStart;
OnUnlockablesUnlockStart.AddDynamic(this, &AMyActor::OnUnlockablesUnlockStart);
FOnError OnError;

HiroClient->UnlockablesUnlockStart(Session, Request, OnUnlockablesUnlockStart, OnError);

void AMyActor::OnUnlockablesUnlockStart(const FHiroUnlockablesList& UnlockablesList)
{
    UE_LOG(LogTemp, Log, TEXT("%s"), *UnlockablesList.ToJson());
}

Purchase an unlockable #

Purchase an unlockable with soft currency based on the remainder cost calculated by the offset left to wait.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
FHiroOnUnlockablesPurchaseUnlock Request;
Request.InstanceId = TEXT("unlockable_instance_1");

FHiroOnUnlockablesPurchaseUnlock OnUnlockablesPurchaseUnlock;
OnUnlockablesPurchaseUnlock.AddDynamic(this, &AMyActor::OnUnlockablesPurchaseUnlock);
FOnError OnError;

HiroClient->UnlockablesPurchaseUnlock(Session, Request, OnUnlockablesPurchaseUnlock, OnError);

void AMyActor::OnUnlockablesPurchaseUnlock(const FHiroUnlockablesList& UnlockablesList)
{
    UE_LOG(LogTemp, Log, TEXT("%s"), *UnlockablesList.ToJson());
}

Purchase a new unlockable slot #

Purchase a new slot to be used to store unlockables.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
FHiroOnUnlockablesPurchaseSlot OnUnlockablesPurchaseSlot;
OnUnlockablesPurchaseSlot.AddDynamic(this, &AMyActor::OnUnlockablesPurchaseSlot);
FOnError OnError;

HiroClient->UnlockablesPurchaseSlot(Session, OnUnlockablesPurchaseSlot, OnError);

void AMyActor::OnUnlockablesPurchaseSlot(const FHiroUnlockablesList& UnlockablesList)
{
    UE_LOG(LogTemp, Log, TEXT("%s"), *UnlockablesList.ToJson());
}

Claim an unlockable #

Claim an unlockable whose start timer has completed or completion was fast tracked with a purchase.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
FHiroUnlockablesRequest Request;
Request.InstanceId = TEXT("unlockable_instance_1");

FHiroOnUnlockablesClaim OnUnlockablesClaim;
OnUnlockablesClaim.AddDynamic(this, &AMyActor::OnUnlockablesClaim);
FOnError OnError;

HiroClient->UnlockablesClaim(Session, Request, OnUnlockablesClaim, OnError);

void AMyActor::OnUnlockablesClaim(const FHiroUnlockablesReward& UnlockablesReward)
{
    UE_LOG(LogTemp, Log, TEXT("%s"), *UnlockablesReward.ToJson());
}