Skip to main content

Editor Workflow

This page covers everything the editor plugin adds and how to use it day-to-day.

The Tools menu​

Under Tools → TPScript you'll find:

CommandWhat it does
Run RegenerationTranspile every .tps source into UE5 C++ modules
Open TPScript PanelOpens the dockable TPScript panel
CompileTranspile, then compile (Live Coding when available)
Open TPScripts FolderOpens the project TPScripts/ folder in Explorer (creates it if missing)

There is also a TPScript button in the Level Editor's Play toolbar (refresh icon) that runs a quick regeneration.

The TPScript panel​

A dockable panel (tab name TPScript) with three views:

Edit​

  • A list of Modules (each module is a folder under Source/ that contains a .tpscript-manifest.json).
  • A multi-tab code editor with:
    • Save / Save All / New / Close
    • Dirty-state tracking (a * next to modified tabs)
    • A status bar showing the path, [Modified], and line count
    • An Output Log
  • Regeneration buttons:
    • Regenerate All - every module that has a manifest
    • Regen Module - the selected module only
    • Regen This File - only the currently open mechanic (writes just that mechanic's files, without touching others)

Files are auto-saved before a regeneration runs.

Examples​

  • Browse the plugin's Examples/*.tps list. Double-click one to open it in the editor. Examples are teaching files - copy one into your project's TPScripts/ folder to make it a real mechanic.

Docs​

  • Renders the plugin's Docs/*.md as styled Slate widgets: headers, tables, code fences, bold, inline code, blockquotes, and lists all render in the panel. A fast reference if you don't want to leave the editor.

Regeneration mechanics​

TPScript discovers modules by looking for a .tpscript-manifest.json inside Source/<Module>/. This manifest tracks:

  • module - the module name
  • sources - the .tps files that feed it
  • generated - every file the module produced (used for deterministic stale-file cleanup)

Sources are resolved from <Project>/TPScripts/**/*.tps. The demo module falls back to bundled corpus files so the examples always work.

Generated output is categorized into Public/<Category>/ and Private/<Category>/ based on the header kind and base class:

Actors, Components, Characters, AI, Game, UI, Player, Data, Camera, Weapons, Interactions, Pickups, Structs, Interfaces, …

When a module doesn't exist yet, TPScript creates its boilerplate: <Module>.Build.cs, <Module>.h, and <Module>.cpp. The generated Build.cs warns about required public dependencies (Core, CoreUObject, Engine, InputCore, EnhancedInput) and private dependencies (UMG, Slate, SlateCore, AIModule, GameplayTasks, GameplayTags, NavigationSystem).

The regeneration workflow​

The intended daily rhythm:

  1. Put .tps files in <Project>/TPScripts/.
  2. Open Tools → TPScript Panel.
  3. Click Regenerate All (creates the module + manifest + boilerplate the first time).
  4. Click Compile (or Live Coding / IDE build).
  5. Iterate on a single mechanic with Regen This File.

The api= meta - matching module API macros​

Generated classes use an API macro that must match the module name uppercased:

ModuleAPI macro
TpsGeneratedTPSGENERATED_API
TpscriptKitTPSCRIPTKIT_API
ExamplesEXAMPLES_API

If a class is used across modules, keep meta: api=<MODULE>_API in sync with the module name. Examples in this repo use the module of the demo corpus.

Troubleshooting​

  • "No modules found" - make sure your .tps files are in TPScripts/ and that a build has produced a Source/ folder. Run Run Regeneration once to create the manifest.
  • Generated code doesn't compile - check that you enabled all required modules (e.g. EnhancedInput, NavigationSystem) referenced by your .tps. Read the generated Build.cs for the exact list.
  • Live Coding not available - build the Editor target from your IDE (Live Coding must be enabled in your projects settings).