Skip to main content

TPScript for Unreal Engine 5

TPScript is a native editor plugin for Unreal Engine 5.8 that turns compact, readable .tps source files into real Runtime C++ - directly inside the Unreal editor.

uclass AHelloWorld : AActor meta: api=MYGAME_API
{
prop public FString Greeting EditAnywhere BlueprintReadWrite category="Hello" default="Hello, TPScript!"

method public virtual void BeginPlay() override {
Super::BeginPlay();
UE_LOG(LogTemp, Warning, TEXT("%s"), *Greeting);
}
}

Write the logic in a friendly, minimal language. Hit Regenerate. Get a genuine AHelloWorld.h / AHelloWorld.cpp that you can compile into your project and use in Blueprints - with zero boilerplate and zero stubs.

Why TPScript?​

Most gameplay scripting in Unreal falls into two camps:

  • Blueprints - visual, fast to iterate, but slow at runtime and hard to keep clean at scale.
  • C++ - fast and powerful, but verbose: every UPROPERTY, UFUNCTION, UCLASS macro, every constructor, every include.

TPScript gives you a third path: the ergonomics of a scripting language with the runtime cost and power of compiled C++. The transpiler emits idiomatic, UHT-compatible C++ that reads the way a senior UE engineer would write it - because it is that C++.

What it produces​

Every .tps file transpiles into real generated files inside your project's C++ module:

  • Public/.../*.h - generated headers (UCLASS, UPROPERTY, UFUNCTION, USTRUCT, etc.)
  • Private/.../*.cpp - generated implementations

These are ordinary UE C++ files. You can:

  • Drop them into a normal module and compile with Live Coding or your IDE.
  • Use every property, function, and event from Blueprint (if you expose them).
  • Extend or override them with hand-written C++.
  • Refactor mechanically - change a .tps file and regenerate rather than editing C++ by hand.

Two ways to write​

TPScript supports two grammar styles, and you can mix them in a single file:

StyleLooks likeBest for
High-levelclass my_actor extends actor { ... }Beginners; fast prototyping; friendly type names like count, number, text
Low-leveluclass AMyActor : AActor { ... }Power users; exact C++ types, UE specifiers, replication, full control

Both styles compile to the same high-quality C++.

Where things live​

ItemLocation
Your .tps sources<Project>/TPScripts/**/*.tps
Generated C++<Project>/Source/<Module>/TpsGenerated/... (or your own module)
Bundled examplesPlugins/TpscriptUE5/Examples/*.tps
Built-in docsPlugins/TpscriptUE5/Docs/*.md (also rendered inside the editor panel)

No Python. No external CLI.​

The transpiler is a pure C++17 library compiled directly into the plugin module (.github/workflows/build.yml builds it on Windows and macOS). There is no python.exe dependency, no command-line tool to install, and nothing to run outside the editor. Everything happens inside the UE editor through the TPScript panel or the Tools menu.

What's next​