List of Opcodes: Difference between revisions
m A bit more opcodes, up to 0x8E |
m More opcode documentation (up to 0xA7) |
||
| Line 587: | Line 587: | ||
# The Map Background S01P01A with the hero idling on a World Map Marker. | # The Map Background S01P01A with the hero idling on a World Map Marker. | ||
# Allows for the Top Screen to display a Map Background from a Level using the <code>back2_SetGround</code> opcode. | # Allows for the Top Screen to display a Map Background from a Level using the <code>back2_SetGround</code> opcode. | ||
# Splits the Map Background used in the Level defined by <code>back_SetGround</code> equally between the Top and | # Splits the Map Background used in the Level defined by <code>back_SetGround</code> equally between the Top and Touch Screen. | ||
#Splits the Map Background used in the Level defined by <code>back_SetGround</code> between the Top and | #Splits the Map Background used in the Level defined by <code>back_SetGround</code> between the Top and Touch Screen. | ||
|} | |} | ||
=== 0x19 - back2_SetSpecialActing === | === 0x19 - back2_SetSpecialActing === | ||
| Line 1,896: | Line 1,896: | ||
|sint | |sint | ||
|mode | |mode | ||
|Most modes are not known, but 32767 opens the | |Most modes are not known, but: | ||
* 32767 opens the dungeon selection menu. | |||
* 251 stops the current script to reload Unionall starting from the Coroutine CORO_MOVE_WORLD_MAP. | |||
|- | |- | ||
|2 | |2 | ||
| Line 1,917: | Line 1,920: | ||
|sint | |sint | ||
|dungeon_id | |dungeon_id | ||
|The dungeon ID to enter, which are all listed in the Dungeons tab of SkyTemple. A value of -1 actually enters | |The dungeon ID to enter, which are all listed in the Dungeons tab of SkyTemple. A value of -1 actually enters dungeon mode—it is insufficient to use this opcode a single time to enter a specific dungeon. | ||
|- | |- | ||
|2 | |2 | ||
| Line 1,925: | Line 1,928: | ||
|} | |} | ||
=== 0x8e - main_EnterGround === | === 0x8e - main_EnterGround === | ||
Stops the current script to reload Unionall starting from the Coroutine CORO_EVENT_DIVIDE. This opcode also updates | Stops the current script to reload Unionall starting from the Coroutine CORO_EVENT_DIVIDE. This opcode also updates the following script variables: | ||
* <code>$GROUND_ENTER</code>: This opcode's ''level_id_enter'' parameter. | |||
* <code>$GROUND_ENTER_LINK</code>: Set to 0. | |||
* <code>$GROUND_GETOUT</code>: The value of <code>$GROUND_ENTER</code> prior to using this opcode. | |||
* <code>$GROUND_MAP</code>: The Level ID used to display the Map Background. | |||
* <code>$GROUND_PLACE</code>: The World Map Marker ID that determines where the player appears on the Top Screen when selecting "Map and team" in the overworld. | |||
* <code>$GROUND_START_MODE</code>: Set to 3. | |||
In the base game, using this opcode allows for transitioning between Levels in the Overworld, as the game will eventually run the <code>supervision_ExecuteEnter</code> opcode. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 1,946: | Line 1,958: | ||
|} | |} | ||
=== 0x8f - main_EnterGroundMulti === | === 0x8f - main_EnterGroundMulti === | ||
< | Stops the current script to reload Unionall starting from the Coroutine CORO_EVENT_DIVIDE. This opcode also updates the following script variables: | ||
* <code>$GROUND_ENTER</code>: This opcode's ''level_id_enter'' parameter. | |||
* <code>$GROUND_ENTER_LINK</code>: This opcode's ''level_id_link'' parameter. | |||
* <code>$GROUND_GETOUT</code>: The value of <code>$GROUND_ENTER</code> prior to using this opcode. | |||
* <code>$GROUND_MAP</code>: The Level ID used to display the Map Background. | |||
* <code>$GROUND_PLACE</code>: The World Map Marker ID that determines where the player appears on the Top Screen when selecting "Map and team" in the overworld. | |||
* <code>$GROUND_START_MODE</code>: Set to 3. | |||
In the base game, using this opcode allows for transitioning between Levels in the Overworld, as the game will eventually run the <code>supervision_ExecuteEnter</code> opcode. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 1,957: | Line 1,978: | ||
|- | |- | ||
|1 | |1 | ||
| | |Level | ||
| | |level_id_enter | ||
| | |An entry in the Level List. Ideally, this opcode would load the specified Level's Enter00 script. | ||
|- | |- | ||
|2 | |2 | ||
|uint | |uint | ||
| | |duration | ||
| | |The number of frames to fade out the screens. | ||
|- | |- | ||
|3 | |3 | ||
| | |Level | ||
| | |level_id_link | ||
| | |An entry in the Level List. Used to update <code>$GROUND_ENTER_LINK</code>. | ||
|} | |} | ||
=== 0x90 - main_EnterRescueUser === | === 0x90 - main_EnterRescueUser === | ||
< | Exits ground mode and begins dungeon mode while taking an SOS Mail. Dungeon selection seems to be determined by the SOS Mail chosen via <code>message_Menu(MENU_S_O_S_MAIL_PICKER);</code>. | ||
{| class="wikitable" | {| class="wikitable" | ||
| Line 1,984: | Line 2,005: | ||
|1 | |1 | ||
|uint | |uint | ||
| | |duration | ||
| | |The number of frames to fade out the screens. | ||
|} | |} | ||
=== 0x91 - main_EnterTraining === | === 0x91 - main_EnterTraining === | ||
Performs various functions related to entering a dungeon using Marowak Dojo. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 2,000: | Line 2,021: | ||
|1 | |1 | ||
|uint | |uint | ||
| | |mode | ||
| | |Most modes are not known, but: | ||
* 32767 opens the generic dojo selection menu | |||
* 251 goes to the Coroutine CORO_GOTO_TRAINING_DUNGEON, which later stops the current script to reload Unionall starting from the Coroutine CORO_ENTER_TRAINING_DUNGEON. | |||
|- | |- | ||
|2 | |2 | ||
|uint | |uint | ||
|unk1 | |unk1 | ||
| | |Currently unknown. | ||
|} | |} | ||
=== 0x92 - main_EnterTraining2 === | === 0x92 - main_EnterTraining2 === | ||
Performs various functions related to entering a dungeon using Marowak Dojo's Final Maze. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 2,021: | Line 2,045: | ||
|1 | |1 | ||
|uint | |uint | ||
| | |mode | ||
| | |Most modes are not known, but: | ||
* 32767 opens a dojo selection menu that only involves Final Maze. | |||
* 251 goes to the Coroutine CORO_GOTO_TRAINING_DUNGEON, which later stops the current script to reload Unionall starting from the Coroutine CORO_ENTER_TRAINING_DUNGEON. | |||
|- | |- | ||
|2 | |2 | ||
|uint | |uint | ||
|unk1 | |unk1 | ||
| | |Currently unknown. | ||
|} | |} | ||
=== 0x93 - main_SetGround === | === 0x93 - main_SetGround === | ||
< | Updates the following variables' values to be this opcode's ''level_id'' parameter: | ||
* <code>$GROUND_ENTER</code> | |||
* <code>$GROUND_GETOUT</code> | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 2,043: | Line 2,073: | ||
|Level | |Level | ||
|level_id | |level_id | ||
| | |An entry in the Level List. | ||
|} | |} | ||
=== 0x94 - me_Play === | === 0x94 - me_Play === | ||
Instantly plays a special sound effect that can seamlessly interrupt any BGM tracks that are currently playing. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 2,059: | Line 2,089: | ||
|uint | |uint | ||
|me_id | |me_id | ||
| | |A sound effect defined in SOUND/ME of the ROM. | ||
|} | |} | ||
=== 0x95 - me_Stop === | === 0x95 - me_Stop === | ||
< | Instantly stops the currently-playing special sound effect called with <code>me_Play</code>. | ||
No parameters. | No parameters. | ||
=== 0x96 - message_Close === | === 0x96 - message_Close === | ||
Suspends the current routine and allows for closing an active textbox (and portrait, if active) set by one of the following opcodes: | |||
* <code>message_ImitationSound</code> | |||
* <code>message_Mail</code> | |||
* <code>message_Monologue</code> | |||
* <code>message_Notice</code> | |||
* <code>message_SpecialTalk</code> | |||
* <code>message_Talk</code> | |||
By pressing the A Button, B Button, or tapping the textbox via the Touch Screen. Once the textbox is closed, the current routine resumes. | |||
No parameters. | No parameters. | ||
=== 0x97 - message_CloseEnforce === | === 0x97 - message_CloseEnforce === | ||
Instantly closes an active textbox (and portrait, if active) once the game finishes displaying a string set by one of the following opcodes: | |||
* <code>message_ImitationSound</code> | |||
* <code>message_Mail</code> | |||
* <code>message_Monologue</code> | |||
* <code>message_Notice</code> | |||
* <code>message_SpecialTalk</code> | |||
* <code>message_Talk</code> | |||
No parameters. | No parameters. | ||
=== 0x98 - message_Explanation === | === 0x98 - message_Explanation === | ||
Displays the string defined in the | Displays the string defined in the ''txt'' parameter centered in the middle of the Touch Screen. The string will appear without any frame defined in FONT/frameX.wte (as seen in the Misc. Graphics tab of SkyTemple). This opcode does not need <code>message_Close</code> to suspend the routine. | ||
This opcode does not support displaying a portrait. No sound will emit from the text scrolling. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 2,087: | Line 2,135: | ||
|String | |String | ||
|txt | |txt | ||
| | |Text to be displayed on the Touch Screen. | ||
|} | |} | ||
=== 0x99 - message_FacePositionOffset === | === 0x99 - message_FacePositionOffset === | ||
Offsets the active portrait in pixels by multiples of 8. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 2,103: | Line 2,151: | ||
|sint | |sint | ||
|x | |x | ||
| | |The offset to shift the portrait box across the X-axis. | ||
|- | |- | ||
|2 | |2 | ||
|sint | |sint | ||
|y | |y | ||
| | |The offset to shift the portrait box across the Y-axis. | ||
|} | |} | ||
=== 0x9a - message_ImitationSound === | === 0x9a - message_ImitationSound === | ||
Displays the string defined in the ''txt'' parameter at the bottom of the Touch Screen. The string will appear surrounded by a player-chosen frame defined in FONT/frameX.wte (as seen in the Misc. Graphics tab of SkyTemple). | |||
This opcode does not support displaying a portrait. No sound will emit from the text scrolling. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 2,124: | Line 2,174: | ||
|String | |String | ||
|txt | |txt | ||
| | |Text to be displayed on the Touch Screen. | ||
|} | |} | ||
=== 0x9b - message_KeyWait === | === 0x9b - message_KeyWait === | ||
< | If an active textbox has finished displaying its string and was created by one of the following opcodes: | ||
* <code>message_ImitationSound</code> | |||
* <code>message_Mail</code> | |||
* <code>message_Monologue</code> | |||
* <code>message_Notice</code> | |||
* <code>message_SpecialTalk</code> | |||
* <code>message_Talk</code> | |||
This opcode suspends the current routine until the A Button, B Button or textbox is pressed (via the Touch Screen). Once done so, the textbox will not close, but the current routine will resume. | |||
No parameters. | No parameters. | ||
=== 0x9c - message_Mail === | === 0x9c - message_Mail === | ||
Displays the string defined in the ''txt'' parameter at the bottom of the Touch Screen. The string will appear surrounded by a player-chosen frame defined in FONT/frameX.wte (as seen in the Misc. Graphics tab of SkyTemple). | |||
This opcode does not support displaying a portrait. No sound will emit from the text scrolling. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 2,144: | Line 2,205: | ||
|String | |String | ||
|txt | |txt | ||
| | |Text to be displayed on the Touch Screen. | ||
|} | |} | ||
=== 0x9d - message_Menu === | === 0x9d - message_Menu === | ||
Executes various hardcoded "menu" functionalities given a certain ID. Some IDs result in an actual menu, while others simply perform a silent task. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 2,160: | Line 2,221: | ||
|Menu | |Menu | ||
|menu_id | |menu_id | ||
| | |The ID of a menu, the list of which can be seen by typing <code>MENU_</code> in SkyTemple's Script Engine Debugger. | ||
|} | |} | ||
=== 0x9e - message_Monologue === | === 0x9e - message_Monologue === | ||
Displays the string defined in the | Displays the string defined in the ''txt'' parameter at the bottom of the Touch Screen. The string will appear surrounded by a player-chosen frame defined in FONT/frameX.wte (as seen in the Misc. Graphics tab of SkyTemple). | ||
This opcode supports displaying a portrait. No sound will emit from the text scrolling. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 2,176: | Line 2,239: | ||
|String | |String | ||
|txt | |txt | ||
| | |Text to be displayed on the Touch Screen. | ||
|} | |} | ||
=== 0x9f - message_Narration === | === 0x9f - message_Narration === | ||
Fades in the screen and instantly displays the string defined in the ''txt'' parameter centered in the middle of the Touch Screen. The string will appear without any frame defined in FONT/frameX.wte (as seen in the Misc. Graphics tab of SkyTemple). This opcode does not need <code>message_Close</code> to suspend the routine. Once the routine is resumed (by pressing the A Button, B Button, or text via the Touch Screen), the screen will fade out, including the string. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 2,191: | Line 2,254: | ||
|1 | |1 | ||
|uint | |uint | ||
| | |duration | ||
| | |The number of frames to fade in/out the Touch Screen. | ||
|- | |- | ||
|2 | |2 | ||
|String | |String | ||
|txt | |txt | ||
| | |Text to be displayed on the Touch Screen. | ||
|} | |} | ||
=== 0xa0 - message_Notice === | === 0xa0 - message_Notice === | ||
Instantly displays the string defined in the ''txt'' parameter at the bottom of the Touch Screen. The string will appear surrounded by a player-chosen frame defined in FONT/frameX.wte (as seen in the Misc. Graphics tab of SkyTemple). | |||
This opcode does not support displaying a portrait. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 2,213: | Line 2,278: | ||
|String | |String | ||
|txt | |txt | ||
| | |Text to be displayed on the Touch Screen. | ||
|} | |} | ||
=== 0xa1 - message_EmptyActor === | === 0xa1 - message_EmptyActor === | ||
Disallows a portrait from appearing alongside a textbox, along with disallowing a name to appear in the textbox if <code>message_Talk</code> follows this opcode. | |||
No parameters. | No parameters. | ||
=== 0xa2 - message_ResetActor === | === 0xa2 - message_ResetActor === | ||
Disallows a portrait from appearing alongside a textbox, along with setting a speech bubble (the text tag [M:T1]) to the start of next script string if <code>message_Talk</code> follows this opcode. | |||
No parameters. | No parameters. | ||
=== 0xa3 - message_SetActor === | === 0xa3 - message_SetActor === | ||
Sets | Sets the specified actor's name to the start of the next script string if <code>message_Talk</code> follows this opcode. | ||
{| class="wikitable" | {| class="wikitable" | ||
| Line 2,237: | Line 2,302: | ||
|Entity | |Entity | ||
|actor_id | |actor_id | ||
| | |An entry in the Actor List. | ||
|} | |} | ||
=== 0xa4 - message_SetFace === | === 0xa4 - message_SetFace === | ||
Sets the specified actor's name to the start of the next script string if <code>message_Talk</code> follows this opcode. Will also display a portrait of the actor's species at a specified position if <code>message_Talk</code> or <code>message_Monologue</code> follow this opcode. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 2,253: | Line 2,318: | ||
|Entity | |Entity | ||
|actor_id | |actor_id | ||
| | |An entry in the Actor List. | ||
|- | |- | ||
|2 | |2 | ||
|Face | |Face | ||
|face_id | |face_id | ||
| | |The ID of a portrait, the list of which can be seen by typing FACE_ in SkyTemple's Script Engine Debugger. | ||
|- | |- | ||
|3 | |3 | ||
|FaceMode | |FaceMode | ||
|face_mode | |face_mode | ||
| | |The position of a portrait, the list of which can be seen by typing <code>FACE_POS_</code> in SkyTemple's Script Engine Debugger. | ||
|} | |} | ||
=== 0xa5 - message_SetFaceEmpty === | === 0xa5 - message_SetFaceEmpty === | ||
Displays a portrait of the actor's species at a specified position if <code>message_Talk</code> or <code>message_Monologue</code> follow this opcode. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 2,279: | Line 2,344: | ||
|Entity | |Entity | ||
|actor_id | |actor_id | ||
| | |An entry in the Actor List. | ||
|- | |- | ||
|2 | |2 | ||
|Face | |Face | ||
|face_id | |face_id | ||
| | |The ID of a portrait, the list of which can be seen by typing FACE_ in SkyTemple's Script Engine Debugger. | ||
|- | |- | ||
|3 | |3 | ||
|FaceMode | |FaceMode | ||
|face_mode | |face_mode | ||
| | |The position of a portrait, the list of which can be seen by typing <code>FACE_POS_</code> in SkyTemple's Script Engine Debugger. | ||
|} | |} | ||
=== 0xa6 - message_SetFaceOnly === | === 0xa6 - message_SetFaceOnly === | ||
Sets a speech bubble (the text tag [M:T1]) to the start of the next script string if <code>message_Talk</code> follows this opcode. Will also display a portrait of the actor's species at a specified position if <code>message_Talk</code> or <code>message_Monologue</code> follow this opcode. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 2,305: | Line 2,370: | ||
|Entity | |Entity | ||
|actor_id | |actor_id | ||
| | |An entry in the Actor List. | ||
|- | |- | ||
|2 | |2 | ||
|Face | |Face | ||
|face_id | |face_id | ||
| | |The ID of a portrait, the list of which can be seen by typing FACE_ in SkyTemple's Script Engine Debugger. | ||
|- | |- | ||
|3 | |3 | ||
|FaceMode | |FaceMode | ||
|face_mode | |face_mode | ||
| | |The position of a portrait, the list of which can be seen by typing <code>FACE_POS_</code> in SkyTemple's Script Engine Debugger. | ||
|} | |} | ||
=== 0xa7 - message_SetFacePosition === | === 0xa7 - message_SetFacePosition === | ||
Repositions an actor's portrait. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 2,331: | Line 2,396: | ||
|FaceMode | |FaceMode | ||
|face_mode | |face_mode | ||
| | |The position of a portrait, the list of which can be seen by typing <code>FACE_POS_</code> in SkyTemple's Script Engine Debugger. | ||
|} | |} | ||
=== 0xa8 - message_SetWaitMode === | === 0xa8 - message_SetWaitMode === | ||