CCScript Command Reference

Table of contents
  1. Introduction
  2. Command reference
    1. Basic commands
    2. Window commands
    3. Text output and control
    4. Money and items
    5. Character stats
    6. Gameplay control
    7. Sounds and music
    8. Sprites and visual effects
    9. Memory and advanced commands
    10. ROM linkage commands
  3. Index

1. Introduction

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.

Navigating the documentation

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.

2. Command reference

2.1. Basic commands

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.
promptWait for input with prompt.
eob End-of-block marker.
pause Pause for an amount of time.
newlineBreak to a new line.
clearlineErase current text line.
set Set an event flag.
unset Unset an event flag.
toggleToggle the state of an event flag.
call Jump to other text and return.
goto Jump to other text without return.
next

Nextline with prompt.

Parameters

(none)

Description

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]".

Example

"@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.

Parameters

(none)

Description

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]".

Example

"@Hello... and, good-bye!" end
wait

Wait for input, no prompt.

Parameters

(None)

Description

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.

Parameters

(None)

Description

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.

Parameters

(None)

Description

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.

Parameters

ticks - the number of frames to pause for

Description

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.

Pause Slashes

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).

Example

"@Hello,/ is anyone there?" next "@.|.|.|.|." next "@Look, I know you're in there;" pause(30) " I can smell the Doritos!" end
newline

Break to a new line.

Parameters

(None)

Description

Breaks to a new line of text.

clearline

Erase the current text line.

Parameters

(None)

Description

Erases the current line of text. Subsequent text will appear at the beginning of the line.

set (n)

Set event flag.

Parameters

n - An event flag or event flag number.

Description

Sets (turns on) an event flag. The opposite of unset(n).

Example

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.

Parameters

n - An event flag or event flag number.

Description

Unsets (turns off) an event flag. The opposite of set(n).

Example

define ness_jammies = flag 0x2ED // Turn off Ness's pajamas unset(ness_jammies)
toggle (n)

Toggle event flag.

Parameters

n - An event flag or event flag number.

Description

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.

Parameters

target - A location to jump to.

Description

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.

Parameters

target - A location to jump to.

Description

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.

2.2. Window commands

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.

Parameters

num - Window number to open

Description

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.

Window sizes

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.

Parameters

num - Number of window to switch to.

Description

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.

Example

// 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.

Parameters

num - Window number to close

Description

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.

Parameters

(None)

Description

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.

Parameters

(None)

Description

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.

Parameters

(None)

Description

Opens a small window displaying the amount of money the player has on hand.

2.3. Text-related commands

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.
teleportnamePrint 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.

Parameters

x - Horizontal position of text, in pixels
y - Vertical position of text, in rows

Description

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.

Parameters

color - index of color "style" to use.

Description

Changes the color of subsequent text output. The color change only affects text in the current window until the end of the text block.

Color styles

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.

Parameters

num - text blip effect number

Description

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.

Parameters

(None)

Description

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.

Parameters

(None)

Description

Changes the current window's font to the normal text font.

smash

Display the "SMAAAASH" text graphic.

Parameters

(None)

Description

Displays the "SMAAAASH" text graphic in the current window.

Example

"@I got {smash}ed by a mouse."
youwon

Display the "YOU WON" text graphic.

Parameters

(None)

Description

Displays the "YOU WON" text graphic in the current window.

Example

"@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.

Parameters

index - index of the character whose name should be displayed.

Description

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.

Parameters

item - index of the item whose name should be printed.

Description

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.

Example

// Prints "@Item 42 is the Hyper beam." "@Item 42 is the {itemname(42)}." end
psiname (index)

Display a PSI name.

Parameters

index - index of the PSI power to print.

Description

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.

Parameters

dest - index of the teleport destination to print.

Description

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.

Parameters

val - value to display as a number.

Description

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.

Example

number(42) // prints "42" number(0x100) // prints "256" "@I have {number(0xA)} dollars." // prints "@I have 10 dollars."
money (val)

Display a cash amount.

Parameters

val - value to display as money.

Description

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.

Example

money(0xFF) // prints "$25500" define item = 0x5A define price = 4000 "{itemname(item)} {money(price)}." // prints "Hamburger $400000"
user

Display the user of an action.

Parameters

(None)

Description

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.

Parameters

(None)

Description

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.

Parameters

(None)

Description

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.

Parameters

num - index of the stat to display.

Description

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

2.4. Money and items

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.

Parameters

char - party member to give the item to
item - item to give

Description

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.

Example

"@{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.

Parameters

char - party member to take the item from
item - item to take

Description

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.

Example

take(0xFF, 211) "@({name(1)}'s Tendakraut was stolen.)" end
hasitem (char, item)

Check if a party member has an item.

Parameters

char - party member to check
item - item number to check for

Description

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.

Example

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.

Parameters

char - party member to check.

Description

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.

Example

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.

Parameters

amount - amount of money to give.

Description

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.

Parameters

amount - amount of money to take.

Description

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.

Parameters

amount - amount of money to check for.

Description

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.

Example

"@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.

Parameters

amount - amount of money to deposit.

Description

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.

Parameters

amount - amount of money to remove.

Description

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.

Parameters

char - party member to check
item - item number to check for usability

Description

Returns "true" if the party member char can use item number item, "false" otherwise.

2.5. Character status

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_percentRecover PP by percentage.
consumepp_percentConsume 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.

Parameters

char - character to inflict with a status ailment.
status - status ailment to inflict.

Description

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.

Parameters

(None)

Description

Heals all party members completely, restoring both HP and PP fully.

Example

"@(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.

Parameters

char - character to heal.
amount - amount of HP to recover.

Description

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.

Parameters

char - character to hurt.
amount - amount of HP damage to deal.

Description

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.

Parameters

char - character to heal.
percent - percentage of HP to recover.

Description

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.

Parameters

char - character to hurt.
percent percentage of HP to deplete.

Description

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.

Example

"@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.

Parameters

char - character whose PP will be restored
amount - amount of PP to restore

Description

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.

Parameters

char - character whose PP will be depleted
amount - amount of PP to deplete.

Description

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.

Parameters

char - character whose PP will be restored.
percent - percentage of PP to restore.

Description

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.

Parameters

char - character whose PP will be depleted.
percent - percentage of PP to deplete.

Description

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.

Example

"@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.

Parameters

char - character whose level will change.
level - the new level.

Description

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!

Example

// 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.

Parameters

char - character to give EXP to.
exp - amount of EXP to give.

Description

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.

Example

boost_exp(1, 1) "@It was a good experience." end
boost_iq (char, amount)

Increase IQ stat.

Parameters

char - character whose IQ will be increased.
amount - amount of IQ to give.

Description

Increases the IQ stat of the specified character.

boost_guts (char, amount)

Increase Guts stat.

Parameters

char - character whose Guts will be increased.
amount - amount of Guts to give.

Description

Increases the Guts stat of the specified character.

boost_speed (char, amount)

Increase Speed stat.

Parameters

char - character whose Speed will be increased.
amount - amount of Speed to give.

Description

Increases the Speed stat of the specified character.

boost_vitality (char, amount)

Increase Vitality stat.

Parameters

char - character whose Vitality will be increased.
amount - amount of Vitality to give.

Description

Increases the Vitality stat of the specified character.

boost_luck (char, amount)

Increase Luck stat.

Parameters

char - character whose Luck will be increased.
amount - amount of Luck to give.

Description

Increases the Luck stat of the specified character.

2.6. Gameplay control

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.

Parameters

num - index of the battle group to fight

Description

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.

Example

"@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.

Parameters

dest - index of the destination to warp to.

Description

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.

Example

"@Hello... and, good-bye!" next "@Shall I?" newline menu { "Yes" : { } "No" : { warp(0x6a) eob } }
teleport (dest, type)

Use PSI Teleport.

Parameters

dest - PSI Teleport destination to warp to.
type - type of Teleport to use.

Description

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.

Teleport Types

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.

Parameters

(None)

Description

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.

Parameters

(None)

Description

Warps the party to the exit mouse anchor, which was previously set with anchor_set.

Example

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.

Parameters

num - special event number.

Description

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.

Special Events Table

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.

Parameters

char - party member who will learn the PSI power.
psi - PSI power to learn.

Description

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.

PSI Powers

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.

Parameters

char - index of character to add

Description

Adds a character to the party.

Example

"@{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.

Parameters

char - index of character to remove

Description

Removes a character from the party.

Example

party_remove(2) "@Oh great, Paula got kidnapped again." end
save

Save the game.

Parameters

(None)

Description

Saves the game into the current file slot.

hotspot_on (slot, hotspot, target)

Activate a hotspot.

Parameters

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

Description

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!

Example

"@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.

Parameters

hotspot - hotspot to deactivate

Description

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.

2.7. Music and sound

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.

Parameters

num - index of the sound effect to play.

Description

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.

Effects table

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.

Parameters

num - index of the music track to play.

Description

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.

Parameters

(None)

Description

Stops all music playback. Music will stay off until some other action changes the currently playing music.

music_resume

Resume playing music.

Parameters

(None)

Description

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.

Parameters

num - index of the music effect to apply.

Description

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.

Effects

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 - 20Emphasize sound channel 0 - 5
21 Increase overall pitch
22 (No effect?)
23 Decrease volume substantially
music_switching_off

Disable map music switching.

Parameters

(None)

Description

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.

Parameters

(None)

Description

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.

2.8. Sprites and visual effects

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.

Parameters

char - party member
dir - direction to face

Description

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.

Parameters

tpt - TPT number of the sprite to change
dir - direction to face

Description

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.

Parameters

char - party member to show
effect - visibility transition effect to apply

Description

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.

Transition Effects

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_FASTBLINKAppear 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

Example

// 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.

Parameters

effect - visibility transition effect to apply

Description

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.

Parameters

char - party member to create floating sprite for
float - index of the floating sprite to create

Description

Creates a small floating sprite next to the specified party member.

Floating Sprites

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.

Parameters

tpt - TPT number of sprite to create floating sprite for
float - index of the floating sprite to create

Description

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.

Parameters

char - party member to hide

Description

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.

Parameters

(None)

Description

Makes the whole party invisible. Equivalent to hide_char(0xFF).

hide_sprite (tpt, effect)

Make a TPT sprite vanish.

Parameters

tpt - TPT number of sprite to hide
effect - index of vanishing effect to use

Description

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.

Parameters

char - party member to remove floating sprite from

Description

Removes all floating sprites from the specified party member. See show_char_float.

hide_sprite_float (tpt)

Remove floating sprites from a TPT sprite.

Parameters

tpt - TPT number of sprite to remove floating sprites from

Description

Removes all floating sprites from the specified TPT entry. See show_sprite_float.

2.9. Memory and advanced commands

Each window you open has three temporary storage values associated with it: the argument register, the counter register, and the result register.

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.

Parameters

digits - number of digits in selector

Description

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.

Example

// Create a 3-digit numeric input field input(3) "@You entered { number(0) }!" end
arg (value)

Load value into argument register.

Parameters

value - value to put into argument register.

Description

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.

Parameters

(None)

Description

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.

Parameters

value - value to put into counter register.

Description

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.

Parameters

(None)

Description

Loads a value of zero into the counter register.

counter_is (value)

Compare the counter register to a value.

Parameters

value - value to compare against counter register.

Description

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.

Parameters

(None)

Description

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.

Example

// 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.

Parameters

(None)

Description

Swaps the contents of the current window's argument and result registers.

ctoarg

Copy counter to argument.

Parameters

(None)

Description

Copies the value of the current window's counter register into the current window's argument register.

rtoarg

Copy result to argument.

Parameters

(None)

Description

Copies the value of the current window's result register into the current window's argument register.

result_is (value)

Compare result to value.

Parameters

value - value to compare result to.

Description

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.

Example

input(3) if result_is(100) { "@You entered 100! }
result_not (value)

Compare result to value.

Parameters

value - value to compare result to.

Description

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.

Parameters

(None)

Description

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.

Parameters

(None)

Description

Loads the active window's registers from the active window's storage. See store_registers.

2.10. ROM linkage commands

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_locationChange 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_backgroundChange 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.

Parameters

tpt - TPT number of the sprite to link target - target to link sprite to

Description

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.

Example

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

Parameters

x - x coordinate, in pixels
y - y coordinate, in pixels

Description

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.

Parameters

target - location of the text to use at game startup

Description

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.

Example

init: window_open(1) "@Welcome to my hack!" wait window_closeall eob newgame_startup(init)
setup_music (track)

Change the file select music.

Parameters

track - music track to play at file select

Description

Changes the file select music to the specified track.

setup_music2 (track)

Change the character naming music.

Parameters

track - music track to play at naming screen

Description

Changes the character naming music to the specified track.

setup_background (bg)

Change the background of the setup screen.

Parameters

bg - index of the battle background to use

Description

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.

Parameters

target - location of text to be used on entering a door

Description

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.

Parameters

target - location of text to be used

Description

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."

3. Index

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

A

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

B

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.

C

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

D

Command Description
delta Display action delta.
deposit Add money to the ATM account

E

Command Description
end Prompt with end-of-block.
eob End-of-block marker.
event Cut to a special event sequence

F

Command Description
font_normal Use the normal font.
font_saturn Use the Mr. Saturn font
full Check if a character's inventory is full

G

Command Description
give Give an item to a character
givemoney Give money to the player
goto Jump to other text without return.

H

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

I

Command Description
inc Increment the counter register
inflict Inflict a status change.
input Create a number selector.
itemname Print item names.

J

K

L

Command Description
learnpsi Learn a PSI technique
load_registers Read window registers from storage

M

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_offDisable map music switching.
music_switching_on Enable map music switching.

N

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.

O

Command Description
on_refresh Set door refresh text
on_check Set default "check" text
open_wallet Open the wallet window.

P

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.

Q

R

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

S

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

T

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.

U

Command Description
unset Unset an event flag.
usable Check if a character can use an item
user Display action user.

V

W

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

X

Y

Command Description
youwon Display "YOU WON"

Z