-
Notifications
You must be signed in to change notification settings - Fork 6
1.commands
The following document explains what every command in the game does.
- Time in these commands is always defined in terms of frames. The game assumes a frame is 1/30 of a second, i.e. 30 frames per second. Thus, to wait one second,
one would
WAIT
for 30 frames.
Parameters: None
Displays the "Main Topic -> Avoid" graphics.
Parameters: None
When used in the initial script section, starts execution to the first script block. Otherwise, makes the script return to whatever called it (e.g. the puzzle phase) or returns you to the investigation phase.
Parameters:
-
Background
: The background to be displayed
Displays a background image on the lower screen. The background image can only be of type TEX_BG
.
Subroutine address: 0x205602C
While this is listed as a separate command, it uses the same routine as BG_DISP
.
Parameters:
-
Background
: The CG background to be displayed -
Display from Bottom
: If true, displays the bottom of a tall background (TEX_CG_SINGLE
); if false, displays the top
BG_DISPCG
works as BG_DISP
but can display a larger variety of textures – namely, TEX_CG
, TEX_CG_DUAL_SCREEN
,
TEX_CG_WIDE
, and TEX_CG_SINGLE
BGs. Notably, these are all CGs as opposed to VN backgrounds. Before displaying a standard BG after calling BG_DISPC,
one should call BG_REVERT
.
Subroutine address: 0x20541E0
Parameters:
-
Background
: The background to display as withBG_DISP
-
Background (Temp/CG)
: The index of a background to display asBG_DISPCG
; specify instead ofBackground
-
Fade Time (Frames)
: The time to fade in in frames
Like the other BG display commands but crossfades the background rather than just displaying it.
Parameters: None
Reverts the background to the last call of BG_DISP
(i.e. undoes any BG_FADE
or BG_DISPCG
calls).
This is required before returning to displaying standard TEX_BG
BGs. Note that if reverting a TEX_CG_DUAL_SCREEN
BG, SET_PLACE
must have been used to set the place location and have it displayed.
BG_REVERT
does something odd to previously displayed CGs that makes attmpeting to display them again after the BG_REVERT
crash/freeze/soft lock the game.
If you need to go back and forth between the same CGs, consider using BG_FADE
.
Parameters:
-
Scroll Direction
: The direction to scroll the BG -
Scroll Speed
: Speed at which to scroll (1 is a good default)
When a background that is larger than the screen is shown (such as TEX_CG_DUAL_SCREEN
, TEX_CG_WIDE
, and TEX_CG_SINGLE
),
scrolls the background in a DEFINED direction.
Parameters:
-
Music
: The background music to start or stop playing -
Mode
: Whether to start or stop the music -
Volume
: The volume of the BGM (0 is silent, 100 is max) -
Fade In Time (Frames)
: Time in frames that the BGM will fade in -
Fade Out Time (Frames)
: Time in frames that the BGM will fade out
Plays or stops background music.
Parameters: None
Clears all chessboard annotations. Unused.
Parameters:
-
Chess File
: The chess file to load
Loads a chess file into memory and (if the chess overlay is loaded) places it on the chessboard.
Parameters:
-
White Space Begin
: The space where a white piece to move is -
White Space End
: The space where the white piece should move to -
Black Space Begin
: The space where a black piece to move is -
Black Space End
: The space where the black piece should move to
Moves a piece (or pieces) on the chessboard.
Parameters: None
Resets the chessboard to its original state.
Parameters:
-
Cross Space 0-15
: The spaces to place/remove a cross on
Crosses out spaces on the chessboard with a red X. If a space is already crossed out, this command uncrosses it out.
Parameters:
-
Piece 1
: A space containing a piece whose potential moves to highlight -
Piece 2
: A space containing a piece whose potential moves to highlight -
Piece 3
: A space containing a piece whose potential moves to highlight -
Piece 4
: A space containing a piece whose potential moves to highlight
Highlights the potential moves of a piece in red. If a piece has already been highlighted, this command unhighlights it.
Parameters:
-
Clear Block
: Script block to go to if the chess game is cleared -
Miss Block
: Script block to go to if the chess game is failed -
Miss 2 Block
: Script block to go to if the chess game is failed in some unused way
Monitors for the end of the chess game and then jumps to a specified script block depending on the outcome.
Parameters:
-
Highligh Space 0-15
: The spaces to highlight
Highlights spaces on the chessboard in yellow. If a space is already highlighted, this command unhighlights it.
Parameters:
-
Chibi
: The chibi to emote -
Emote
: The emote that should be shown
This command displays an emote in a speech bubble above a chibi figure on the top screen.
Parameters:
-
Chibi
: Specifies the chibi to enter or exit -
Enter/Exit
: Specifies whether the chibi is entering or exiting -
Delay (Frames)
: Specifies the number of frames after which the chibi should enter or exit
Specifies a chibi figure to enter or exit the top screen.
Parameters:
-
Visible
: If true turns confetti on. If false, turns it off.
Displays falling confetti on the top screen.
Parameters:
-
Dialogue
: The dialogue line, composed of a speaker and the dialogue text -
Sprite
: The character sprite to display when the dialogue is displayed -
Sprite Entrance Transition
: Transition that makes the sprite enter -
Sprite Exit/Move Transition
: Transition that makes the sprite exit or moves it around -
Sprite Shake
: Applies a shaking effect to the sprite -
Voice Line
: The voice line to play -
Text Voice Font
: The voice font to be applied when no voiced line is used, as defined by the dialogue config item -
Text Speed
: The speed at which the text is rendered, as defined by the dialogue config item -
Text Entrance Effect
: The effect to use as the text is printed to the screen -
Sprite Layer
: Determines which "layer" a sprite should be rendered on on entrance; higher numbers are rendered on top of lower ones -
Don't Clear Text
: If true, continues displaying the next dialogue line in the same box -
No Lip Flap
: Manually disables lip flaps for dialogue that would otherwise have them
Displays a line of dialogue and/or manipulates character sprites.
A couple of notes on sprites:
- Sprites are associated with a speaker
- Sprites will not be displayed unless the first sprite is given an entrance transition
- After the first sprite is displayed for a speaker, other sprites of that speaker can be switched to without entrance transitions
- Sprites will not exit unless the sprite is specified with an exit transition
Parameters:
-
Episode Header
: The index of the title texture to use, i.e. 1 = Episode 1, 2 = Episode 2, 3 = Episode 3, 4 = Episode 4, 5 = Episode 5, 6 = Epilogue (if you want to be really clever, -1 is the main menu title)
Sets the upper screen to be an episode title texture.
Parameters:
-
Flag
: The flag to set or clear -
Set
: 1 = set, 0 = clear
Sets or clears a flag.
Parameters:
-
Global
: The global variable to modify (G03-G08) -
Value
: The value to add to the global variable
Modifies one of six global variables. These variables persist across scenes.
Parameters:
-
Value
: The value to set variableglobal2D
to
Sets a global variable to a specified value. Only used in one place so it's difficult to determine what it affects.
Parameters:
-
Script Section
: The section to jump to
Jumps to a particular script section.
Parameters:
-
Add
: The value to add to the Haruhi Meter (positive values move the meter toward Distracted while negative values move it toward Focused) -
Set
: The value to set the Haruhi Meter at (does not show the meter)
Modifies the value of the Haruhi Meter. The meter minimum is 0 (corresponding to 10%) and the meter maximum is 9 (corresponding to 100%).
Parameters:
-
Add
: The value to add to the Haruhi Meter
Adds to the Haruhi Meter without showing the Haruhi Meter UI (the sound effects are still played). Unused in the game.
Parameters: None
Stops script execution until input is received from the player.
Parameters: None
Unknown, unused in the game.
Parameters: None
Ends investigation mode and returns to the main visual novel format of the game. Automatically fades screen to black.
Parameters:
-
Item
: The item to display X
Y
Displays the specified item image. Under certain circumstances, this should work; however it seems this soft locks the game most of the time. Unused.
Parameters:
unknown00
unknown01
unknown02
unknown03
-
End Script Section
: The script section that starts with theINVEST_END
command.
Starts investigation mode. Automatically fades screen in from black.
Parameters:
-
"Kinetic" Background
: The "kinetic" background to display on the top screen
Displays a particular "kinetic" (my word) background on the top screen. Must be of type KINETIC_SCREEN
.
Parameters:
-
Map
: The map to load
Loads an isometric map for usage by INVEST_START
.
Parameters: None
Ends the scene and moves to the next one as listed in the Scenario item.
Parameters: None.
Does nothing.
Parameters: None.
Does nothing.
Parameters: None.
Does nothing.
Parameters: None
Suppresses the top screen UI, disables dialogue skipping, and marks the center of the screen as the position the Kyon chibi walks to, and sends the Kyon chibi out. Used only in the opening text crawl.
Parameters:
-
Mode
: The palette effect to be applied (available effects are default, inverted, grayscale, sepia, and dimmed) -
Time (Frames)
: The time in frames that the BG's palette will take to switch to transition to the effect palette -
Unknown
: This clearly does things when looking at the assembly/decomp, but I don't know what it's doing precisely
Parameters:
-
Dialogue
: Dialogue line as in theDIALOGUE
command
Draws a dialogue line as monologue over all other dialogue. Undone by completing a chess game.
Subroutine address: 0x00
Removed in final version of game (not referenced in any scripts.)
Parameters:
-
Scene
: Name of the script file to go to
Goes to a particular scene. Note that this scene cannot be just any evt file in evt.bin; it must be contained within a special array in ARM9 itself; thus, ROM hacks may decide to change the location of this array.
Parameters:
-
Scene
: Name of the script file to go to
Behaves as SCENE_GOTO
, except this command does not clear a flag before jumping. Otherwise, they seem to be identical.
Parameters:
-
Fade Time (Frames)
: The length of the fade in frames -
Fade In Percentage
: The percentage darkness to fade into (where 0 is fully bright and 100 is fully dark; e.g. 50 means the screen will be 50% darker than full brightness when the fade in is complete); only respected by custom color fades -
Location
: The screen(s) the fade will be applied to -
Color
: Either black, white, or the custom color set by a previousSCREEN_FADEOUT
; this parameter must match that of the previousSCREEN_FADEOUT
call
Causes the screen to fade in.
Parameters:
-
Fade Time (Frames)
: The length of the fade in frames -
Fade out Percentage
:The percentage darkness to fade into (where 0 is fully bright and 100 is fully dark; e.g. 50 means that the screen will be 50% brighter than full black when the fade is complete); only respected by color fades -
Custom Color
: The color the fade will be ifColor
is set toCUSTOM
-
Location
: The screen(s) the fade will be applied to -
Color
: Either black, white, or the custom color defined byCustom Color
; this parameter must match that of the subsequentSCREEN_FADEIN
call
Causes the screen to fade out.
Parameters:
-
Fade In Time (Frames)
: Time for the fade in portion of the flash in frames -
Hold Time (Frames)
: Time to hold on the flash color in frames -
Fade Out Time (Frames)
: Time for the fade out portion of the flash in frames -
Color
: The color of the flash
Flashes the screen a specified color for a specified amount of time.
Parameters:
-
Duration (Frames)
: Effect duration in frames (if -1, shakes indefinitely) -
Horizontal Intensity
: Intensity of the shake in the horizontal direction -
Vertical Intensity
: Intensity of the shake in the vertical direction
Shakes the bottom screen.
Parameters: None
Stops screen shaking from a SCREEN_SHAKE
command. (Used when the Duration
parameter of said SCREEN_SHAKE
is set to -1).
Parameters:
-
Option 1
: The first choice to be presented -
Option 2
: The second choice to be presented -
Option 3
: The third choice to be presented -
Option 4
: The fourth choice to be presented unknown08
unknown0A
unknown0C
unknown0E
Presents the player with a series of choices that branch the dialogue tree. Choices are defined in their own section and have IDs that correspond to labels set in the labels section. When a choice is chosen, this ID is used to select which script block will be jumped to.
SELECT
cannot be used in the initial, unnamed script block.
Parameters:
-
Display?
: Whether to display the location graphic or not -
Place
: The place to display
Modifies the displayed place name.
Parameters:
-
Scenes to Skip
: Number of scenes that should be skipped
Sets up the NEXT_SCENE
command to skip a specified number of scenes as defined in SCENARIO.S
(evt.bin #580).
Parameters:
-
Sound
: The sound to be played fromsnd.bin
-
Mode
: Whether to start or stop the sound -
Volume
: The volume of the sound -
Crossfade Time (Frames)
: Time in frames that the sound will crossfade; only can be used when changing the volume of the same sound
Plays a sound from the SDAT snd.bin
.
Parameters: None
Stops script execution and soft locks the game. Unused.
Parameters:
-
Show
: Whether to show the dialogue box or not
Shows/hides the dialogue box. Note that plenty of other commands already do one of these (e.g., DIALOGUE
automatically shows the dialogue box).
Parameters:
-
Topic
: The topic to give the player
Give the player a particular topic.
Parameters:
-
Transition
: The transition to use
Plays a transition to black.
Paremters:
-
Transition
: The transition to use
Plays a transition from black into the scene.
Parameters: None
Unused in the game, unknown what this does.
-
Voice Line
: The voiced line to play
Plays a voice file.
Parameters:
-
Conditional
: The conditional to check -
Script Section
: The script section to jump to
Goes to a specified script section if a specified conditional is true.
Parameters:
-
Time (Frames)
: The number of frames to wait
Waits a particular number of frames.
Parameters:
-
Time (Frames)
: The number of frames to wait.
A command nearly identical to WAIT
, but allows for the wait to be canceled with a button press or screen tap.