Commands

How player input is understood, and how to add your own commands.

A command is something the player can type, plus what the game does when they type it. GoNorth already understands the usual ones — get, drop, examine, go and so on. Add your own commands to create new ones (pray, knock), or to change how a built-in one behaves.

Commands can belong to the whole adventure, one location, one item, or one character. When the player types something, GoNorth checks them in this order:

  1. The location's commands.
  2. Commands belonging to characters in the room.
  3. Commands belonging to items in the room or being carried.
  4. The adventure's commands.
  5. GoNorth's built-in commands.

A command can have several phrasings — different ways the player might say it (pray, kneel, pray to the priest). Each phrasing is written in a small pattern syntax, described below.

A note on words: in this Help and in the Designer's Code view, the matching rules are written in pattern syntax, and command files have the extension .patterns. In the Designer's Visual view, each pattern is shown as a phrasing of a command.

How It Works

When a player types something, GoNorth checks it against the phrasings of every command — rules that describe what the player might type. The first phrasing that matches wins.

GoNorth ships with a comprehensive set of built-in commands covering all standard adventure verbs. You can extend or override these for your specific adventure.

Pattern Syntax

Basic structure

action - pattern
action outcome - response template

Lines starting with # are comments. Lines with just an action name and a pattern define how input is matched. Lines with an action name plus an outcome define what to say back.

Token types

SyntaxMeaningExample
[a|b|c]Required — one of these must appear[take|get|grab]
{a|b|c}Optional — may or may not appear{the|a}
ROLE=[a|b]Required, captured as ROLEVERB=[take|get]
ROLE={word}Optional wildcard — any single wordADJECTIVE={word}
[ITEM]Matches any visible item nameNOUN=[ITEM]
[ITEM:plural]Matches plural forms and "all items"NOUN=[ITEM:plural]
QUANTITY=[all|everything]Bulk request. When a get or drop pattern captures a QUANTITY role the engine takes (or drops) every eligible item and offers each item to its own OnPickUp/OnDrop script (which decides whether it is taken or dropped). The built-in patterns already cover take/get/grab/collect/pick up all|everything and drop/put down/leave/discard all|everythingVERB=[take|get] QUANTITY=[all|everything]
[NPC]Matches any NPC in the current locationTARGET=[NPC]
[DIRECTION]Matches any available exit directionDIR=[DIRECTION]
Note: Unknown words between tokens are automatically skipped. So "please just grab the old silver coin" still matches [take|get|grab] {the} ADJECTIVE={word} NOUN=[ITEM] because "please", "just" and "old" are silently ignored.

Multiple phrasings per command

You can define several phrasings for the same command. Any of them can trigger it:

get - VERB=[take|get|grab|pick up] {the} ADJECTIVE={word} NOUN=[ITEM]
get - {the} NOUN=[ITEM] [is mine|are mine]
get - VERB=[grab] {it|that}

Response Templates

Each action has one or more outcomes (succeed, failed, ambiguous, already, cant). For each outcome you can define multiple response lines — GoNorth picks one at random, never repeating the same one twice in a row.

The complete list of actions and outcomes is in Reference → Respond. Scripts can print any of these replies with Respond("action", "outcome").

Substitutions

TokenReplaced with
[NOUN]The word the player typed for NOUN
[NOUN.Name]The matched item's name
[NOUN.ShortDesc]The matched item's short description (write it as a noun phrase such as small brass key, so it reads well in a sentence)
[TARGET.Name]The NPC or target item's name
[ADJECTIVE]The captured adjective word
[MATCHES:list]List of ambiguous matches, e.g. "the silver coin or the gold coin"
[INVENTORY:list]Player's carried items
[DIRECTION]The matched direction

Conditional text

get failed - There's no [NOUN] here.[CODE:if [ADJECTIVE].exists ' Not even a [ADJECTIVE] one.']

The [CODE:if [ROLE].exists 'then text' else 'else text'] syntax includes text only if the named role was captured. The else part is optional.

Outcome types

OutcomeWhen used
succeedAction completed successfully
failedPhrasing matched but the command couldn't be carried out (no item, locked etc.)
ambiguousTwo or more items matched — player needs to be more specific
alreadyAlready in the desired state (e.g. already carrying the item)
cantThe item exists but can't be interacted with this way
nonounNo matching item found at all
notargetTarget of the action not found
succeedall / failedallBulk get/drop ("take all", "drop everything"): something was moved / nothing could be. Use [MATCHES:list] in the response to name the items that moved. Take-all skips scenery and other non-pickable items and anything inside a closed container
Note: A known verb with nothing after it ("take") gets the action's nonoun reply, and a known verb followed by a word that matches nothing ("take zzz") gets its failed reply with those words as [NOUN]. Only input that doesn't start with a known verb reaches OnInputError.

Adding Your Own Commands

Open Tools → Commands (F9) to add commands to your adventure. These are merged over the built-in commands — a command with the same action name replaces the built-in one for that action.

Command with response text only

The simplest form — define the words and the response text. No scripting needed:

# A custom action unique to this adventure
pray - VERB=[pray|kneel|worship] {at|before|to} {the} TARGET=[NPC]
pray - VERB=[pray|kneel]

pray succeed - You kneel and pray. A warm feeling washes over you.
pray succeed - Your prayers echo in the silence.
pray failed  - There is no deity here to hear you.

Multiple succeed lines are picked at random with no-repeat selection. The engine tries phrasings top to bottom — more specific first.

Command with an outcome script

Add a .script suffix to an outcome name to run code alongside the response text. The response text is shown first, then the script runs:

pray - VERB=[pray|kneel|worship] {at|before|to} {the} TARGET=[NPC]
pray - VERB=[pray|kneel]

pray succeed - You kneel and pray. A warm feeling washes over you.
pray succeed - Your prayers echo in the silence.
pray failed  - There is no deity here to hear you.

pray succeed.script -
    Game.Variable(GodsArePleased) = true
    Player.Score += 5
    if Input.TargetNPC.Exists and Input.TargetNPC.Name = "Priest" then
        NPC("Priest").Say("The gods smile upon you, traveller.")
    endif

pray failed.script -
    Game.Variable(GodsArePleased) = false
    if chance(30) then OutputText("A cold wind passes through the chapel.")
Key points:

Command + Global Script override

For longer or more complex logic, define the phrasings in the command file and put all the code in a Global Script with the action name as the key. This is equivalent to overriding the built-in handler for that action across the whole adventure:

# Adventure commands — phrasings only
pray - VERB=[pray|kneel|worship] {at|before|to} {the} TARGET=[NPC]
pray - VERB=[pray|kneel]

Then in Adventure Settings → Global Scripts, add key pray:

if Input.TargetNPC.Exists and Input.TargetNPC.Name = "Priest" then
    NPC("Priest").Say("The gods smile upon you, traveller.")
    Game.Variable(GodsArePleased) = true
    Player.Score += 5
elseif Location.Name = "Temple of the Sun" then
    OutputText("A warm feeling fills you.")
    Game.Variable(GodsArePleased) = true
else
    OutputText("Nothing answers your prayers.")
endif

Overriding a built-in action

Add a Global Procedure whose key matches a built-in action name (get, drop, examine, go, etc.) to intercept that action adventure-wide. Use Input.Continue for cases you don't want to handle — control passes to the engine's default behaviour:

# GlobalProcedures["get"] — intercept coin pickup for economy tracking
if Input.Noun = "coin" and Input.NounItem.Exists then
    if Input.HasAdjective("gold") then
        Game.Variable(Money) += 10
        OutputText("You pocket the gold coin. (+10 gold)")
    elseif Input.HasAdjective("silver") then
        Game.Variable(Money) += 1
        OutputText("You pocket the silver coin.")
    endif
    Player.GiveItem(Input.NounItem.Name)
    exit   # handled — stop here
endif
Input.Continue   # not a coin — engine handles normally

Location-specific commands

Commands defined on a Location take priority over everything else. Use them to block or redirect specific commands in one room:

# Location command — "get" in the temple treasury
# Pattern: get|take|grab
if Input.NounItem.Name = "Sacred Chalice" then
    OutputText("A force repels your hand. The chalice cannot be taken.")
    exit
endif
Input.Continue   # everything else falls through to engine

Handler priority — who runs first

PrioritySourceHow to add
1 (highest)Location command inline scriptLocation Editor → Commands tab
2Item command inline scriptItem Editor → Commands tab
3NPC command inline scriptTools → Commands (F9), type NPC
4Adventure commandsTools → Commands (F9), type Global
5GlobalProcedures["action"]Adventure Settings → Global Procedures
6 (lowest)Engine built-in handlerAlways runs if nothing stopped it

Specific Here, General Everywhere Else

If a command only works in one place, put the real command on that location, and put one fallback command in the adventure's commands for everywhere else. Location commands are always checked first, so the fallback never gets in the way. You don't need to copy the command into every room.

The same idea works for items. When an item does something special in one place, put the special case on the location (location commands win), and the general behaviour on the item. Use an adventure command only for the case where the player doesn't have the item yet. If the player names an item they have already seen but left behind, GoNorth says where they last saw it (or runs the item's OnAbsent script).

Direction Shortcuts

Players can type single-letter shortcuts for the eight compass directions plus up and down. These are defined in the language file and work alongside the full direction words:

ShortcutDirectionAlso accepts
nNorthnorth, go north, walk north, head north
sSouthsouth, go south, walk south
eEasteast, go east, walk east
wWestwest, go west, walk west
neNortheastnortheast, north-east, go ne
nwNorthwestnorthwest, north-west, go nw
seSoutheastsoutheast, south-east, go se
swSouthwestsouthwest, south-west, go sw
uUpup, climb up, ascend, upstairs
dDowndown, climb down, descend, downstairs
x(examine)examine, inspect, look at
l(look)look, look around
i(inventory)inventory, items, what am I carrying
z(wait)wait, rest, do nothing
g(again)again, repeat, redo
Note: Direction shortcuts are language-specific. French uses o for ouest (west), German uses o for Ost (east). The shortcuts are defined in each language's directions.patterns file.

Language Files

GoNorth uses a language file system that separates player-facing text from the game engine. This makes it straightforward to localise your adventure.

Language file structure

GoNorth.Core/Resources/Languages/
  en-GB/
    default.patterns      ← verbs and action patterns
    directions.patterns   ← movement and direction shortcuts
    responses.patterns    ← all response text templates
  en-US/
    responses.patterns    ← American English text overrides only
  fr-FR/
    default.patterns      ← French verbs
    directions.patterns   ← French direction words
    responses.patterns    ← French response text

Setting the language

In Adventure Settings → General → Language code, enter an IETF language tag:

CodeLanguage
en-GBBritish English (default)
en-USAmerican English
fr-FRFrench
de-DEGerman

Fallback chain

If files for a specific language don't exist, the engine falls back gracefully: en-AU → en → en-GB → built-in defaults.

Keyword aliases and method names

You can safely use any word as a keyword alias — even words that are also engine method names like stop, drop, say, or move. The engine uses contextual keyword classification:

# All of these work correctly even if "stop", "say", "drop" are keyword aliases:
Daemon.Stop("BombFuse")
Audio("explosion").Stop
NPC("George").Say("Hello!")
Item("sword").Drop()
Player.Move(4)

If an alias overlaps with an engine method name, the Preferences dialog shows an informational note — not an error. Your scripts will still work correctly.

Built-in Commands

GoNorth includes commands for all these actions out of the box:

ActionExample phrases
gettake, get, grab, pick up, collect
dropdrop, put down, leave, discard
putput X in Y, place X inside Y
useuse, activate, apply, operate
givegive X to Y, hand X to Y
breakbreak, smash, destroy, hit, bash
eateat, consume, munch, devour
drinkdrink, sip, gulp, quaff
looklook, look around, where am I
examineexamine, inspect, look at, study
readread, peruse
listenlisten, listen to, hear
talktalk to, speak to, chat with
ask / tellask X about Y, tell X about Y — resolves against the target NPC's Topics
topicstopics, subjects, what can I ask
hinthint, hints
recaprecap, journal, quick recap, quick journal, last entry
openopen, prise open, force open
closeclose, shut
pushpush, shove, press
pullpull, tug, yank, drag
gogo, walk, move, head, travel north/south/etc.
north etc.north, n, go north, walk north
up / downup, climb up, go up, ascend
inventoryinventory, i, items, what am I carrying
waitwait, z, rest, do nothing
helphelp, ?, commands, what can I do
savesave, save game, quicksave
quitquit, end, finish, exit game
Tip: Open Tools → Commands (F9) and filter by type Default to see the exact phrasings of the built-in commands. You can copy and modify them as a starting point for your own commands.