Skip to main content

What the emitter produces

To trust the tool you should understand exactly what C++ you get. Here's the relationship between .tps and output for a real example.

Input (01-hello-actor.tps)​

include "CoreMinimal.h"
include "GameFramework/Actor.h"

uclass AExampleHello : AActor meta: api=EXAMPLES_API
{
prop public FName Message EditAnywhere BlueprintReadWrite category="Example" default="Hello from TPScript!"
prop public bool bShowOnBegin EditAnywhere BlueprintReadWrite category="Example" default=true

method public virtual void BeginPlay() override {
Super::BeginPlay();
if (bShowOnBegin)
{
UE_LOG(LogTemp, Warning, TEXT("%s"), *Message.ToString());
}
}

method public virtual void Tick(float DeltaTime) override {
Super::Tick(DeltaTime);
}
}

Generated header (AExampleHello.h)​

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "AExampleHello.generated.h"

UCLASS()
class EXAMPLES_API AExampleHello : public AActor
{
GENERATED_BODY()

public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Example")
FName Message = TEXT("Hello from TPScript!");

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Example")
bool bShowOnBegin = true;

virtual void BeginPlay() override;

virtual void Tick(float DeltaTime) override;
};

Generated source (AExampleHello.cpp)​

#include "AExampleHello.h"

AExampleHello::AExampleHello()
{
PrimaryActorTick.bCanEverTick = true;
}

void AExampleHello::BeginPlay()
{
Super::BeginPlay();
if (bShowOnBegin)
{
UE_LOG(LogTemp, Warning, TEXT("%s"), *Message.ToString());
}
}

void AExampleHello::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}

Key properties of generated code​

  • UHT-ready - headers include <Name>.generated.h and use GENERATED_BODY().
  • Idiomatic - defaults appear as C++ brace-or-= initializers, Category is set from category=, specifiers map to EditAnywhere/BlueprintReadWrite, etc.
  • Super:: preserved - the emitter keeps your Super:: calls, so BeginPlay/Tick override correctly.
  • Deterministic - the same .tps always produces the same output, so code review diffs are clean.

API macro​

The EXAMPLES_API in the generated header comes from meta: api=EXAMPLES_API. It must match the module name uppercased (TPSGENERATED_API for module TpsGenerated, TPSCRIPTKIT_API for TpscriptKit, etc.).

No .generated.h in your hands​

Because TPScript also handles module boilerplate and categorization, you rarely touch the generated files - you edit .tps, regenerate, compile.

Next: Networking & replication.