Using scripting, you can call triggers so that the chat and scenario can respond to events in the app.
Here are some examples of calling a trigger from an action:
import { chat } from "@voxta";
export function trigger(e) {
// Voxta UI Emote trigger with the emoji and color arguments
chat.appTrigger("Emote", "🌳", "#00ff00");
}
Voxta UI (Voxta.Talk)
Available triggers:
Trigger | Description |
---|---|
Emote(emoji?: string, color?: string) |
Send a message to the chat. |
SelectView(view: ChatView) |
Changes the chat mode to talk , portrait or chat . |
SetAvatar(assetPath: string, characterId?: string) |
Changes the avatar image to another using an asset from the character. |
SetAvatarFromScenario(assetPath: string, characterId?: string) |
Changes the avatar image to another using an asset from the scenario. |
PlayCharacterAudio(assetPath: string, characterId?: string, method: AudioMethod) |
Plays a sound from the character assets. |
PlayScenarioAudio(assetPath: string, method: AudioMethod) |
Plays a sound from the scenario assets. |
Types:
| Type | Description |
| ChatView
| talk
(voice only), portrait
(avatar view) or chat
(full view). |
| AudioMethod
| voice
(queued), music
(single track), sfx
(plays immediately). |
Virt-A-Mate Triggers (Voxta.VirtAMate)
See Virt-A-Mate for more information.