Commands
Commands can be registered, after which the player can type the command into the serial terminal to run a script.
The first word is considered to be the command itself, a.k.a. the verb. Everything afterward is considered to be the command's argument. (You may register a script to be run in the event a command is attempted with an invalid argument.)
All custom command registrations are lost upon a map load.
MGE Command Interpretation
- Words are split by whitespace when interpreted. The number of spaces does not matter.
GO NORTH
is equivalent toGO NORTH
. - Case is ignored.
go north
is equivalent toGO NORTH
(andgO nOrTh
). - The second word in a command is ignored if it is "AT" or "TO".
LOOK AT BOB
is equivalent toLOOK BOB
- Non-ASCII characters are not explicitly handled, so the MGE may interpret complex characters as one (or more) entirely different characters.
Default Commands
These commands are built into the MGE.
Importantly, none of these default command words are reserved, so you may register custom arguments, e.g. GO DENNIS
for a map without a "DENNIS" exit. Just know that these custom registrations will not appear in the list of exits provided by LOOK.
Universal
- HELP: lists all commands that are currently registered, excluding:
- Commands that have been hidden
- Command aliases (e.g.
I
forINVENTORY
)
Per Map
A map's exits and script slots are defined in the map's maps.json
definition.
- LOOK: runs the map's
on_look
script, and prints the names of exits associated with that map. - LOOK + entity's current name: runs the script in that entity's
on_look
slot. - GO + name of one of the map's exits: runs the script associated with that exit name.
- Abbreviations of the cardinal directions are built into GO, so
GO N
will try to runGO NORTH
. This also applies to the diagonals, e.g.GO SW
forGO SOUTHWEST
.
- Abbreviations of the cardinal directions are built into GO, so