Super Text Adventure

Commands Reference

Every command the player can type, with all synonyms and how the engine parses them.

How Commands Are Parsed

The CommandParser breaks player input into three parts:

// "use key on door" becomes:
{
  "verb":     "use",      // the action
  "target":   "key",      // first object
  "modifier": "door",     // second object (after preposition)
  "raw":      "use key on door"
}

Articles (the, a, an) and prepositions (to, at, on, with, from, of) are stripped during parsing.

Movement

CommandSynonymsUsage
go go, move, walk, travel, head go north, walk east, n
enter enter enter cave
leave leave, exit leave, exit
climb climb, scale climb up, scale wall

Bare directions also work as movement commands: typing north or just n is the same as go north.

Direction Shortcuts

FullShortFullShort
northnsouths
eastewestw
northeastnenorthwestnw
southeastsesouthwestsw
upudownd
inout

Observation

CommandSynonymsUsage
look look, l look — describes the current room
examine examine, inspect, x, check, read examine sword, x note, read sign
inventory inventory, inv, i i — lists items you're carrying

Item Interaction

CommandSynonymsUsage
take take, get, grab, pickup, pick take sword, grab key, get potion
drop drop, discard drop sword
use use, activate, employ, apply use key, use key on door

Containers

CommandSynonymsUsage
open open, unlock open chest, unlock cabinet
close close, shut close chest, shut door

Social Interaction

CommandSynonymsUsage
talk talk, speak, chat, ask, say talk to wizard, ask wizard about quest, talk to rat (for creatures with talk_text)
give give, offer, hand give gem to wizard, offer sword to knight

Combat

CommandSynonymsUsage
attack attack, kill, hit, strike, fight attack goblin, fight dragon
defend defend, block, guard, parry defend, block (during combat)
flee flee, run, escape, retreat flee, run (during combat)

Other

CommandSynonymsUsage
roll roll roll — when prompted by a dice check
help help, h, ? help — shows available commands in-game
restart restart, reset restart — restart the game (with confirmation)

Command Routing

Commands are routed to handlers with these priority rules:

1. Pending Roll (highest priority)

If a dice roll is pending, only the roll command is accepted. Everything else is rejected.

2. Active Combat

If in combat, only combat commands are accepted: attack, defend, flee, use, inventory, examine, look.

3. Normal Routing

Commands route to their appropriate handler based on verb.

Handler Map

HandlerVerbs
MovementHandlergo, enter, leave, climb
ExamineHandlerlook, examine, inventory
ItemHandlertake, drop, use
ContainerHandleropen, close
InteractHandlertalk, give, attack (to start combat)
CombatHandlerattack, defend, flee, use (during combat)
RollHandlerroll
RestartHandlerrestart