7#include "Kismet/GameplayStatics.h"
10void UStoryScript::ExecuteScript_Implementation(
AActor* Instigator)
15void UStoryScript::ScriptInitialization_Implementation()
20 PlayerPawnRef = UGameplayStatics::GetPlayerPawn(GetWorld(), 0);
27 if (UWorld* World = GetWorld())
29 UGameplayStatics::GetAllActorsOfClass(World, ActorClass, OutActors);
44 SpawnedActor->FinishSpawning(SpawnTransform);
48 UE_LOG(LogTemp,
Error, TEXT(
"StoryScript - SpawnStoryActorWithSpecificSteps failed"));
55 UE_LOG(LogTemp,
Error, TEXT(
"StoryScript - SpawnStoryActorWithSpecificSteps failed"));
Base class for story actors.
UStoryComponent * Story
UPROPERTY(BlueprintReadWrite, EditAnywhere)
UHighlightComponent * HighlightComponent
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray< FText > HighlightActiveOnSteps
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Highlight")
TArray< FText > ActiveSteps
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Story|Setup")
AActor * CurrentInstigator
UPROPERTY(BlueprintReadWrite, Category = "Script")
APawn * PlayerPawnRef
UPROPERTY(BlueprintReadWrite, Category = "Script")
UGameManager * GameManagerRef
UPROPERTY(BlueprintReadWrite, Category = "Script")
AGameModeBase * GameModeRef
UPROPERTY(BlueprintReadWrite, Category = "Script")
void GetAllActorsOfClass(TSubclassOf< AActor > ActorClass, TArray< AActor * > &OutActors)
Analogue to engine functions GetAllActorsOfClass.
ABaseStoryActor * SpawnStoryActorWithSpecificSteps(TSubclassOf< ABaseStoryActor > ActorClass, FTransform SpawnTransform, TArray< FText > ActiveSteps, TArray< FText > HighlightSteps)
Spawns a story actor with specific steps.