# How to Author the Chat Box in a simulation

A detailed explanation of controls and interface functions are described in the section [State Machine Builder User Interface](https://docs.google.com/document/d/1-o5qSv4zTkzj7YSmRTkV4zezFq7lwU00FyTy0kw1l1U/edit#bookmark=id.6vu41emx3478).

1. Within the edit Simulation section of the HyperSkill Desktop application, navigate to the State Machine tab.
2. Create a “Chatbox” state action and select the state to open up the details panel located on the right.

<figure><img src="/files/oeH7o57PNUyv92hNvItS" alt=""><figcaption></figcaption></figure>

3. Select a Chatbox action from the dropdown provided.

a. Set Data allows the player to manipulate the avatar picture and voice of one of the NPCs.

i) “Is Player” designates if the data being set is the players.

ii) “Name” appears when Is Player is false and designates which NPC is changed.

iii) “Voice” allows the user to select from a subset of voices when a message is spoken.&#x20;

iv)“Profile Picture” allows the user to select an image within their media library as a profile picture for the NPC. Pictures should be in a 1:1 aspect ratio to prevent any distortion.

b. Input Message allows the user to input a message that is shown to be spoken by a third party.

i) “Is Player” allows the user to designate if the message is implied to be spoken by the player or by a third party. \
ii) “Name” appears only when Is Player is false and designates the NPCs name. \
iii) “Message” is the message that the system will input into the chatbox.\
iv) “Speak” allows the user to control whether the system will use Text To Speech in combination with the text.

c. Input System Message allows the user to input a message that appears as a system message.\
i) “Speak” allows the user to control whether the system will use Text To Speech in combination with the text.

d. Open will open the chat box.

e. Close will close the chat box.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.siminsights.com/authoring-a-simulation/state-machine/actions/ai-chat/how-to-author-the-chat-box-in-a-simulation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
