> ## Documentation Index
> Fetch the complete documentation index at: https://docs.summerengine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Summer Router quickstart: add a talking character to your game

> Add a guard the player can talk to, who opens the gate when convinced: make the character in Summer Studio, add one node to your scene, and play it on Summer Games.

In a few minutes your game has a guard the player can talk to. The guard decides whether to open the gate, and your game opens it.

> [!NOTE]
>
> Using a coding agent? Paste this: `Add a Summer Router character to my game (https://docs.summerengine.com/router/quickstart.md): a gate guard called "guard" who opens the gate when the player gives a good reason.`

**1. Publish your game on Summer Games**

Summer Router serves games published on Summer Games, and it is on for every game, with [caps](https://docs.summerengine.com/router/limits.md) from the start. If your game is not there yet, see [publish on Summer Games](https://docs.summerengine.com/publishing/summer-games.md). Calls are paid from your paid Summer credits, from your plan or [top-ups](https://summerengine.com/studio/credits).

**2. Make the character**

In [Summer Studio](https://summerengine.com/studio), open your game, then **Grow > Summer Router**, and add a character:

| Field | Example |
| - | - |
| Id | `guard` |
| Instructions | You guard the north gate of a mountain town. Be gruff but fair. Open the gate only when the traveller gives a good reason. |
| First message | Halt. State your business. |
| Tools | `open_gate`, no inputs: "Opens the north gate." |
| Model and voice | Leave the defaults, or pick them from the lists |

Try the character in the tab's test conversation right away. Your agent can do this step too: on the Summer MCP it saves the character with the `router.save_character` operation, and you approve the change.

**3. Add the character to your scene**

Add a **SummerRouterCharacter** node, name it `Guard`, and set **Character ID** to `guard`, **Mode** to `text` and **Show UI** on. Show UI gives the player a bar with the guard's words and a text field. Then give the guard its tool and an offline line:

```gdscript level.gd theme={null}
extends Node3D

func _ready() -> void:
    $Guard.tools = {"open_gate": func(_args): $Gate.open(); return {"opened": true}}
    $Guard.turn_failed.connect(func(_result): $Subtitle.text = "The guard ignores you.")
```

Turn **Speak** on and each answer is also spoken in the guard's voice.

**4. Play it**

Upload the build to Summer Games and play it in the Summer app or on summer.games, signed in. The bar shows the guard's first message; type an answer. When you convince the guard, the gate opens.

In the editor, Summer Router calls answer `unavailable` and the guard uses its offline line, so your game always runs. Shape the character in Studio's test conversation, and play the real thing on Summer Games.

## One call instead of a node

The node runs a whole conversation. For a single line, call the router directly:

```gdscript theme={null}
var r: SummerRouterResult = await Summer.client.router.reply("guard", "Let me in, I have a letter for the mayor.", {
    "tools": {"open_gate": func(_args): $Gate.open(); return {"opened": true}},
})
$Subtitle.text = r.text if r.ok else "The guard ignores you."
```

Pass the same `conversation_id` from `r.conversation_id` on the next call, and the guard remembers what was said.

## More you can do

* **A voice line:** `await Summer.client.router.speak("Welcome, traveller!", {"character": "narrator"})` returns `audio` to play. See [speech](https://docs.summerengine.com/router/speech.md).
* **An image:** `await Summer.client.router.generate("image", {"prompt": "a flower made of glass", "size": "512x512"})` returns a `texture`. See [image](https://docs.summerengine.com/router/image.md).
* **What the character knows:** `variables` fill the character's declared `{{variables}}`, such as the player's name, when the character lists `variables` in its overridable fields. `context` tells it what just happened in the game.

> **[Server and client](https://docs.summerengine.com/router/server-and-client.md)**
>
> Multiplayer: let the server check a reply before it changes the world.

> **[Limits and caps](https://docs.summerengine.com/router/limits.md)**
>
> The caps every game starts with, and how to change them.

> **[Errors](https://docs.summerengine.com/router/errors.md)**
>
> Every error tag and what to do.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.