> For the complete documentation index, see [llms.txt](https://docs.siminsights.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.siminsights.com/hyperskill-studio-authoring/state-machine-reference/actions/ai-chat/how-to-author-the-chat-box-in-a-simulation.md).

# How to Author the Chat Box in a simulation

This page walks through adding Chatbox actions to a state. For the settings of each action, see also [AI Chat](/hyperskill-studio-authoring/state-machine-reference/actions/ai-chat.md). A detailed explanation of controls and interface functions is 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="https://2704613365-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxYaaXoZ4YGbVdAnAhdcE%2Fuploads%2FRSi4HiMbgkrCSN0jhTnb%2F125.png?alt=media&#x26;token=5c6b1f89-c952-4d9d-886f-2cec40373250" alt=""><figcaption></figcaption></figure>

3. Select a Chatbox action from the dropdown provided:

* **Set Data** sets the avatar picture and voice of an NPC, or of the player.
  * “Is Player” designates whether the data being set is the player's.
  * “Name” appears when Is Player is false and designates which NPC is changed.
  * “Voice” lets you select from a subset of voices used when a message is spoken.
  * “Profile Picture” lets you select an image from your media library as the NPC's profile picture. Pictures should have a 1:1 aspect ratio to prevent distortion.
* **Input Message** inputs a message that is shown as spoken by a third party or by the player.
  * “Is Player” designates whether the message is implied to be spoken by the player or by a third party.
  * “Name” appears only when Is Player is false and designates the NPC's name.
  * “Message” is the message that the system inputs into the chatbox.
  * “Speak” controls whether the system uses Text To Speech in combination with the text.
* **Input System Message** inputs a message that appears as a system message.
  * “Speak” controls whether the system uses Text To Speech in combination with the text.
* **Open** opens the chat box.
* **Close** closes the chat box.
