Running your own code after a sync
The two editor-module delegates that fire when a sync and its generation finish — for validation, custom imports, or extra generation of your own.
All documentation — Extending
Start here
Concepts
Authoring for a build
Playing a story
The generated assets and code
The plugin and sync
A sync is two things in sequence: the sync service drives the sync tool and turns what it wrote into the payload asset; the asset generator then turns the payload into the stores, the indexes, the tags and — when it is on — the typed C++. Each announces its end on a multicast delegate, on the game thread, and both are reachable from an editor module of your own.
Reaching them
#include "TaleShardEditorModule.h"#include "TaleShardSyncService.h"#include "TaleShardAssetGenerator.h"
void FMyGameEditorModule::StartupModule(){ FTaleShardEditorModule* TaleShard = FTaleShardEditorModule::Get(); if (!TaleShard) { return; } SyncHandle = TaleShard->GetSyncService()->OnSyncFinished().AddRaw(this, &FMyGameEditorModule::HandleSyncFinished); GenerationHandle = TaleShard->GetAssetGenerator()->OnGenerationFinished().AddRaw(this, &FMyGameEditorModule::HandleGenerationFinished);}Remove the handles in ShutdownModule; the plugin’s module may outlive yours.
What each one tells you
On Sync Finished — the sync tool ran, or was refused, or was cancelled. The result carries:
| Field | Meaning |
|---|---|
| Success | the run ended without an error |
| Up To Date | nothing changed since the last sync |
| Full Sync | the run was a full sync rather than a delta |
| Cancelled | the user stopped it |
| Error Message | why it failed, or empty |
| Diagnostics | everything the run reported, with codes |
The payload asset has been replaced by then — and only by a payload that parsed; a run that fails writes nothing half-way.
On Generation Finished — the assets are written, or the generation was skipped or refused:
| Field | Meaning |
|---|---|
| Success, Skipped, Skip Reason, Error Message | what happened |
| Diagnostics | everything the generation reported. A generation with any error is a failed generation |
| Assets Written, Assets Deleted, Tags Written, Redirects Written, Tag Ini Changed | what it did to your project |
The generator listens to the sync service’s own delegate and runs after every successful sync, so this is the one to bind if your code reads the generated assets: by the time it fires, the indexes and stores are on disk and registered.
What to do there
- Validate. Walk the entity index or the payload and refuse your own rules — a character with no portrait, a board with no start — and print the finding with the sync’s own diagnostics.
- Import. Build assets of your own from the generated ones: a data table your systems read, a lookup you precompute.
- Generate. Emit source or assets of your own from the same payload. Write into a folder you own; the plugin sweeps only what its own manifest recorded, and never yours.