Command Reference: Ungrouped Commands

About These Commands

The commands listed here don't fit into any specific group, and thus lack a prefix like COLOR. or IMAGE. . However, they are easily some of the most important commands you'll ever use in a script, so it would be a good idea to be familiar with them.

Marking a line as a comment

REM whatever.

The REM command tells the scripting engine to discard this line during loading, allowing you to include whatever you want after the REM command itself. Use this command to include comments about your code so that you and other people will understand what your code in intended to do.

 

Creating or Changing Variables

STORE Name [Value]

This command stores the given value into the variable named Name. If no value was given, the current value of .RESULT is used.

 

Displaying Output

ALERT msg
OUT msg

These two commands allow you to show a message to the user. ALERT brings up the message in a little message window, while OUT prints the message to the console. Keep in mind that the user must choose to use the console-enabled version of the editor in order to see the output of OUT; if a message is particularly important, use ALERT.

 

Controlling Progam Flow

DEF Name
START
END

These define where a function begins and ends. DEF allows you to define your own custom functions, while START defines where the script should begin. END marks the end of a function or the script.

Every program must include a START and END pair. Custom functions are optional.

 

CALL Name

This function executes (or calls) the function Name. This function must be defined elsewhere in the script, using the DEF command. An error will be thrown and the script aborted if the named function cannot be found.

 

JUMP Name
JUMPIF Name
LABEL Name

JUMP and JUMPIF change the currently executing line to the line just after the LABEL command with the same Name. The difference between them is that JUMPIF only changes the point of execution if .RESULT is not zero.

 

Comparisons

EQUAL Value Value
NOTEQUAL Value Value
GTHAN Value Value
LTHAN Value Value

These commands allow you to compare any two values. They all set .RESULT to 1 if the comparison is evaluated to be true, 0 if the comparison is false. This makes them ideal for determining when to trigger a JUMPIF command.

EQUAL and NOTEQUAL check for equality (or lack thereof), while GTHAN and LTHAN check to see if the first value is greater than or less than the second value.

 

Stack Operations

PUSH [value]
POP
STACKPOS

These commands manage or manipulate the stack. If given a parameter, PUSH places its value on the stack. With no parameters, PUSH automatically assumes you mean to place .RESULT on the stack, and does so. POP removes a value from the stack, placing it in .RESULT .

STACKPOS places the current number of values in the stack into .RESULT, allowing you to monitor for stack overflow or underflow errors.

 

Advanced Image Manipulation

BUMP
MERGE

These allow you to create layered effects by manipulating a "stack" of images. BUMP stores the current working image into the private stack and makes a new copy of the original image. MERGE compiles the stack of images back into a single image.

You don't need to worry about managing this image stack, nor do you need to call MERGE unless you need the images blended back together before your script ends. This is because the MERGE command is automatically run at the end of every script.

Project Hosted by
Download Mike\'s Sprite Editor