Module & output model
How TPScript files map to modules and to generated C++ files.
The two styles
| Concept | Low-level | High-level |
|---|---|---|
| Class keyword | uclass AX : AActor | class x extends actor |
| Property | prop public FName Tag | prop public tag: name |
| Method | method public void Foo()... | run foo()... |
| Which UE symbols | explicit (APawn, UUserWidget...) | friendly aliases (actor, pawn, player_controller, ...) |
| When | exact C++/networking control | fastest authoring |
Both emit the same kind of C++ and can coexist.
meta: api= - the export macro
uclass AHero : ACharacter meta: api=MYGAME_API
The api= value must match your module's macro (module name uppercased + _API):
- Module
TpsGenerated→TPSGENERATED_API - Module
Examples→EXAMPLES_API - Module
TpscriptKit→TPSCRIPTKIT_API
Module routing
The editor separates configured modules (e.g. TpsGenerated, Examples). When you Regenerate All / Regenerate This File, generated .h/.cpp are routed into the Public/Private of the selected module under matching subdirectories.
Generated file naming
For AExampleHello:
Public/.../AExampleHello.hPrivate/.../AExampleHello.cpp
Header includes <Name>.generated.h and GENERATED_BODY(); default values appear as C++ initializers.
Example file markers
On regen the panel shows per-file status: [NEW], [UPD], [==], [DEL] - so you can see exactly what changed.
The .tps → C++ pipeline
.tps ──parse──▶ AST ──emit──▶ .h / .cpp ──UHT----▶ engine build
TPScript handles the Unreal boilerplate (UCLASS/UPROPERTY/UFUNCTION/GENERATED_BODY) so you only write the interesting parts.
Next: Best practices.