Dynamic context quick start
Push a state property and a context event to a connected Convai character in Blueprint and verify the update reaches the context pipeline.
Push one state and one event to a Convai character from Blueprint, then confirm the update is stored locally before you test it in conversation.
State
A current fact that can be replaced
Health is 50
Event
A one-time moment in the session
Alarm triggered in sector 4
Prerequisites
Before starting, verify:
Push a state update
Track the player's health so the character can reference it when asked.
Call Set Context State
Drag from the Convai Chatbot reference pin and search for Set Context State. Connect it to the TestHealthUpdate event execution pin.
Set the node pins as follows:
Name
Health
Value
50
Should Respond
Never
Leave bFlushImmediately at its default (false).
Should Respond = Never stores the value without requesting a spoken response on every health change.
Confirm the local tracker accepted the value
Drag from the output execution pin of Set Context State and add Get Context State Value. Set Name to Health, then print OutValue and the boolean return value with Print String.
Compile the character Blueprint. At runtime, the return value should be true and OutValue should read 50. This confirms the local tracker accepted the update before any network flush.
Push an event update
Notify the character that an alarm has been triggered. Events record one-time moments; they are not replaced like state values.
Trigger the update from gameplay
Call TestHealthUpdate from any Blueprint graph that already has access to the character Actor.
Test in Play In Editor
Check local values and allow the debounce window
Check the debug output from Get Context State Value. The return value should be true and OutValue should read 50.
By default, the plugin waits 0.5 s (ContextDebounceWindow) after the last staged update before sending to Convai. Allow at least one debounce cycle before the conversation test that depends on this context.
Verify in conversation
Speak to the character or use text input. Ask How is my health? or What is happening in the facility? as an end-to-end runtime test after the debounce window has elapsed. Exact response wording depends on the character configuration.
If the character does not reference either value, see Troubleshoot dynamic context.
Next steps
Read How dynamic context works for the mental model, then Dynamic context usage examples for more Blueprint patterns.
Last updated
Was this helpful?