Skip to main content

The 15 examples

TPScript ships with 15 teaching files in Plugins/TpscriptUE5/Examples/. They form a graded tour from the absolute basics to several real UE disciplines.

Open the TPScript panel → Examples tab and double-click any file to load it in the editor; then Regen This File to generate the C++.

The core language tour (01–08)​

#FileDomainWhat it demonstrates
01hello-actorCoreBare-bones actor: prop, method overrides, Super::, UE_LOG
02properties-and-typesTypesFriendly types → C++, field private, default=, category
03functions-and-eventsFunctionsfunc BlueprintCallable, BlueprintImplementableEvent, method + const
04componentsComponentsLow-level component UType "Name", ctor, SetupAttachment
05lowlevel-doorAdvancedReplicated-style door: delegate, timer, 3 components, clamp, broadcast
06enemy-spawnerSpawningTick-driven timer, TArray<AActor*>, BlueprintImplementableEvent
07data-driven-weaponDataustruct FWeaponStats (BlueprintType), DPS logging
08interfacesInterfacesinterface … pure, implements, override

The discipline tour (09–15)​

#FileDomainWhat it demonstrates
09ai-behaviorAIAAIController subclass, sight radius, multicast alert, current target
10ui-hudUI / UMGUUserWidget subclass, widget bindables, BlueprintCallable helpers
11animationAnimationUAnimInstance subclass, blend-space inputs, NativeUpdateAnimation
12audioAudioUActorComponent audio manager, PlaySound2D, volume stepping
13cameraCameraAPlayerCameraManager subclass, shoulder offset + FOV, easing
14data-assetDataUPrimaryDataAsset subclass, clamp=, derived DPS function
15movementMovementMovement booster, SetTimer, CharacterMovementComponent

How to use them​

Examples are teaching files - they are not part of any generated module until you use them. To make one a real mechanic:

  1. Copy the .tps into your project's TPScripts/ folder.
  2. Open the panel → Edit → select the module.
  3. Regen This File (or Regenerate All).
  4. Compile.

Every example uses the demo/EXAMPLES_API module; rename meta: api= to your module's API macro when you copy it into your own module.

Walkthroughs​

Each example has its own page explaining every line: