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.
UCrimsonSlotBindingProvider (SlotBinding/CrimsonSlotBindingProvider.h).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.
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.
See also
- Concept: Providers and Identity
- API Reference -> Providers