App triggers in VAM
Drive Timeline animations and atom storables from Voxta scenarios using the chat.appTrigger API.
App triggers let your Voxta scenario reach into the VAM scene and call any action or storable param on any atom. This is the primary way the AI side controls what happens in VAM beyond just speaking.
For background on actions and scenarios in general, see Studio → App triggers — this page is the VAM-specific recipe layer.
Invoking an action trigger
The most common case: play a Timeline animation when the AI decides to.
import { chat } from "@voxta";
export function trigger(e) {
// Play a Timeline animation on the Person atom
chat.appTrigger(
'Action', // trigger kind
'Person', // atom name
'plugin#2_VamTimeline.AtomPlugin', // storable id
'Play sit_down' // action name
);
}The plugin#N_... prefix on the storable id depends on the order plugins were added to the atom. Find the exact id in VAM's Edit Mode → atom → Plugins → Custom UI of the target plugin, where the storable name is shown.
Setting a storable param
Use this for non-action params — exposing material alpha, toggling a bool, changing a float.
import { chat } from "@voxta";
export function trigger(e) {
chat.appTrigger(
'Float', // type: String | StringChooser | Bool | Float | Color
'Cube', // atom
'Mat', // storable
'Alpha', // param name
0.5 // value
);
}Types you can pass:
| Type | Use for |
|---|---|
Action | Buttons / actions on a plugin (e.g. Play <animation> on Timeline). |
String | Text params. |
StringChooser | Dropdown selections. |
Bool | Toggles. |
Float | Numeric sliders. |
Color | Color pickers. |
Common recipes
Play a Timeline animation on action
import { chat } from "@voxta";
export function trigger(e) {
chat.appTrigger('Action', 'Person', 'plugin#2_VamTimeline.AtomPlugin', 'Play wave_hello');
}Fade a light by changing a float param
import { chat } from "@voxta";
export function trigger(e) {
chat.appTrigger('Float', 'InvisibleLight', 'Light', 'intensity', 0.2);
}Toggle a bool storable
import { chat } from "@voxta";
export function trigger(e) {
chat.appTrigger('Bool', 'Person', 'geometry', 'useAdvancedColliders', true);
}Sending events from VAM back to Voxta
App triggers go AI → VAM. To go VAM → AI, use the plugin's TriggerMessage storable to send chat commands:
/event {{ user }} touched {{ char }}'s shoulder— inject a narrative event the AI will respond to./trigger my_event_name— fire a specific event by name (must match an Event in your scenario).
This is how you make in-scene interactions (a button press, a collider trigger, an animation finishing) feed back into the conversation.