Main      Site Guide    

Smash Tutorial

Command Documentation


This is the complete list of commands available to you in Smash. First, a brief index of the commands is given, and a more detailed explanation follows.

Explanation of Syntax

The syntax of each command is described by listing each command's arguments. If the argument is given in ()'s, it is a required parameter. If the argument is given in []'s, it is an optional parameter. The syntax of each argument type is given as follows:

Argument Type Syntax
number one or more digits (no spaces!)
tag one or more letters, digits, or underscores (no spaces!)
tag-exp one or more letters, digits, or underscores (no spaces!), optionally with {}'s containing expressions that should be evaluated
lower-tag-exp one or more lower case letters, digits, or underscores (no spaces!), optionally with {}'s containing expressions that should be evaluated; capital letters are not allowed
var one or more letters, digits, or underscores (no spaces!), with at least one non-digit character
var-exp one or more letters, digits, or underscores (no spaces!), optionally with {}'s containing expressions that should be evaluated; the evaluated string must contain at least one non-digit character
image the filename of an image
op any operator (other than =) that accepts two arguments
expr an expression
str-exp a text string, at least one character long, all on one line, optionally with {}'s containing expressions that should be evaluated
str-expd a text string, at least one character long, all on one line, optionally with {}'s containing expressions that should be evaluated immediately, and/or with []'s containing expressions that should be evaluated at time of display
text a text string, at least one character long, that may span multiple lines provided each line after the first is indented one extra level; {}'s are allowed; []'s can be used to embed images

Text/Image Commands

Command Syntax Followed By Code Block? Description Files
.. [text]Noset the area description text to text.sma files, outside option blocks
,, [text]Noappend text to the current area description text.sma files, outside option blocks
;; (text)Noappend text to the current area description text, but without an intervening space.sma files, outside option blocks
pp [text]Noset the action description text to text.sma files, anywhere, but usually inside option blocks
PP [text]Noappend text to the current action description text.sma files, anywhere, but usually inside option blocks
AA (text)Noappend text to the current action description text, but without an intervening space.sma files, anywhere, but usually inside option blocks
ii [number] [image]Noset the image to display, unless [number] is lower than that of a previous 'i' statement; if [number] and [image] are missing, stops an image from being displayed.sma files, anywhere
SS [number] [str-expd]Noset status line number to str-expd; if str-expd is absent, erase the status line number; if number is absent, erase all status lines; the value of number for each status line indicates how they should be ordered.sma files, anywhere

Inventory Manipulation

Command Syntax Followed By Code Block? Description Files
aa (tag-exp)Noput item tag-exp in the player's inventory.sma files, anywhere
dd [tag-exp]Nodrop item tag-exp from the player's inventory; if tag-exp is omitted, all items (including enumerated) are dropped.sma files, anywhere
ee (tag-exp) = (expr)Noassign the inventory count of enumerated item tag-exp to expr.sma files, anywhere
ee (tag-exp) (op) (expr)Nomodify the inventory count of enumerated item tag-exp by op expr.sma files, anywhere
DD [tag-exp]Nodrop all regular and enumerated objects from the inventory bag tag-exp; if tag-exp is omitted, all objects are dropped from all inventory bags.sma files, anywhere
bb (tag-exp)Noswitch to the inventory bag (tag-exp) -- note that "0" is the default inventory bag.sma files, anywhere
BB (tag-exp)Noadd the items in the inventory bag (tag-exp) to the current inventory bag -- note that this does NOT remove the items from (tag-exp).sma files, anywhere

Variable Manipulation

Command Syntax Followed By Code Block? Description Files
ss (var-exp) = (expr)Noassign the state variable var-exp the value of exprlocation files or functions called from location files
ss (var-exp) (op) (expr)Nomodify the state variable var-exp by op exprlocation files or functions called from location files
vv (var-exp) = (expr)Noassign the global variable var-exp the value of expr.sma files, anywhere
vv (var-exp) (op) (expr)Nomodify the global variable var-exp by op expr.sma files, anywhere
tt + (var-exp) = (expr)Nomake the timer called var-exp an incrementing timer and set it to expr.sma files, anywhere
tt - (var-exp) = (expr)Nomake the timer called var-exp a decrementing timer and set it to expr.sma files, anywhere
tt + (var-exp) (op) (expr)Nomake the timer called var-exp an incrementing timer and modify it by op expr.sma files, anywhere
tt - (var-exp) (op) (expr)Nomake the timer called var-exp a decrementing timer and modify it by op expr.sma files, anywhere
tt << (expr)Norewind all timers by expr (incrementing timers are decremented, and decrementing timers are incremented).sma files, anywhere
tt >> (expr)Nofast forward all timers by expr (incrementing timers are incremented, and decrementing timers are decremented).sma files, anywhere
zz [lower-tag-exp]Nozero (delete) all state variables; if lower-tag-exp is present, only zero that location's state variables.sma files, anywhere
ZZNozero (delete) all global variables and timers.sma files, anywhere

Control Flow

Command Syntax Followed By Code Block? Description Files
gg (lower-tag-exp)Noset the location to jump to to lower-tag-exp.sma files, inside option blocks
GGYesexecute the following block of code only if we have just arrived at this location via a "g" command.sma files, outside option blocks
ff (tag-exp)Nocall the function tag-exp, located elsewhere in the same file.sma files, anywhere
ff (lower-tag-exp1).(tag-exp2)Nocall the function tag-exp2, located in the file lower-tag-exp1.sma.sma files, anywhere
~~ (tag)Yesdefines the start of a function called tag.sma files, outside code blocks
rr (expr)Nosets the function return value.sma files, inside functions
cc (expr)Yesexecute the following block of code if expr evaluates to a non-zero value.sma files, anywhere
CC [expr]Yesexecutes the following block of code if expr is missing or evaluates to a non-zero value, and no prior connected c or C command succeeded.sma files, only immediately after a c or C block
LL (expr)Yesexecute the following block of code if expr evaluates to a non-zero value, then loops back to the L command when it is done.sma files, anywhere
RR (expr)Yesexecute the following block of code without initially evaluating expr, then loop back and treat the block like an L loop.sma files, anywhere
llNolose the game.sma files, anywhere
ww [str-exp]Nowin the game; if present, str-exp is a |-delimited list of strings to use as Hall of Fame parameters.sma files, anywhere
WW [str-exp]Nowin the game but allow play to continue from that point; if present, str-exp is a |-delimited list of strings to use as Hall of Fame parameters.sma files, anywhere
^^ (tag) (str-exp)Yesdefine a move option tag with text str-exp.sma files, outside option blocks
** (tag) (str-exp)Yesdefine an action option tag with text str-exp.sma files, outside option blocks
@@ (tag) (str-exp)Yesdefine a constant option tag with text str-exp and make it visiblecopts.sma, outside option blocks
@@ (tag) (str-exp)Noredefine constant option tag to have the text str-exp.sma files, anywhere
@@ + [tag]Nomake constant option tag visible; if tag is omitted, make all constant options visible.sma files, anywhere
@@ - [tag]Nomake constant option tag invisible; if tag is omitted, make all constant options invisible.sma files, anywhere

Misc. Commands

Command Syntax Followed By Code Block? Description Files
xx (expr)Noset the random number seed.sma files, anywhere
!! [text]Nocause an error with str-exp as the error message; useful only when debugging.sma files, anywhere

Explanation of Commands


Back to the
Smash Tutorial.