Skip to main content

Module & output model

How TPScript files map to modules and to generated C++ files.

The two styles​

ConceptLow-levelHigh-level
Class keyworduclass AX : AActorclass x extends actor
Propertyprop public FName Tagprop public tag: name
Methodmethod public void Foo()...run foo()...
Which UE symbolsexplicit (APawn, UUserWidget...)friendly aliases (actor, pawn, player_controller, ...)
Whenexact C++/networking controlfastest 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.h
  • Private/.../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.