Tutorials #

Read more about the Tutorials system in Hiro here.

Get all tutorials #

Get the tutorials and current progress step for the player.

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

HiroClient->TutorialsGet(Session, OnTutorialsGet, OnError);

void AMyActor::OnTutorialsGet(const FHiroTutorialList& TutorialList)
{
    UE_LOG(LogTemp, Log, TEXT("%s"), *TutorialList.ToJson());
}

Accept a tutorial #

Accept an offer to step through a tutorial.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
FHiroTutorialAcceptRequest Request;
Request.Id = TEXT("tutorial_1");

FHiroOnTutorialsAccept OnTutorialsAccept;
OnTutorialsAccept.AddDynamic(this, &AMyActor::OnTutorialsAccept);
FOnError OnError;

HiroClient->TutorialsAccept(Session, Request, OnTutorialsAccept, OnError);

void AMyActor::OnTutorialsAccept(const FHiroTutorial& Tutorial)
{
    UE_LOG(LogTemp, Log, TEXT("%s"), *Tutorial.ToJson());
}

Decline a tutorial #

Decline an offer to start a tutorial.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
FHiroTutorialDeclineRequest Request;
Request.Id = TEXT("tutorial_1");

FHiroOnTutorialsDecline OnTutorialsDecline;
OnTutorialsDecline.AddDynamic(this, &AMyActor::OnTutorialsDecline);
FOnError OnError;

HiroClient->TutorialsDecline(Session, Request, OnTutorialsDecline, OnError);

void AMyActor::OnTutorialsDecline(const FHiroTutorial& Tutorial)
{
    UE_LOG(LogTemp, Log, TEXT("%s"), *Tutorial.ToJson());
}

Abandon a tutorial #

Abandon progress on a tutorial.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
FHiroTutorialAbandonRequest Request;
Request.Id = TEXT("tutorial_1");

FHiroOnTutorialsAbandon OnTutorialsAbandon;
OnTutorialsAbandon.AddDynamic(this, &AMyActor::OnTutorialsAbandon);
FOnError OnError;

HiroClient->TutorialsAbandon(Session, Request, OnTutorialsAbandon, OnError);

void AMyActor::OnTutorialsAbandon(const FHiroTutorial& Tutorial)
{
    UE_LOG(LogTemp, Log, TEXT("%s"), *Tutorial.ToJson());
}

Update progress of a tutorial #

Update the current progress step in the tutorial by ID.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
FHiroTutorialUpdateRequest Request;
Request.Id = TEXT("tutorial_1");
Request.Step = 1;

FHiroOnTutorialsUpdate OnTutorialsUpdate;
OnTutorialsUpdate.AddDynamic(this, &AMyActor::OnTutorialsUpdate);
FOnError OnError;

HiroClient->TutorialsUpdate(Session, Request, OnTutorialsUpdate, OnError);

void AMyActor::OnTutorialsUpdate(const FHiroTutorialList& TutorialList)
{
    UE_LOG(LogTemp, Log, TEXT("%s"), *TutorialList.ToJson());
}