Skip to main content

Talking NPCs

A world feels alive the moment someone in it talks to you. In this recipe you'll add an NPC (a computer-controlled character) that spawns into your world, turns to face whoever walks up, and runs a proper click-through conversation like a quest-giver in a real game. At the end you'll get a taste of letting the NPC improvise a line with AI. This is the build behind guides, shopkeepers, tutorial helpers, and story characters.

What you'll build: a scripted NPC that appears when the room starts, faces any player who interacts with it, and speaks a short dialog you wrote, then a bonus where it greets players in its own words.

New here?

A block is a puzzle piece you snap together. An event is a "when this happens" block that starts a script. If those are new, start with A button that does something.

Two kinds of NPC, pick the right one

An NPC (short for "non-player character") is any character in your world that isn't a real person. Hideout has two completely different kinds, and scripting only drives one:

KindWhat it isWho controls it
AI NPCA character with a real AI brain. It looks around, remembers, and decides for itself.Itself. You can't script it.
Scripted NPCA puppet. It has no mind. It only moves, turns, and talks when your blocks tell it to.You, every action is a block.

This guide is all about scripted NPCs. Think of a scripted NPC as a stage actor reading your script, versus an improv performer making it up. Predictable, repeatable, free, and perfect for a quest-giver who should always say the right thing.

Block snippetAn AI NPC thinks for itself and ignores your blocks. A scripted NPC is a puppet that only does what your blocks tell it. This guide drives the puppet.
Players can't tell the difference

On screen, a scripted NPC looks exactly like an AI one, same body, same animations. The difference is entirely behind the scenes: who's pulling the strings.

Step 1: Create your NPC (the cast list)

Before a script can control an NPC, the NPC has to exist. You make it in the NPCs panel inside the scripting editor.

  1. Open the NPCs panel and add one

    Enter build mode, open the scripting editor, and open the NPCs panel from the top bar. Under Scripted NPCs, click New NPC. Give it a name (say, Guide), an optional bio, and dress it up however you like. Save.

    That's it. Your NPC is now in the room's "cast list." It isn't in the world yet (you'll spawn it with a block), but scripts can now find it by name.

    Under the hood: "scripted" means puppet

    Behind the scenes this gives the NPC a scripted brain: no AI, no auto-spawn, no wandering off. It does nothing at all until a block tells it to. That's what makes its behaviour reliable.

Step 2: Spawn the NPC into the world

A scripted NPC starts off-stage. Spawn is the block that brings its body into the world, and you must spawn it before it can walk, turn, or talk.

  1. Spawn it when the room starts

    From the Events category, drag out when room starts. It fires once when the room boots up.

    When Room StartsRuns once when the room starts. The natural place to bring your NPC on stage.

    Under it, snap a spawn NPC block from the NPCs category.

    Spawn NPCBrings the NPC's body into the world at a coordinate, facing a direction.
  2. Choose the NPC and where it appears

    In the NPC slot, pick your Guide from the picker. That picker is an NPC value block that points at one specific character in your cast.

    NPCPoints at one specific scripted NPC from your room's cast list.

    Then set the location, a coordinate where the NPC should stand. Use the coordinate picker's Point mode to click the exact tile. You can also set a starting facing (north / east / south / west); the default is south, which faces toward the camera.

    Spawning twice is safe

    Spawn is idempotent, a fancy word meaning "safe to run again." If the NPC is already there, spawning just re-places it. So when the room restarts and when room starts fires again, you won't end up with two NPCs.

Gotcha: spawn first, always

Every other NPC command (walk, face, say, even the AI one) fails silently if the NPC isn't spawned. If your NPC seems mute or frozen, the usual cause is that it was never spawned. Spawn is the one block that actually creates the body.

Step 3: Face the player who walks up

Now let's make the NPC react when a player interacts with it.

  1. Use 'when NPC is interacted with'

    From the Events category, drag out when NPC is interacted with. It fires when a player walks up to a scripted NPC and interacts.

    When NPC Is Interacted WithFires when a player walks up to and interacts with a scripted NPC.
    Under the hood: you have to be close

    Interacting means walking up to the NPC, not clicking from across the map. The player must be within 8 tiles. Tick highlight when nearby on this block and add a hint like Talk to the Guide so players know they can interact.

  2. Turn the NPC to face the player

    Under the hat, snap a turn NPC to face block from the NPCs category. It rotates the NPC without moving it.

    Turn NPC To FaceTurns the NPC to a compass direction. Handy for making it face the player.

    Pick your Guide as the NPC, and choose a facing direction. A small, polished touch that makes the NPC feel like it's paying attention to whoever just walked up.

Step 4: Run a click-through dialog

Here's the centrepiece: a cinematic NPC dialog, the big quest-giver panel with the NPC's portrait, a line of text, and "click to continue." It takes over the screen and waits for the player to read and click, just like a real game.

  1. Add the NPC dialog block

    Still under the when NPC is interacted with hat, snap an NPC dialog block from the Cinematic category.

    NPC DialogA full-screen, click-through conversation panel with the NPC's portrait. Add lines with its + button.

    Set the NPC field to Guide. Type your first line into the text field, something like Welcome, traveller! Looking for the secret door?.

    Use the block's + button to add more lines. Each line is its own step the player clicks through, and each can show a little emote. You can have up to 32 steps, and each line can be up to 280 characters.

  2. Choose who has to click 'next'

    The dialog has an advance when dropdown that sets who gets to click through it:

    • starter clicks (the default): only the player who triggered it advances. Perfect for a one-on-one chat.
    • any viewer clicks: the first person to click moves it along for everyone.
    • all viewers click: everyone watching must click before it advances.

    For a personal quest chat, the default starter clicks is exactly right.

    Under the hood: the dialog pauses the script

    This is the one cinematic block that stops the script and waits. Nothing stacked after the dialog runs until the player has clicked all the way through it (or a timeout, 30 seconds per step by default, passes). So put follow-up actions, like giving a reward, after the dialog, knowing they run once the conversation finishes.

  3. Save and walk up to your NPC

    Save, leave build mode, and walk up to the Guide. Interact with it, the NPC turns to face you and the dialog panel slides up with its portrait and your first line. Click to read each step. You've got a talking quest-giver!

Two ways to make an NPC talk

The dialog panel is the cinematic, takes-over-the-screen version. For a quick word balloon over the NPC's head instead (no panel, no pause) use the NPC says block. It speaks an exact line (up to 100 characters) as a chat bubble. Great for ambient chatter; the dialog panel is for story beats.

NPC SaysA quick speech bubble over the NPC's head. An exact line, no panel, no pause.

Bonus: let the NPC improvise (a taste of AI)

Everything so far has the NPC say exactly what you typed. There's also a block where you write an instruction and the AI writes the line, so the greeting is a little different each time.

  1. Add 'NPC replies with AI to'

    From the NPCs category, drag out NPC replies with AI to.

    NPC Replies With AI ToYou give an instruction; a small AI writes one short, in-character line for the NPC to speak.

    Pick your Guide, and in the prompt type an instruction (not the words themselves), like Greet the player warmly and tease that there's treasure nearby. The AI turns that into a single in-character line, using your NPC's name and bio for flavour.

How NPC says and NPC replies with AI to differ, side by side:

NPC saysNPC replies with AI to
You provideThe exact wordsAn instruction
Who writes the lineYouA small AI
Same every time?YesNo, improvised
Cost / speedFree, instantUses an AI request; arrives a moment later
Pauses the script?NoNo (it speaks in the background)
Gotcha: use AI lines sparingly

AI replies have limits: a room can make about 10 per minute, and each NPC can only work on one at a time. Think of them as a flavour topping, not your main dialog. For anything that must be exact (quest steps, lore, jokes) use NPC says or the dialog panel. Save AI for a warm, slightly-different-each-time hello. More in NPCs.

What you just made

Block snippetThe four moves in order. Spawn is the load-bearing one. Face and dialog quietly do nothing until the NPC's body is actually in the world.

Four moves, one living character:

  1. Created a scripted NPC in the NPCs panel.
  2. Spawned it into the world when the room starts.
  3. Made it face any player who interacts with it.
  4. Ran a click-through dialog, and saw how to let it improvise with AI.
Say it out loud

"When the room starts, spawn the Guide. When a player interacts with it, turn it to face them and run the dialog." If the sentence makes sense, the blocks do too.

When it doesn't work

SymptomLikely causeFix
NPC never appearsIt was never spawnedAdd a spawn NPC under when room starts
NPC won't talk / turnEverything but spawn fails if it isn't spawnedMake sure the spawn ran first
Interacting does nothingYou're more than 8 tiles awayWalk right up to the NPC
Dialog won't advance"advance when" is set to all viewers click and someone hasn'tUse starter clicks for a solo chat
Block after the dialog runs lateThe dialog pauses the scriptThat's expected; it runs once the dialog finishes
AI line doesn't appearHit the 10/minute room limit, or one's already in flightWait a moment, or use NPC says for guaranteed lines

What's next?