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:
- The location's commands.
- Commands belonging to characters in the room.
- Commands belonging to items in the room or being carried.
- The adventure's commands.
- 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
| Syntax | Meaning | Example |
|---|---|---|
[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 ROLE | VERB=[take|get] |
ROLE={word} | Optional wildcard — any single word | ADJECTIVE={word} |
[ITEM] | Matches any visible item name | NOUN=[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|everything | VERB=[take|get] QUANTITY=[all|everything] |
[NPC] | Matches any NPC in the current location | TARGET=[NPC] |
[DIRECTION] | Matches any available exit direction | DIR=[DIRECTION] |
[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
| Token | Replaced 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
| Outcome | When used |
|---|---|
succeed | Action completed successfully |
failed | Phrasing matched but the command couldn't be carried out (no item, locked etc.) |
ambiguous | Two or more items matched — player needs to be more specific |
already | Already in the desired state (e.g. already carrying the item) |
cant | The item exists but can't be interacted with this way |
nonoun | No matching item found at all |
notarget | Target of the action not found |
succeedall / failedall | Bulk 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 |
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.")
- The
Input.*object is available in all outcome scripts — see the Input object reference. - Multiple
.scriptblocks for the same outcome are concatenated. - If you only want code (no response text), leave the response line out and just write the
.scriptblock.
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
| Priority | Source | How to add |
|---|---|---|
| 1 (highest) | Location command inline script | Location Editor → Commands tab |
| 2 | Item command inline script | Item Editor → Commands tab |
| 3 | NPC command inline script | Tools → Commands (F9), type NPC |
| 4 | Adventure commands | Tools → Commands (F9), type Global |
| 5 | GlobalProcedures["action"] | Adventure Settings → Global Procedures |
| 6 (lowest) | Engine built-in handler | Always 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:
| Shortcut | Direction | Also accepts |
|---|---|---|
n | North | north, go north, walk north, head north |
s | South | south, go south, walk south |
e | East | east, go east, walk east |
w | West | west, go west, walk west |
ne | Northeast | northeast, north-east, go ne |
nw | Northwest | northwest, north-west, go nw |
se | Southeast | southeast, south-east, go se |
sw | Southwest | southwest, south-west, go sw |
u | Up | up, climb up, ascend, upstairs |
d | Down | down, 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 |
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:
| Code | Language |
|---|---|
en-GB | British English (default) |
en-US | American English |
fr-FR | French |
de-DE | German |
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:
- In statement position (start of a line): words are checked against the keyword table.
- In member position (after a dot): words are always identifiers — never keywords.
# 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:
| Action | Example phrases |
|---|---|
get | take, get, grab, pick up, collect |
drop | drop, put down, leave, discard |
put | put X in Y, place X inside Y |
use | use, activate, apply, operate |
give | give X to Y, hand X to Y |
break | break, smash, destroy, hit, bash |
eat | eat, consume, munch, devour |
drink | drink, sip, gulp, quaff |
look | look, look around, where am I |
examine | examine, inspect, look at, study |
read | read, peruse |
listen | listen, listen to, hear |
talk | talk to, speak to, chat with |
ask / tell | ask X about Y, tell X about Y — resolves against the target NPC's Topics |
topics | topics, subjects, what can I ask |
hint | hint, hints |
recap | recap, journal, quick recap, quick journal, last entry |
open | open, prise open, force open |
close | close, shut |
push | push, shove, press |
pull | pull, tug, yank, drag |
go | go, walk, move, head, travel north/south/etc. |
north etc. | north, n, go north, walk north |
up / down | up, climb up, go up, ascend |
inventory | inventory, i, items, what am I carrying |
wait | wait, z, rest, do nothing |
help | help, ?, commands, what can I do |
save | save, save game, quicksave |
quit | quit, end, finish, exit game |