This is a complete reference of the built-in commands available to CCScript programs. Collectively, this set of commands makes up the CCScript Standard Library. These commands are defined in the file lib/std.ccs.
Some command entries have example code, demonstrating the use of the commands. If you want more information about a command used in a sample code snippet, you can just click the name of the command where it is used. For example:
"@This block of code starts a battle." next
battle(56)
window_open(1)
"@You win!" end
In the above code, the keywords
next
,
battle
,
window_open
, and
end
are all clickable, and will take you
to the documentation entry for each respective command.
These simple commands are among the most commonly used, and provide basic text control, event flag control, and text linkage.
Command | Description |
next | Prompt with nextline. |
end | Prompt with end-of-block. |
wait | Wait for input, no prompt. |
prompt | Wait for input with prompt. |
eob | End-of-block marker. |
pause | Pause for an amount of time. |
newline | Break to a new line. |
clearline | Erase current text line. |
set | Set an event flag. |
unset | Unset an event flag. |
toggle | Toggle the state of an event flag. |
call | Jump to other text and return. |
goto | Jump to other text without return. |
next
Nextline with prompt.
(none)
displays a blinking prompt, waits for the player to press a button, and then breaks to a new line. This command is equivalent to the control code sequence "[03][00]".
"@Onett isn't the only thing on the map." next
"@All the info is there, except for the info that isn't there."
end
End of block with prompt.
(none)
Waits for the player to press a button, and then ends the text block. This command is equivalent to the control code sequence "[13][02]".
"@Hello... and, good-bye!" end
wait
Wait for input, no prompt.
(None)
Waits for the player to press a button, with no visual prompt. Typically used at the end
of text blocks, though in most cases you should use the end
command for that purpose.
prompt
Wait for input with prompt.
(None)
Displays a blinking prompt and waits for input from the player. This command behaves the
same in battle as in normal text; that is, it is equivalent to the control code [14]
.
eob
End text parsing.
(None)
Indicates the end of a text block. In most cases you should use end
instead, as this includes the customary prompt-for-input, but in some cases you might want to perform
additional actions between the prompt and the end of the block, such as closing a window. In these cases,
you could use wait
, then perform the action, and finally use eob
.
pause (ticks)
Pause for a duration of time.
ticks
- the number of frames to pause for
Halts text parsing for a fixed amount of time and then continues. Each frame is one 60th of one second,
so a ticks
value of 0xFF corresponds to a delay of about 4.25 seconds. Pauses are often used
to add dramatic tension or natural pacing to dialogue.
In CCScript, you can also insert short pauses simply by using the characters '/' and '|' in a text string. A '/' corresponds to a pause of 5 frames (one twelfth of a second), and a '|' corresponds to a pause of fifteen frames (one quarter of a second).
"@Hello,/ is anyone there?" next
"@.|.|.|.|." next
"@Look, I know you're in there;" pause(30)
" I can smell the Doritos!" end
clearline
Erase the current text line.
(None)
Erases the current line of text. Subsequent text will appear at the beginning of the line.
set (n)
Set event flag.
n
- An event flag or event flag number.
Sets (turns on) an event flag. The opposite of unset(n).
define met_joe = flag 140
if not met_joe {
"@Hey, I'm Joe the talking toilet." next
"@Nice to meet you."
set(met_joe) // turn on the "met Joe" flag
end
}
else {
"@Hello again!" end
}
unset (n)
Clear event flag.
n
- An event flag or event flag number.
Unsets (turns off) an event flag. The opposite of set(n).
define ness_jammies = flag 0x2ED
// Turn off Ness's pajamas
unset(ness_jammies)
toggle (n)
Toggle event flag.
n
- An event flag or event flag number.
Toggles the state of an event flag. If the flag is off, this command will turn it on. If the flag is on, this command will turn it off.
call (target)
Jump to text with return.
target
- A location to jump to.
Jumps to another location and begins parsing text from there. When parsing is finished,
the text system will return to the location of the call
. The target
parameter can be either an absolute address in the ROM, or a label within the program.
goto (target)
Jump to text, no return.
target
- A location to jump to.
Jumps to another location and begins parsing text from there. When parsing is finished
control will not return to the original location of the jump.
The target
parameter can be either an absolute address in the ROM, or a
label within the program.
The windowing commands manipulate the game's text windows, allowing you to open new windows, switch between windows, and so on.
Command | Description |
window_open | Open a window. |
window_switch | Switch to an already open window. |
window_close | Close a specific window. |
window_closetop | Close the current window. |
window_closeall | Close all text windows. |
open_wallet | Open the wallet window. |
window_open (num)
Open text window.
num
- Window number to open
Opens a text window. After opening, subsequent text output will appear in the new
window, until the window is closed or window_switch
is used.
Note that in some situations, an opened window will not close automatically at the end of the text block.
For example, this is the case if you open a window in a hotspot trigger, or in the startup text.
So, if you open a window in either of these situations, make sure you close it explicitly with
window_close
or window_closeall
before ending the text block.
The following table lists built-in window numbers, sizes, and positions:
# | Size | Position | Common use |
0 | 13 x 8 | (1, 1) | The standard gameplay menu |
1 | 19 x 8 | (12, 1) | The standard dialogue window |
2 | 24 x 16 | (7, 1) | Inventory window |
3 | 6 x 10 | (1, 1) | The Use/Give/Drop/Help item menu |
4 | 11 x 6 | (1, 3) | PSI description window |
5 | 11 x 16 | (20, 1) | Telephone menu |
6 | 20 x 10 | (8, 1) | Equip menu |
7 | 13 x 16 | (18, 1) | List of equippable items |
8 | 30 x 18 | (1, 1) | The status window |
9 | 19 x 18 | (12, 1) | Shop windows |
10 | 8 x 4 | (1, 10) | Cash on hand window |
11 | 11 x 4 | (1, 15) | ??? |
12 | 19 x 16 | (12, 1) | ??? |
13 | 24 x 16 | (7, 1) | ??? |
14 | 24 x 6 | (4, 1) | Battle message window |
15 | 21 x 6 | (1, 1) | Standard-width battle menu |
16 | 8 x 8 | (4, 1) | Offense/Defense/Assist PSI selection menu |
17 | 12 x 4 | (12, 1) | ??? |
18 | 14 x 6 | (1, 1) | Jeff's battle menu |
19 | 30 x 8 | (1, 2) | The file selection menu |
20 | 22 x 4 | (5, 9) | Continue/Copy/Delete file menu |
21 | 12 x 8 | (10, 16) | Copy file menu, 2 slots |
22 | 12 x 6 | (10, 16) | Copy file menu, 1 slot |
23 | 21 x 10 | (6, 17) | Delete file confirmation menu |
24 | 16 x 10 | (3, 14) | Text speed selection menu |
25 | 18 x 8 | (18, 15) | Sound mode selection menu |
26 | 8 x 4 | (5, 4) | Character name input |
27 | 17 x 4 | (13, 4) | "Name this X" message |
28 | 30 x 16 | (1, 9) | Letter selection window |
29 | 7 x 4 | (7, 3) | Confirmation box: Ness's name |
30 | 7 x 4 | (7, 7) | Confirmation box: Paula's name |
31 | 7 x 4 | (7, 11) | Confirmation box: Jeff's name |
32 | 7 x 4 | (7, 15) | Confirmation box: Poo's name |
33 | 8 x 4 | (20, 3) | Confirmation box: King's name |
34 | 13 x 6 | (15, 7) | Confirmation box: Favorite food |
35 | 13 x 6 | (15, 13) | Confirmation box: Favorite thing |
36 | 24 x 4 | (4, 21) | Confirmation box: "Are you sure?" |
37 | 13 x 8 | (18, 6) | ??? |
38 | 12 x 4 | (12, 1) | ??? |
39 | 26 x 6 | (3, 3) | ??? |
40 | 7 x 4 | (1, 1) | ??? |
41 | 15 x 4 | (16, 8) | ??? |
42 | 21 x 4 | (10, 8) | ??? |
43 | 27 x 4 | (4, 8) | ??? |
44 | 24 x 16 | (8, 2) | ??? |
45 | 15 x 6 | (3, 11) | ??? |
46 | 8 x 10 | (4, 1) | ??? |
47 | 30 x 10 | (1, 9) | ??? |
48 | 28 x 6 | (1, 1) | ??? |
49 | 20 x 4 | (10, 4) | ??? |
50 | 15 x 16 | (14, 11) | ??? |
51 | 9 x 4 | (22, 8) | ??? |
52 | 18 x 18 | (7, 9) | ??? |
window_switch (num)
Switch to window.
num
- Number of window to switch to.
Switches to an already open window. Switching to a window makes it the topmost window, and subsequent text output will appear in this window until it is switched away from or closed. The specified window number must already be opened, or the text system will crash.
// Open two windows and display a string in each
window_open(1)
"@This is window 1!" next
window_open(24)
"@This is window 24!" next
// Now switch back to the first window and add more text
window_switch(1)
"@Now back in window 1!" end
window_close (num)
Close specific window.
num
- Window number to close
Closes an already opened text window. The specified window number must already be open, or the text system will crash.
window_closetop
Close topmost window.
(None)
Closes the topmost text window. The topmost window is the one that is currently receiving text output, or the most recently switched-to window that is still open.
Note that closing the topmost window does not automatically bring the previous topmost window
back to the top. After closing the topmost window, you must explicitly switch to a new window
using window_switch
if you want to continue text output.
window_closeall
Close all windows.
(None)
Closes all currently open text windows. You can use this command to ensure that all windows are closed if you're not entirely sure what windows may have been opened at a given point.
open_wallet
Open the cash on hand window.
(None)
Opens a small window displaying the amount of money the player has on hand.
These commands modify text appearance or print names and other values from the game.
Command | Description |
text_pos | Force text positioning. |
text_color | Change text color. |
text_blips | Change text "blip" sounds. |
font_saturn | Use the Mr. Saturn font |
font_normal | Use the normal font. |
smash | Display "SMAAAASH" |
youwon | Display "YOU WON" |
name | Print character names. |
itemname | Print item names. |
psiname | Print PSI power names. |
teleportname | Print teleport names. |
number | Print numeric value. |
money | Print right-aligned money value. |
user | Display action user. |
target | Display action target. |
delta | Display action delta. |
stat | Display various statistics. |
text_pos (x, y)
Change text location.
x
- Horizontal position of text, in pixels
y
- Vertical position of text, in rows
Adjusts the location at which text is displayed in the window. Text immediately after this command should begin displaying at the specified location in the window.
text_color (color)
Change text color.
color
- index of color "style" to use.
Changes the color of subsequent text output. The color change only affects text in the current window until the end of the text block.
The following table lists the available colors:
# | Description | Preview |
0 | Normal text | |
1 | Normal text | |
2 | Pink background | |
3 | Normal text | |
4 | Border color background | |
5 | Dark gray; flashes when HP window is open | |
6 | Purple background | |
7 | Interior border background |
text_blips (num)
Change the text "blip" sound.
num
- text blip effect number
Changes the "blip" sound that plays as text characters are printed. A value of 3 turns off the blips entirely. Other values are not really documented.
TODO: somebody document this.
font_saturn
Use the Mr. Saturn font.
(None)
Changes the current window's font to the Mr. Saturn font. The change will remain in effect until the font is explicitly switched again, or the window is closed.
font_normal
Use the normal font.
(None)
Changes the current window's font to the normal text font.
smash
Display the "SMAAAASH" text graphic.
(None)
Displays the "SMAAAASH" text graphic in the current window.
"@I got {smash}ed by a mouse."
youwon
Display the "YOU WON" text graphic.
(None)
Displays the "YOU WON" text graphic in the current window.
"@I'll bet the mouse saw a message that said" newline
" <{youwon}> " next
"@...or something like that." end
name (index)
Display a character's name.
index
- index of the character whose name should be displayed.
Prints the name of a character. If the character index specified is zero, the value in the argument register will be loaded and used as the index instead. The following table lists the default character indexes:
Index | Character |
0 | (Load index from argument register) |
1 | Ness |
2 | Paula |
3 | Jeff |
4 | Poo |
5 | Pokey |
6 | Picky |
7 | King |
8 | Tony |
9 | Bubble Monkey |
10 | Brick Road |
11 | Flying Man 1 |
12 | Flying Man 2 |
13 | Flying Man 3 |
14 | Flying Man 4 |
15 | Flying Man 5 |
16 | Teddy Bear |
17 | Super Plush Bear |
itemname (item)
Display an item name.
item
- index of the item whose name should be printed.
Prints the name of an item. If the specified item number is zero, the value in the argument register will be loaded and used as the item index instead.
// Prints "@Item 42 is the Hyper beam."
"@Item 42 is the {itemname(42)}." end
psiname (index)
Display a PSI name.
index
- index of the PSI power to print.
Prints the name of a PSI power. If the specified index is zero, the value in the argument register will be loaded and used as the PSI index instead. The following table lists the default PSI names for each index:
Index | PSI name |
0 | (Load index from argument register) |
1 | PSI Rockin α |
2 | PSI Rockin β |
3 | PSI Rockin γ |
4 | PSI Rockin Ω |
5 | PSI Fire α |
6 | PSI Fire β |
7 | PSI Fire γ |
8 | PSI Fire Ω |
9 | PSI Freeze α |
10 | PSI Freeze β |
11 | PSI Freeze γ |
12 | PSI Freeze Ω |
13 | PSI Thunder α |
14 | PSI Thunder β |
15 | PSI Thunder γ |
16 | PSI Thunder Ω |
17 | PSI Flash α |
18 | PSI Flash β |
19 | PSI Flash γ |
20 | PSI Flash Ω |
21 | PSI Starstorm α |
22 | PSI Starstorm Ω |
23 | PSI Lifeup α |
24 | PSI Lifeup β |
25 | PSI Lifeup γ |
26 | PSI Lifeup Ω |
27 | PSI Healing α |
28 | PSI Healing β |
29 | PSI Healing γ |
30 | PSI Healing Ω |
31 | Shield α |
32 | Shield β |
33 | Shield γ |
34 | Shield Ω |
35 | PSI Shield α |
36 | PSI Shield β |
37 | PSI Shield γ |
38 | PSI Shield Ω |
39 | Offense up α |
40 | Offense up Ω |
41 | Defense down α |
42 | Defense down Ω |
43 | Hypnosis α |
44 | Hypnosis Ω |
45 | PSI Magnet α |
46 | PSI Magnet Ω |
47 | Paralysis α |
48 | Paralysis Ω |
49 | Brainshock α |
50 | Brainshock Ω |
51 | Teleport α |
52 | Teleport β |
teleportname (dest)
Display a teleport destination name.
dest
- index of the teleport destination to print.
Prints the name of a PSI Teleport destination. If the specified destination number is zero, the value in the argument register will be loaded and used as the destination index instead. The following table lists the default destination names:
Index | PSI name |
0 | (Load index from argument register) |
1 | Onett |
2 | Twoson |
3 | Threed |
4 | Saturn Valley |
5 | Fourside |
6 | Winters |
7 | Summers |
8 | Scaraba |
9 | Dalaam |
10 | Deep Darknes |
11 | Tenda Village |
12 | Underworld |
13 | <blank> |
14 | Dusty Dunes |
15 | <blank> |
16 | <blank> |
number (val)
Display a number.
val
- value to display as a number.
Prints a numerical value, formatted as a decimal number. If val
is zero,
the value in the argument register will be loaded and displayed instead.
number(42) // prints "42"
number(0x100) // prints "256"
"@I have {number(0xA)} dollars." // prints "@I have 10 dollars."
money (val)
Display a cash amount.
val
- value to display as money.
Prints a numerical value formatted like a currency amount, i.e., with a '$' in front of it.
The output is aligned to the right side of the current text window, so this command is mainly
useful for displaying lists of prices, as in a shop.
If val
is zero, the value in the argument register will be loaded and displayed
instead.
money(0xFF) // prints "$25500"
define item = 0x5A
define price = 4000
"{itemname(item)} {money(price)}." // prints "Hamburger $400000"
user
Display the user of an action.
(None)
Prints the name of the current "user" of some action.
The exact usage of this code is still a bit of a mystery.
target
Display the target of an action.
(None)
Prints the name of the current "target" of some action.
The exact usage of this code is still a bit of a mystery.
delta
Display change caused by action.
(None)
Prints the amount of change in some statistic caused by the current action. Examples might include the amount of HP recovered by eating a food item, or the amount of damage suffered in an attack.
The exact usage of this code is still a bit of a mystery.
stat (num)
Display various statistics.
num
- index of the stat to display.
Prints character statistic and other miscellaneous data. If the index
parameter
is zero, the value in the argument register will be loaded and used instead. The following table
lists the stat values associated with each index:
Index | Value |
0 | (Load index from argument register) |
1 | (Unknown) |
2 | Player name |
3 | Dog's name |
4 | Favorite food |
5 | PSI Special |
6 | Cash on hand |
7 | ATM balance |
8 | Ness's Name |
9 | Ness's Level |
10 | Ness's EXP |
11 | Ness: current HP |
12 | Ness: rolling HP target |
13 | Ness: maximum HP |
14 | Ness: current PP |
15 | Ness: rolling PP target |
16 | Ness: maximum PP |
17 | Ness: Total Offense |
18 | Ness: Total Defense |
19 | Ness: Total Speed |
20 | Ness: Total Guts |
21 | Ness: Total Luck |
22 | Ness: Total Vitality |
23 | Ness: Total IQ |
24 | Ness: Base IQ |
25 | Ness: Base Offense |
26 | Ness: Base Defense |
27 | Ness: Base Speed |
28 | Ness: Base Guts |
29 | Ness: Base Luck |
30 | Paula: Name |
31 | Paula: Level |
32 | Paula: EXP |
33 | Paula: current HP |
34 | Paula: rolling HP target |
35 | Paula: maximum HP |
36 | Paula: current PP |
37 | Paula: rolling PP target |
38 | Paula: maximum PP |
39 | Paula: Total Offense |
40 | Paula: Total Defense |
41 | Paula: Total Speed |
42 | Paula: Total Guts |
43 | Paula: Total Luck |
44 | Paula: Total Vitality |
45 | Paula: Total IQ |
46 | Paula: Base IQ |
47 | Paula: Base Offense |
48 | Paula: Base Defense |
49 | Paula: Base Speed |
50 | Paula: Base Guts |
51 | Paula: Base Luck |
Index | Value |
52 | Jeff: Name |
53 | Jeff: Level |
54 | Jeff: EXP |
55 | Jeff: current HP |
56 | Jeff: rolling HP target |
57 | Jeff: maximum HP |
58 | Jeff: current PP |
59 | Jeff: rolling PP target |
60 | Jeff: maximum PP |
61 | Jeff: Total Offense |
62 | Jeff: Total Defense |
63 | Jeff: Total Speed |
64 | Jeff: Total Guts |
65 | Jeff: Total Luck |
66 | Jeff: Total Vitality |
67 | Jeff: Total IQ |
68 | Jeff: Base IQ |
69 | Jeff: Base Offense |
70 | Jeff: Base Defense |
71 | Jeff: Base Speed |
72 | Jeff: Base Guts |
73 | Jeff: Base Luck |
74 | Poo: Name |
75 | Poo: Level |
76 | Poo: EXP |
77 | Poo: current HP |
78 | Poo: rolling HP target |
79 | Poo: maximum HP |
80 | Poo: current PP |
81 | Poo: rolling PP target |
82 | Poo: maximum PP |
83 | Poo: Total Offense |
84 | Poo: Total Defense |
85 | Poo: Total Speed |
86 | Poo: Total Guts |
87 | Poo: Total Luck |
88 | Poo: Total Vitality |
89 | Poo: Total IQ |
90 | Poo: Base IQ |
91 | Poo: Base Offense |
92 | Poo: Base Defense |
93 | Poo: Base Speed |
94 | Poo: Base Guts |
95 | Poo: Base Luck |
These commands are used to manipulate the player's items and money during the game.
Command | Description |
give | Give an item to a character |
take | Take an item from a character |
hasitem | Check if a character has an item |
full | Check if a character's inventory is full |
givemoney | Give money to the player |
takemoney | Take money from the player |
hasmoney | Check if the player has an amount of money |
deposit | Add money to the ATM account |
withdraw | Remove money from the ATM account |
usable | Check if a character can use an item |
give (char, item)
Put an item in a party member's inventory.
char
- party member to give the item to
item
- item to give
Gives the party member char
one of item
. If the item
parameter is zero, the value in the argument register will be loaded and used instead. The
char
parameter should either be one of 1, 2, 3, or 4, corresponding to a specific
party member, or 0xFF, to put the item into the inventory of the first party member with
sufficient free space.
"@{name(1)}, I now present you with this very significant item." next
give(1, 206)
"@({name(1)} got the {itemname(206)}.)" end
take (char, item)
Take an item from a party member's inventory.
char
- party member to take the item from
item
- item to take
Removes one of the specified item
from the inventory of party member
char
. If the item
parameter is zero, the value in the argument
register is loaded and used instead. The char
parameter should either be
one of 1, 2, 3, or 4, corresponding to a specific party member, or 0xFF, to take the item
from the first party member who has one.
take(0xFF, 211)
"@({name(1)}'s Tendakraut was stolen.)" end
hasitem (char, item)
Check if a party member has an item.
char
- party member to check
item
- item number to check for
Returns "true" if party member char
has at least one of item
.
Can be used with an if
statement to check if
an item is in the player's inventory. The char
parameter should either be one
of 1, 2, 3, or 4, corresponding to a specific party member, or 0xFF to check all party
members' inventories.
define showticket = 0xb2
"@Tickets, please!" next
if hasitem(0xff, showticket) {
"@Thank you, right this way." end
}
else {
"@Ah, you, uh, don't have a ticket." end
}
full (char)
Check if a party member's inventory is full.
char
- party member to check.
Returns "true" if party member char
has no free slots in his or her
inventory. If char
is zero, the value in the argument register will
be loaded and used instead. If char
is 0xFF, all party members' inventories
will be checked, and the command will return "false" if any party
member has free slots.
if full(0xff) {
"@You don't have enough room." next
"@Throw away a salt packet or something so I can give you this bicycle." next
}
givemoney (amount)
Give money to player.
amount
- amount of money to give.
Gives the player the specified amount of cash. If amount
is zero,
the value in the argument register is loaded and used instead.
takemoney (amount)
Take money from the player.
amount
- amount of money to take.
Takes the specified amount of cash from the player. If amount
is zero,
the avalue in the argument register is loaded and used instead.
hasmoney (amount)
Check if the player has an amount of money.
amount
- amount of money to check for.
Returns "true" if the player has at least amount
dollars on hand.
You can use this command with an if
statement
to check if the player has sufficient funds for some action.
If amount
is zero, the value in the argument register is loaded and
used instead.
"@A bicycle? That will be $1000, please." next
if hasmoney(1000) {
takemoney(1000)
sound(SND_KACHING)
"@Thank you, come again!" end
give(0xff, 176)
}
else {
"@I am sorry, but you do not have enough money."
}
deposit (amount)
Deposit money into the ATM.
amount
- amount of money to deposit.
Adds money to the player's bank account. (In the game, not in reality.) If
amount
is zero, the value in the argument register is loaded and used instead.
withdraw (amount)
Take money from the ATM.
amount
- amount of money to remove.
Removes money from the player's bank account. If amount
is zero, the value
in the argument register is loaded and used instead.
usable (char, item)
Check if character can use item.
char
- party member to check
item
- item number to check for usability
Returns "true" if the party member char
can use item number item
,
"false" otherwise.
These commands alter character status, including hit points, psychic points, level, status afflictions, and other statistics.
Command | Description |
inflict | Inflict a status change. |
healall | Revitalize all party members. |
heal | Heal HP. |
hurt | Damage HP. |
heal_percent | Heal HP by percentage. |
hurt_percent | Damage HP by percentage. |
recoverpp | Recover PP. |
consumepp | Consume PP. |
recoverpp_percent | Recover PP by percentage. |
consumepp_percent | Consume PP by percentage. |
change_level | Change character level. |
boost_exp | Give experience points. |
boost_iq | Increase IQ. |
boost_guts | Increase Guts. |
boost_speed | Increase Speed. |
boost_vitality | Increase Vitality. |
boost_luck | Increase Luck. |
inflict (char, status)
Inflict status change.
char
- character to inflict with a status ailment.
status
- status ailment to inflict.
Gives the specified party member a status affliction.
TODO: document parameters for the underlying control code, [19 05 XX YY YY].
healall
Heal all party members.
(None)
Heals all party members completely, restoring both HP and PP fully.
"@(In only a few seconds, this machine fully revitalizes you," next
"@just like a good night's sleep.)" next
healall
heal (char, amount)
Recover HP.
char
- character to heal.
amount
- amount of HP to recover.
Heals a party member by a specified HP amount. The parameter char
can either be one of 1, 2, 3, or 4, to refer to a specific party member, or 0xFF,
to heal all party members.
hurt (char, amount)
Deplete HP.
char
- character to hurt.
amount
- amount of HP damage to deal.
Damages a party member by a specified HP amount. The parameter char
can either be one of 1, 2, 3, or 4, to refer to a specific party member, or 0xFF,
to damage all party members.
heal_percent (char, percent)
Recover a percentage of maximum HP.
char
- character to heal.
percent
- percentage of HP to recover.
Recovers a percentage of the specified party member's HP. The parameter char
can either be one of 1, 2, 3, or 4, to refer to a specific party member, or 0xFF,
to heal all party members.
hurt_percent (char, percent)
Deplete a percentage of maximum HP.
char
- character to hurt.
percent
percentage of HP to deplete.
Deals damage that is a percentage of the specified party member's maximum HP.
The parameter char
can either be one of 1, 2, 3, or 4, to refer to a specific party member, or 0xFF,
to damage all party members.
"@Ness's HP drops to 0!" next
hurt_percent(1, 100)
"@Jeff's HP drops to 0!" next
hurt_percent(3, 100)
end
recoverpp (char, amount)
Restore PP.
char
- character whose PP will be restored
amount
- amount of PP to restore
Recovers a specified amount of PP to a party member. The parameter char
can either be one of 1, 2, 3, or 4, to refer to a specific party member, or 0xFF,
to recover PP to all party members.
consumepp (char, amount)
Deplete PP.
char
- character whose PP will be depleted
amount
- amount of PP to deplete.
Depletes the PP of a party member by a specified amount. The parameter char
can either be one of 1, 2, 3, or 4, to refer to a specific party member, or 0xFF,
to deplete PP for all party members.
recoverpp_percent (char, percent)
Recover a percentage of PP.
char
- character whose PP will be restored.
percent
- percentage of PP to restore.
Recovers a percentage of a party member's maximum PP. The parameter char
can either be one of 1, 2, 3, or 4, to refer to a specific party member, or 0xFF,
to recover PP for all party members.
consumepp_percent (char, percent)
Deplete a percentage of PP.
char
- character whose PP will be depleted.
percent
- percentage of PP to deplete.
Consumes a percentage of a party member's maximum PP. The parameter char
can either be one of 1, 2, 3, or 4, to refer to a specific party member, or 0xFF,
to deplete PP for all party members.
"@The strange blue light made you dizzy!" next
consumepp_percent(0xff, 50)
"@Your PP was drained!" end
change_level (char, level)
Change a character's level.
char
- character whose level will change.
level
- the new level.
Changes a character's level, giving them all the stat boosts and PSI powers associated with that level. If the specified level is lower than the character's current level, their stats will drop down to match!
// Note: don't actually do this unless you want to really tick off your players
"@Pokey used the de-levelizer!" next
change_level(1, 5)
"@Ness's level dropped to 5!" end
boost_exp (char, exp)
Give experience points.
char
- character to give EXP to.
exp
- amount of EXP to give.
Gives experience points to a party member. If the character's total experience passes a level-up threshold, the appropriate level-up text will be displayed, complete with music.
boost_exp(1, 1)
"@It was a good experience." end
boost_iq (char, amount)
Increase IQ stat.
char
- character whose IQ will be increased.
amount
- amount of IQ to give.
Increases the IQ stat of the specified character.
boost_guts (char, amount)
Increase Guts stat.
char
- character whose Guts will be increased.
amount
- amount of Guts to give.
Increases the Guts stat of the specified character.
boost_speed (char, amount)
Increase Speed stat.
char
- character whose Speed will be increased.
amount
- amount of Speed to give.
Increases the Speed stat of the specified character.
boost_vitality (char, amount)
Increase Vitality stat.
char
- character whose Vitality will be increased.
amount
- amount of Vitality to give.
Increases the Vitality stat of the specified character.
boost_luck (char, amount)
Increase Luck stat.
char
- character whose Luck will be increased.
amount
- amount of Luck to give.
Increases the Luck stat of the specified character.
These commands perform various actions related to events within the game, including party control, battles, warping, and so on.
Command | Description |
battle | Begin a battle. |
warp | Warp to a destination |
teleport | Use PSI Teleport |
anchor_set | Set exit mouse anchor |
anchor_warp | Warp to exit mouse anchor |
event | Cut to a special event sequence |
learnpsi | Learn a PSI technique |
party_add | Add a party member |
party_remove | Remove a party member |
save | Save the game |
hotspot_on | Activate a hotspot |
hotspot_off | Deactivate a hotspot |
battle (num)
Begin a battle.
num
- index of the battle group to fight
Starts a battle against the specified group of enemies. If num
is zero, the
value in the argument register will be loaded and used as the battle group number. Check the
Battle Entry Editor in JHack to see which groups contain which enemies.
Before beginning the battle, this command closes all active windows. Thus, if you want
any text to appear after the battle, you will need to open a new window using
window_open
.
"@Are you asking for a challenge?!" next
battle(145)
window_open(1)
"@Oh. {pause(15)} You won."
end
warp (dest)
Warp to a predefined destination.
dest
- index of the destination to warp to.
Warps the party to a location defined in the warp destination list. If dest
is zero, the value in the argument register will be loaded and used as the destination index.
To view and/or edit
the available warp destinations, see the [1F 21 XX] Teleport Table Editor in JHack.
"@Hello... and, good-bye!" next
"@Shall I?" newline
menu {
"Yes" : { }
"No" : {
warp(0x6a)
eob
}
}
teleport (dest, type)
Use PSI Teleport.
dest
- PSI Teleport destination to warp to.
type
- type of Teleport to use.
Causes the party to use PSI Teleport to travel to the specified destination. To view and/or edit the available teleport destinations, see the Teleport Destination Editor in JHack.
Type | ID | Description |
1 | TELEPORT_ALPHA | PSI Teleport α |
2 | TELEPORT_BETA | PSI Teleport β |
4 | TELEPORT_OMEGA | Like Teleport β, but requires no room; very tight spinning. |
anchor_set
Set the exit mouse anchor.
(None)
Sets the "anchor" for the exit mouse to the party's current location. The anchor is where
the party will be warped when anchor_warp
is used.
anchor_warp
Warp to the exit mouse anchor.
(None)
Warps the party to the exit mouse anchor, which was previously set with anchor_set
.
telepod_set:
"@{name(1)} placed the Telepod marker on the ground."
anchor_set
end
telepod_use:
"@{name(1)} used the Telepod."
anchor_warp
end
event (num)
Call a special event.
num
- special event number.
Runs the specified special event. This is used to display the coffee scenes, name registration, ending credits, and miscellaneous. See the event table for details.
Index | ID | Description |
1 | EVENT_COFFEE | The Saturn Valley coffee scene |
2 | EVENT_TEA | The Tenda Village tea scene |
3 | EVENT_NAME1 | Register your name |
4 | EVENT_NAME2 | Register your name a second time |
7 | EVENT_TOWNMAP | Open the town map |
9 | EVENT_SSTONE | Show sound stone |
10 | EVENT_TITLE | Show the title screen |
11 | EVENT_CAST | Show the cast of characters |
12 | EVENT_CREDITS | Play the end credits |
learnpsi (char, psi)
Realize a PSI power.
char
- party member who will learn the PSI power.
psi
- PSI power to learn.
Makes the specified character realize the specified PSI power. This command only works with a few special PSI powers, and even then only for certain characters.
Index | Description |
1 | Teleport α - works with Ness and Poo |
2 | Teleport β - works with Ness and Poo |
3 | Starstorm α - only works for Poo |
4 | Starstorm Ω - only works for Poo |
party_add (char)
Add character to party.
char
- index of character to add
Adds a character to the party.
"@{name(2)} has joined your party!"
// Play the fanfare music, then resume normal music after three seconds
music(0x7B)
pause(180)
music_resume
party_add(2)
party_remove (char)
Remove character from party.
char
- index of character to remove
Removes a character from the party.
party_remove(2)
"@Oh great, Paula got kidnapped again."
end
hotspot_on (slot, hotspot, target)
Activate a hotspot.
slot
- which "active hotspot" slot to use; must be either 1 or 2
hotspot
- index of the hotspot to activate
target
- location of text to use when the player enters the hotspot
Activates a map hotspot, so that when the player walks into the area defined by the hotspot,
the specified text will be called. Only two hotspots can be active at any given time, one in
each slot
. To view or edit the available hotspots, see the Hotspot Editor in JHack.
Note that if you open a window to display text in a hotspot trigger, you have to close the windows yourself after you're done with them, otherwise they won't go away!
"@Turning on the hotspot..."
hotspot_on(1, 12, hotspot_text)
end
hotspot_text:
window_open(1)
"@You activated the hotspot!"
// wait for input, then close the window, then end the block
wait
window_closeall
eob
hotspot_off (hotspot)
Deactivate a hotspot.
hotspot
- hotspot to deactivate
Deactivates a hotspot that had been previously activated with hotspot_on
.
After deactivation, the hotspot's text will no longer be triggered when the player walks into the area defined by
the hotspot.
These commands affect the aural experience through playing sound effects, changing the music, applying effects to the currently playing music, and so on.
Command | Description |
sound | Play a sound effect. |
music | Play a music track. |
music_stop | Stop all music. |
music_resume | Resume playing music. |
music_effect | Apply music effect. |
music_switching_off | Disable map music switching. |
music_switching_on | Enable map music switching. |
sound (num)
Play a sound effect.
num
- index of the sound effect to play.
Plays a sound effect. Playback begins immediately, and text parsing continues while
the sound is playing. If num
is zero, the value in the argument register
will be loaded and used to look up the sound to play instead.
The following table lists the normal sound effects. Note that some of these effects may be different depending on what background music is playing. Sounds can also be specified using the more descriptive names listed here, which are defined in lib/stdarg.ccs.
Index | Name |
0 | (Load from argument register) |
1 | SND_CURSORBLIP |
2 | SND_CURSORCONFIRM |
3 | SND_CURSORBEEP |
4 | SND_CURSORNAME |
5 | SND_ERRORBEEP |
6 | (no sound) |
7 | SND_TEXTBLIP |
8 | SND_DOOROPEN |
9 | SND_DOORCLOSE |
10 | SND_PHONERING |
11 | SND_PHONEPICKUP |
12 | SND_KACHING |
13 | SND_FOOTSTEP |
14 | SND_BEEOOP |
15 | SND_BUZZ |
16 | SND_GIFTOPEN |
17 | SND_LANDING |
18 | SND_STAIRS |
19 | SND_HIGHBUZZ |
20 | SND_LOWBUZZ |
21 | SND_SQUEAKYBUZZ |
22 | SND_TRUMPET |
23 | SND_MUFFLEDBUZZ |
24 | SND_HEROATTACK |
25 | SND_MONSTERATTACK |
26 | SND_BASH |
27 | SND_SHOOT |
28 | SND_PRAYING |
29 | SND_PSI1 |
30 | SND_NORMALBASH |
31 | SND_SMASH |
32 | SND_HERODEATH |
33 | SND_ENEMYDEATH |
34 | SND_GIFTOPEN2 |
35 | SND_DODGE |
36 | SND_RECOVER |
37 | SND_STATUSRECOVER |
38 | SND_SHIELD1 |
39 | SND_SHIELD2 |
40 | SND_STATSUP |
41 | SND_STATSDOWN |
42 | SND_HYPNOSIS |
43 | SND_MAGNET |
44 | SND_PARALYSIS |
45 | SND_BRAINSHOCK1 |
46 | SND_THUMP |
47 | SND_CRITICAL |
48 | SND_ROCKIN1 |
49 | SND_ROCKIN2 |
50 | SND_ROCKIN3 |
51 | SND_FIRE1 |
52 | SND_FIRE2 |
53 | SND_FIRE3 |
54 | SND_BRAINSHOCK2 |
55 | SND_PSI2 |
56 | SND_FREEZE1 |
57 | SND_FREEZE2 |
58 | SND_DEFENSEDOWN1 |
59 | SND_DEFENSEDOWN2 |
60 | SND_THUNDERMISS |
61 | SND_THUNDERHIT1 |
62 | SND_THUNDERHIT2 |
Index | Name |
63 | SND_THUNDERDAMAGE |
64 | SND_STARSTORM |
65 | SND_FLASH1 |
66 | SND_FLASH2 |
67 | SND_FLASH3 |
68 | SND_EAT |
69 | SND_QUIETBEEP |
70 | SND_MISSILE |
71 | SND_HISS |
72 | SND_STATUSCHANGE |
73 | SND_PING |
74 | SND_THUMP2 |
75 | SND_MBR |
76 | SND_MAGNET2 |
77 | SND_MAGNET3 |
78 | SND_WHIRR |
79 | SND_PARALYSIS2 |
80 | SND_BRAINSHOCK3 |
81 | SND_DRILL |
82 | SND_SPORES |
83 | SND_AFFLICTED |
84 | SND_KERPOW |
85 | SND_MYSTERIOUS |
86 | SND_WARBLING |
87 | (no sound) |
88 | SND_SPROING |
89 | SND_REFUEL |
90 | SND_GIYGASWEAK |
91 | SND_FIRE4 |
92 | SND_MUFFLEDBUZZ2 |
93 | SND_SHIELDREFLECT |
94 | SND_CHIRP |
95 | SND_BUTTERFLY |
96 | SND_POSSESSED |
97 | SND_STAIRS2 |
98 | SND_DRUMS |
99 | SND_STARMASTER |
100 | SND_EDENWARP |
101 | SND_BIRDS |
102 | SND_SPECIALITEM |
103 | SND_LEARNPSI |
104 | SND_CHICKEN |
105 | SND_SPHINX1 |
106 | SND_SPHINX2 |
107 | SND_SPHINX3 |
108 | SND_SPHINX4 |
109 | SND_SPHINX5 |
110 | SND_PYRAMIDOPEN |
111 | SND_RAPIDKNOCK |
112 | (no sound) |
113 | SND_MANIMANI |
114 | SND_CREEPY |
115 | SND_BOXOPEN1 |
116 | SND_BOXTAKE |
117 | (unknown) |
118 | SND_CHICKEN2 |
119 | SND_PSI3 |
120 | SND_GUITAR |
121 | SND_BEEP2 |
122 | SND_TRUMPETBLAST |
123 | (no sound) |
124 | SND_FUNKY |
music (num)
Play a music track.
num
- index of the music track to play.
Changes the currently playing music to the specified track number. If num
is zero, the value in the argument register will be loaded and used as the track number.
The music change lasts until some other action changes the music. Note that walking onto an
area of the same map that has different music will cause a music change, unless the
music_switching_off
command has been used.
music_stop
Stop the music.
(None)
Stops all music playback. Music will stay off until some other action changes the currently playing music.
music_resume
Resume playing music.
(None)
Restarts the music using whatever music would normally be played on the area of the map the player currently occupies.
music_effect (num)
Applies a music effect.
num
- index of the music effect to apply.
Applies a specified effect to the currently playing music track.
If num
is zero, the value in the argument register is loaded
and used as the effect number.
Index | Description |
0 | (Load effect number from argument register) |
1 | Play normally |
2 | Quick fade out |
3 | Fade out |
4 | (No effect?) |
5 | Increase playback speed for one second |
6 | (No effect?) |
7 | Decrease volume slightly |
8 | Restore original volume |
9 - 14 | Disable sound channel 0 - 5 |
15 - 20 | Emphasize sound channel 0 - 5 |
21 | Increase overall pitch |
22 | (No effect?) |
23 | Decrease volume substantially |
music_switching_off
Disable map music switching.
(None)
Disables automatic music changes based on map areas. After this command has been executed,
moving to different areas (of the same map) will not cause the music to change, even if those
areas have different music. The command remains in effect until
music_switching_on
is used.
Map music switching is enabled by default.
music_switching_on
Enable map music switching.
(None)
Enables automatic music changes based on map areas. Moving to an area of the current map
that has different music will cause the currently playing music to change. This is the default
effect, and this will only not occur if music_switching_off
has been used.
These commands are primarily related to controlling the appearance of sprites and various visual effects.
Command | Description |
char_direction | Change character's direction |
sprite_direction | Change sprite's direction |
show_char | Visibility effect for party member |
show_party | Visibility effect for party |
show_char_float | Create floating sprite next to party member |
show_sprite_float | Create floating sprite next to TPT sprite |
hide_char | Make party member invisible |
hide_party | Make party invisible |
hide_sprite | Make a TPT sprite vanish |
hide_char_float | Remove party member's floating sprite |
hide_sprite_float | Remove TPT sprite's floating sprite |
char_direction (char, dir)
Change character direction.
char
- party member
dir
- direction to face
Changes the facing direction of a party member. If dir
is zero, the value
in the argument register will be loaded and used as the direction value.
# | Direction |
0 | (Load direction from argument register) |
1 | NORTH |
2 | NORTHEAST |
3 | EAST |
4 | SOUTHEAST |
5 | SOUTH |
6 | SOUTHWEST |
7 | WEST |
8 | NORTHWEST |
sprite_direction (tpt, dir)
Change sprite direction.
tpt
- TPT number of the sprite to change
dir
- direction to face
Changes the facing direction of a TPT sprite. The TPT sprite must be currently on screen
for this command to work; otherwise it will crash. If dir
is zero, the value
in the argument register will be loaded and used as the direction value. Direction values are
the same as for char_direction
.
show_char (char, effect)
Visibility special effect.
char
- party member to show
effect
- visibility transition effect to apply
Applies a visibility transition to a party member. Despite the name, this command can either make
a character visible or invisible, depending on the effect used.
If the party member was hidden with
hide_party
or hide_char
,
this command can be used to make them visible again.
It can also be used to make party members disappear using a special effect, instead of simply vanishing
instantly. However, note that if you make a party member invisible with this command, they will become
visible again as soon as the player moves. To hide party members permanently, use
hide_party
or hide_char
after using this command.
Effect | ID | Description |
0 | (Unknown) | |
1 | APPEAR | Appear instantly, but only if hidden with hide_char |
2 | APPEAR_BLINK | Appear by slow blinking |
3 | APPEAR_HORZ | Appear by interlaced horizontal lines |
4 | APPEAR_VERT | Appear by interlaced vertical lines |
5 | APPEAR_SPRAY | Appear by random pixels |
6 | (Unknown) | |
7 | APPEAR_FASTBLINK | Appear by fast blinking |
8 | VANISH_HORZ | Disappear by interlaced horizontal lines |
9 | VANISH_VERT | Disappear by interlaced vertical lines |
10 | VANISH_SPRAY | Disappear by random pixels |
// Make Ness disappear with a "pencil eraser" effect, and stay hidden
show_char(1, VANISH_SPRAY)
hide_char(1)
"@You can't see me!" next
// Make Ness visible again
show_char(1, APPEAR)
show_party (effect)
Visibility special effect for entire party.
effect
- visibility transition effect to apply
This command has the same effect as show_char
, only applied
to the whole party. It is equivalent to calling show_char(0xFF, effect)
.
show_char_float (char, float)
Create floating sprite next to character.
char
- party member to create floating sprite for
float
- index of the floating sprite to create
Creates a small floating sprite next to the specified party member.
Index | ID | Description |
0 | (Load index from argument register) | |
1 | FLOAT_SURPISE | Three small lines above the character's head |
2 | FLOAT_RADIO | Small walkie-talkie sprite to the left of the character |
3 | FLOAT_EXCLAIM | Exclamation point thought bubble |
4 | FLOAT_BULB | Light bulb above the character's head |
5 | FLOAT_ZAP | Small lightning bolts above the character's head |
6 | FLOAT_FLAG | Flag sprite |
7 | FLOAT_DRUMMER1 | Runaway Five drummer's head, to the left |
8 | FLOAT_DRUMMER2 | Runaway Five drummer's head, to the right |
9 | FLOAT_HEART | Heart sprite |
10 | FLOAT_BUSGUY1 | Bus driver's head, to the left |
11 | FLOAT_BUSGUY2 | Bus driver's head, to the right |
show_sprite_float (tpt, float)
Create floating sprite next to TPT sprite.
tpt
- TPT number of sprite to create floating sprite for
float
- index of the floating sprite to create
Creates a small floating sprite next to the specified TPT sprite. The TPT sprite must be
currently on screen, otherwise this command will crash horribly. This command uses the same
set of floating sprites as show_char_float
.
hide_char (char)
Make party member invisible.
char
- party member to hide
Makes a specified party member invisible. The effect will last until the party member is
specifically made visible again using show_char
or
show_party
.
hide_party
Make party invisible.
(None)
Makes the whole party invisible. Equivalent to hide_char(0xFF)
.
hide_sprite (tpt, effect)
Make a TPT sprite vanish.
tpt
- TPT number of sprite to hide
effect
- index of vanishing effect to use
Makes a specified TPT sprite disappear. The TPT sprite must be on screen when this command
is executed, or the game will crash. For the effect, you can use the same values as in the
effects table for show_char
, but note that even if you
use one of the "Appear" effects, the sprite will disappear at the end.
hide_char_float (char)
Remove floating sprites from a party member.
char
- party member to remove floating sprite from
Removes all floating sprites from the specified party member. See
show_char_float
.
hide_sprite_float (tpt)
Remove floating sprites from a TPT sprite.
tpt
- TPT number of sprite to remove floating sprites from
Removes all floating sprites from the specified TPT entry. See
show_sprite_float
.
Each window you open has three temporary storage values associated with it: the argument register, the counter register, and the result register.
if
statement works
based on the value of the result register, so any command that modifies the
result register can be used as a condition in an
if
statement.There is also space in each window's memory for a "storage" copy of each of these registers. The commands in this section primarily relate to the use of these registers and their storage copies.
Command | Description |
input | Create a number selector. |
arg | Load a value into the argument register |
arg_zero | Load zero into the argument register |
counter | Load a value into the counter register |
counter_zero | Load zerp into the counter register |
counter_is | Compare counter register to value |
inc | Increment the counter register |
swap | Swap the contents of the argument and result registers |
ctoarg | Copy counter to argument |
rtoarg | Copy result to argument |
result_is | Compare result register to value |
result_not | Compare result register to value |
store_registers | Write window registers to storage |
load_registers | Read window registers from storage |
input (digits)
Create a number selector.
digits
- number of digits in selector
Creates a number input selector. The number the player enters is stored in both the result register and the argument register of the current window.
// Create a 3-digit numeric input field
input(3)
"@You entered { number(0) }!"
end
arg (value)
Load value into argument register.
value
- value to put into argument register.
Loads a byte value into the argument register for the current window. If
the parameter value
is zero, the current value of the argument register
will be used - in other words, the argument register will not be changed. This
fact makes it tricky to guarantee a value of zero in the argument register; to do
this, use the command arg_zero
.
NOTE: executing this command overwrites the value of the counter register.
arg_zero
Load zero into argument register.
(None)
Loads a zero value into the argument register. (Note: it currently does this by comparing your cash on hand to 0xFFFFFFFF. If you figure out a way to have more than four billion dollars on hand, this command might not work.)
counter (value)
Load value into counter register.
value
- value to put into counter register.
Loads a byte value into the counter register for the current window. If value
is
zero, the value in the argument register will be used. This fact makes it tricky to simply put
a zero value into the counter register. To do that, use counter_zero
.
counter_zero
Load zero into counter register.
(None)
Loads a value of zero into the counter register.
counter_is (value)
Compare the counter register to a value.
value
- value to compare against counter register.
Compares the value of the counter register to the specified value. Returns "true" if the values are equal, "false" if they are not.
NOTE: executing this command overwrites the value of the argument register.
inc
Increment counter.
(None)
Adds one to the value of the counter register for the current window. If the counter register's value is 255 (0xFF), incrementing it will reset it to zero. The ability to increment the counter register makes it possible to perform simple loops.
// List all the item names.
counter_zero
loop_start:
if not counter_is(254)
{
ctoarg
"@{itemname(0)}" next
inc // Increment the counter and continue the loop
goto(loop_start)
}
"@Done with loop!" end
swap
Swap result and argument.
(None)
Swaps the contents of the current window's argument and result registers.
ctoarg
Copy counter to argument.
(None)
Copies the value of the current window's counter register into the current window's argument register.
rtoarg
Copy result to argument.
(None)
Copies the value of the current window's result register into the current window's argument register.
result_is (value)
Compare result to value.
value
- value to compare result to.
Compares the contents of the result register to the given byte value. The result register is then set to
"true" if the values are the same, or "false" otherwise. This command can be used with an
if
statement to branch based on the return value of any
command that modifies the result register.
Note that you can only compare against single-byte values, somewhat limiting the use of this command.
input(3)
if result_is(100) {
"@You entered 100!
}
result_not (value)
Compare result to value.
value
- value to compare result to.
Like result_is
, compares the result register to the given value,
but the return value is reversed: the result register is set to "false" if the values are equal, and to "true"
if they are not equal.
store_registers
Write active registers to storage.
(None)
Writes the active window's registers (result, argument, and counter) to the active window's storage, from
which they can be recovered later with load_registers
.
This is useful if you want to preserve the contents of the registers while performing some operation
that modifies them.
load_registers
Load active registers from storage.
(None)
Loads the active window's registers from the active window's storage.
See store_registers
.
These commands directly modify parts of the ROM, to allow you to specify certain options (such as the starting coordinates) or link parts of the ROM to text labels within your script.
Command | Description |
sprite_link | Link text to a sprite |
newgame_location | Change the starting coordinates |
newgame_startup | Change the flyover text pointer |
setup_music | Change the file select music |
setup_music2 | Change the character naming music |
setup_background | Change the file setup background |
on_refresh | Set door refresh text |
on_check | Set default "check" text |
sprite_link (tpt, target)
Link text pointer to sprite.
tpt
- TPT number of the sprite to link
target
- target to link sprite to
Links a sprite to a text address, so that talking to the sprite will display the desired text.
Generally, for target
you specify a label somewhere within your script, though you
can also pass an absolute address. The TPT number of a sprite on the map can be found using the
map editor.
fred:
"@Hi, my name is Fred!" end
sprite_link(42, fred) // link sprite #42 to the label 'fred'
newgame_location (x, y)
Change the starting coordinates
x
- x coordinate, in pixels
y
- y coordinate, in pixels
Changes the starting location of the game to the specified point. By default, the starting location is the beginning of the first flyover sequence. If the game starts with a flyover, the starting location and the beginning of the first flyover should be the same, otherwise graphical glitching might occur. So, if you use this command, but you still want to use an intro flyover, be sure you edit the flyover appropriately as well.
newgame_startup (target)
Changes the starting flyover pointer.
target
- location of the text to use at game startup
Sets the startup text pointer. You can use this command to change the intro sequence of the game. The default startup text begins the Onett flyover, so changing this pointer will also remove the default flyover.
init:
window_open(1)
"@Welcome to my hack!" wait
window_closeall
eob
newgame_startup(init)
setup_music (track)
Change the file select music.
track
- music track to play at file select
Changes the file select music to the specified track.
setup_music2 (track)
Change the character naming music.
track
- music track to play at naming screen
Changes the character naming music to the specified track.
setup_background (bg)
Change the background of the setup screen.
bg
- index of the battle background to use
Changes the background of the stup screen. The background of the setup screen is actually one of EB's battle background animations, so any battle background can be used. Note, however, that some battle backgrounds will appear in front of the file select windows, essentially making the setup screen unusable. Experiment a little and you should find one that works.
on_refresh (target)
Change the door refresh pointer.
target
- location of text to be used on entering a door
Changes the text pointer that is called whenever the player walks through a door. The default text entry checks the status of flag 0x12, and if it's set, generates a Buzz-Buzz sprite flying around the player. In other words, all it does is make sure Buzz-Buzz is visible if he's with you.
on_check (target)
Change the default "check" pointer.
target
- location of text to be used
Changes the default "check" pointer -- that is, the text pointer that is called whenever the player uses the "Check" action on something that is not checkable. By default, this simply says "No problem here."
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Command | Description |
anchor_set | Set exit mouse anchor |
anchor_warp | Warp to exit mouse anchor |
arg | Load a value into the argument register |
arg_zero | Load zero into the argument register |
Command | Description |
battle | Begin a battle. |
boost_exp | Give experience points. |
boost_iq | Increase IQ. |
boost_guts | Increase Guts. |
boost_luck | Increase Luck. |
boost_speed | Increase Speed. |
boost_vitality | Increase Vitality. |
Command | Description |
call | Jump to other text and return. |
char_direction | Change character's direction |
change_level | Change character level. |
clearline | Erase current text line. |
consumepp | Consume PP. |
consumepp_percent | Consume PP by percentage. |
counter | Load a value into the counter register |
counter_is | Compare counter register to value |
counter_zero | Load zerp into the counter register |
ctoarg | Copy counter to argument |
Command | Description |
delta | Display action delta. |
deposit | Add money to the ATM account |
Command | Description |
end | Prompt with end-of-block. |
eob | End-of-block marker. |
event | Cut to a special event sequence |
Command | Description |
font_normal | Use the normal font. |
font_saturn | Use the Mr. Saturn font |
full | Check if a character's inventory is full |
Command | Description |
give | Give an item to a character |
givemoney | Give money to the player |
goto | Jump to other text without return. |
Command | Description |
hasitem | Check if a character has an item |
hasmoney | Check if the player has an amount of money |
heal | Heal HP. |
heal_percent | Heal HP by percentage. |
healall | Revitalize all party members. |
hide_char | Make party member invisible |
hide_char_float | Remove party member's floating sprite |
hide_party | Make party invisible |
hide_sprite | Make a TPT sprite vanish |
hide_sprite_float | Remove TPT sprite's floating sprite |
hurt | Damage HP. |
hurt_percent | Damage HP by percentage. |
hotspot_on | Activate a hotspot |
hotspot_off | Deactivate a hotspot |
Command | Description |
inc | Increment the counter register |
inflict | Inflict a status change. |
input | Create a number selector. |
itemname | Print item names. |
Command | Description |
learnpsi | Learn a PSI technique |
load_registers | Read window registers from storage |
Command | Description |
money | Print right-aligned money value. |
music | Play a music track. |
music_effect | Apply music effect. |
music_resume | Resume playing music. |
music_stop | Stop all music. |
music_switching_off | Disable map music switching. |
music_switching_on | Enable map music switching. |
Command | Description |
name | Print character names. |
newgame_location | Change the starting coordinates |
newgame_startup | Change the flyover text pointer |
newline | Break to a new line. |
next | Prompt with nextline. |
number | Print numeric value. |
Command | Description |
on_refresh | Set door refresh text |
on_check | Set default "check" text |
open_wallet | Open the wallet window. |
Command | Description |
party_add | Add a party member |
pause | Pause for an amount of time. |
party_remove | Remove a party member |
prompt | Wait for input with prompt. |
psiname | Print PSI power names. |
Command | Description |
recoverpp | Recover PP. |
recoverpp_percent | Recover PP by percentage. |
result_is | Compare result register to value |
result_not | Compare result register to value |
rtoarg | Copy result to argument |
Command | Description |
save | Save the game |
set | Set an event flag. |
setup_music | Change the file select music |
setup_music2 | Change the character naming music |
setup_background | Change the file setup background |
show_char | Visibility effect for party member |
show_char_float | Create floating sprite next to party member |
show_party | Visibility effect for party |
show_sprite_float | Create floating sprite next to TPT sprite |
smash | Display "SMAAAASH" |
sound | Play a sound effect. |
sprite_direction | Change sprite's direction |
sprite_link | Link text to a sprite |
stat | Display various statistics. |
store_registers | Write window registers to storage |
swap | Swap the contents of the argument and result registers |
Command | Description |
take | Take an item from a character |
takemoney | Take money from the player |
target | Display action target. |
teleport | Use PSI Teleport |
teleportname | Print teleport names. |
text_pos | Force text positioning. |
text_color | Change text color. |
text_blips | Change text "blip" sounds. |
toggle | Toggle the state of an event flag. |
Command | Description |
unset | Unset an event flag. |
usable | Check if a character can use an item |
user | Display action user. |
Command | Description |
wait | Wait for input, no prompt. |
warp | Warp to a destination |
window_close | Close a specific window. |
window_closeall | Close all text windows. |
window_closetop | Close the current window. |
window_open | Open a window. |
window_switch | Switch to an already open window. |
withdraw | Remove money from the ATM account |
Command | Description |
youwon | Display "YOU WON" |