How-To: Write a Provider

Goal: make a new kind of thing bindable - here, an emote by tag provider that plays a montage - so it appears in pickers, resolves after a save, and fires from a key. Any bindable thing follows the same six overrides.

Prerequisites
Concept: Providers and Identity. The base class is UCrimsonSlotBindingProvider (SlotBinding/CrimsonSlotBindingProvider.h).
Already shipped: tags
UCrimsonSlotBindingProvider_Tag binds an authored list of tags and fires the chosen one on its OnTagChosen event (and the process-wide native OnAnyTagChosen) - emotes, pings, markers with almost no code. Write your own only when you need a live catalog or custom execution.

1. Define the payload

A USTRUCT with SaveGame fields and no object pointers - it lives in the player's save.

Blueprint providers use a Blueprint struct (S_EmoteBinding with a Tag) as the payload; the base Make Instanced Struct node builds Data.

2. Subclass and answer the six questions

Create a Blueprint child of CrimsonSlotBindingProvider. Set Provider Id (unique tag) and Display Name in class defaults. Override Gather Bindable Entries (build one entry per emote: Binding.ProviderId = your id, Binding.Data = Make Instanced Struct, Display.DisplayName/Icon, FilterTags), Execute Binding (break Data, play the montage), and optionally Query Binding State (disable while a montage is already playing). Leave Resolve Binding and Get Binding Filter Tags to the base gather-and-find defaults for a small list.

Providers are stateless
One provider instance serves every player using the layout asset (and every PIE instance in-process). Never cache per-player or per-slot data in a provider; use FCrimsonSlotBindingContext (owning player, provider table, an optional cached ResolvedObject the caller keeps) and re-resolve when the hint is null.

3. Put it on a layout

Open the layout asset, Providers -> add Emotes, fill Emotes. Optionally give a bar's slots AcceptedEntries = your emote tags so only that bar accepts them.

Verify
Your picker lists the emotes under Emotes; dropping one on a slot and pressing its key plays the montage; after a save / load the slot still resolves (the base gather-and-find finds the tag again).

See also

  • Concept: Providers and Identity
  • API Reference -> Providers