List of Opcodes: Difference between revisions

0x123 - SlidePositionMark: Added description for SlidePositionMark
Tags: Mobile edit Mobile web edit
Happylappy (talk | contribs)
m World Map Mode documentation
 
(87 intermediate revisions by 8 users not shown)
Line 2: Line 2:


This article documents the different opcodes, their purpose and parameters. The purpose of unkX parameters is unknown.
This article documents the different opcodes, their purpose and parameters. The purpose of unkX parameters is unknown.
== What is an opcode? ==
An opcode is an instruction to the machine (it tells the machine to 'do' something). In modern programming, it would be most similar to a [https://en.wikipedia.org/wiki/Function_(computer_programming) function]. For a more technical description, see [https://en.wikipedia.org/wiki/Opcode here].
== Types of parameters ==
* uint: An unsigned integer (a number without decimals). It cannot be negative. It is possible that in the game's code, there are only signed integers and no unsigned integers, but not enough research has been done on the matter. For the most part, it shouldn't matter.
* sint: A signed integer (a number without decimals). It can be either positive or negative.
* bitfield: A bitfield is uint where each bits (0 or 1) are treated independantly. They are used to store multiple binary (boolean) values efficiently. Opcodes that use it usually come in the <code>Set</code> and <code>Reset</code> variant. The <code>Set</code> variant define to true the values which are 1 in the input bitfield (while leaving the others untouched), and <code>Reset</code> define to false the values which are 1 in the input bitfield (while also leaving the others untouched).
* String: Text (i.e dialogue). There should always be a quotation mark (") at the beginning and end.
* ConstString: Same as String.
* Routine: Any of the 701 coroutines from [[Unionall]]. Always begins with "CORO_"
* Entity: An actor, performer. (not an object!)
* Object: An object in a scene. (not an actor or perfomer!)
* Level: Any level from the [[Script Engine|Level List]]. Will always begin with "LEVEL_".
* Bgm: Any music in the game. Will always begin with "BGM_". (example: BGM_CRAGGY_COAST)
* PositionMark: A position. Will be written as "Position<'MarkName', x, y>". Once a position mark is written in a script, SkyTemple will show an option to place it visually in the scene.
* Face: A portrait expression. Will always begin with "FACE_". (examples: FACE_NORMAL, FACE_HAPPY, FACE_PAIN)
* FaceMode: A portrait position. Will always begin with "FACE_MODE_".
* Direction: A direction for an entity to move in or turn to. Will always begin with "DIR_". (examples: DIR_UP, DIR_RIGHT)
* ProcessSpecial: One of the games special processes. Can be referred to by its number, or name.
* Effect: A graphical effect.
* GameVar: Any of the game's [[List of Script Variables|Script Variables]]. Will always begin with "$".


== Relevant Opcodes ==
== Relevant Opcodes ==
Line 97: Line 119:
|-
|-
|1
|1
|sint
|sint16
|speed0
|speed0
|The speed to scroll either:
|The speed to scroll either:
Line 107: Line 129:
|-
|-
|2
|2
|sint
|sint16
|speed1
|speed1
|The speed to scroll either:
|The speed to scroll either:
Line 191: Line 213:
|1
|1
|uint
|uint
|duration
|effect
|The number of frames used to play a given effect.
|
* Transitions from Layer 2 to Layer 1.
* Fades in Layer 1 from total darkness.
* Transitions from Layer 2 to Layer 1.
* Fades in Layer 1 from total darkness.
* Transitions from Layer 1 to Layer 2.
* Fades out Layer 1 to total darkness.
* Merges Layer 1 onto Layer 2, but fades in Layer 1 from total darkness.
* Fades in Layer 1 from total darkness.
* Merges Layer onto Layer 2, but fades out Layer 1 to total darkness.
* Fades out Layer 1 to total darkness.
|-
|-
|2
|2
|uint
|uint
|effect
|duration
|
|The number of frames used to play a given effect.
# Transitions from Layer 2 to Layer 1.
 
# Fades in Layer 1 from total darkness.
# Transitions from Layer 2 to Layer 1.
# Fades in Layer 1 from total darkness.
# Transitions from Layer 1 to Layer 2.
# Fades out Layer 1 to total darkness.
# Merges Layer 1 onto Layer 2, but fades in Layer 1 from total darkness.
# Fades in Layer 1 from total darkness.
# Merges Layer onto Layer 2, but fades out Layer 1 to total darkness.
# Fades out Layer 1 to total darkness.
|}
|}
=== 0x8 - back_SetDungeonBanner ===
=== 0x8 - back_SetDungeonBanner ===
Line 359: Line 382:
|}
|}
=== 0xf - back_SetWeatherEffect ===
=== 0xf - back_SetWeatherEffect ===
Currently unknown. The only values this opcode accepts seems to be 1, 2, and 3. Its only known use is in V00P02/m01a04a.ssb, which is a test script used by the developers.
Currently unknown. The only values this opcode accepts seems to be 1, 2, and 3. Value 3 was previously used in S02P01A/m00a01a.ssb in Time/Darkness, for its iteration of the personality test. In Sky, its only use is in V00P02/m01a04a.ssb, which is a leftover test script used by the developers to test the visuals of the Time/Darkness iteration of the aura test.


{| class="wikitable"
{| class="wikitable"
Line 374: Line 397:
|Currently unknown.
|Currently unknown.
|}
|}
=== 0x10 - back_SetWeatherScrollOffset ===
=== 0x10 - back_SetWeatherScrollOffset ===
Currently unknown. This opcode is not used in the base game.
Currently unknown. This opcode is not used in the base game.
Line 429: Line 453:
|1
|1
|uint
|uint
|effect
|effect_id
|
|
# The default state of the Animation Palette.
# The default state of the Animation Palette.
Line 534: Line 558:
|1
|1
|uint
|uint
|duration
|effect
|The number of frames used to play a given effect.
|
* Transitions from Layer 2 to Layer 1.
* Fades in Layer 1 from total darkness.
* Transitions from Layer 2 to Layer 1.
* Fades in Layer 1 from total darkness.
* Transitions from Layer 1 to Layer 2.
* Fades out Layer 1 to total darkness.
* Merges Layer 1 onto Layer 2, but fades in Layer 1 from total darkness.
* Fades in Layer 1 from total darkness.
* Merges Layer onto Layer 2, but fades out Layer 1 to total darkness.
* Fades out Layer 1 to total darkness.
|-
|-
|2
|2
|uint
|uint
|effect
|duration
|
|The number of frames used to play a given effect.
# Transitions from Layer 2 to Layer 1.
 
# Fades in Layer 1 from total darkness.
 
# Transitions from Layer 2 to Layer 1.
 
# Fades in Layer 1 from total darkness.
# Transitions from Layer 1 to Layer 2.
# Fades out Layer 1 to total darkness.
# Merges Layer 1 onto Layer 2, but fades in Layer 1 from total darkness.
# Fades in Layer 1 from total darkness.
# Merges Layer onto Layer 2, but fades out Layer 1 to total darkness.
# Fades out Layer 1 to total darkness.
|}
|}
=== 0x17 - back2_SetGround ===
=== 0x17 - back2_SetGround ===
Line 883: Line 910:
|-
|-
|1
|1
|Coroutine
|Routine
|coro_id
|coro_id
|One of the 701 possible Unionall Coroutines.
|One of the 701 possible Unionall Coroutines.
Line 901: Line 928:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 920: Line 947:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 939: Line 966:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 978: Line 1,005:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 1,095: Line 1,122:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,114: Line 1,141:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,133: Line 1,160:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,172: Line 1,199:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 1,255: Line 1,282:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,272: Line 1,299:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,289: Line 1,316:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,328: Line 1,355:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 1,441: Line 1,468:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,458: Line 1,485:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,475: Line 1,502:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,514: Line 1,541:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 1,598: Line 1,625:
|-
|-
|1
|1
|Coroutine
|Routine
|coro_id
|coro_id
|One of the 701 possible Unionall Coroutines.
|One of the 701 possible Unionall Coroutines.
Line 1,735: Line 1,762:
|}
|}
=== 0x81 - Flash ===
=== 0x81 - Flash ===
Currently unknown; it does not seem to affect much. This opcode is not used in the base game.
Zeroes-out the return address used by the <code>Return</code> opcode. This opcode is not used in the base game.


No parameters.
No parameters.
Line 1,757: Line 1,784:
|GameVar
|GameVar
|var
|var
|One of the 115 possible script variables.
|One of the indexed variables. Non-indexed values causes the IndexError.
|}
|}
=== 0x84 - item_Set ===
=== 0x84 - item_Set ===
Line 1,763: Line 1,790:


Items in slot 0 may also be added to the player's bag and storage with hardcoded menus, such as <code>message_Menu(MENU_GIVE_ITEM);</code> and <code>message_Menu(MENU_GIVE_ITEM2);</code>, respectively. Additionally, the text tag <code>[s_item:X]</code> will display the item's name, where X is the item slot number.
Items in slot 0 may also be added to the player's bag and storage with hardcoded menus, such as <code>message_Menu(MENU_GIVE_ITEM);</code> and <code>message_Menu(MENU_GIVE_ITEM2);</code>, respectively. Additionally, the text tag <code>[s_item:X]</code> will display the item's name, where X is the item slot number.
Item slots 0-3 are safe to use, but item slots 4 and beyond will begin to overwrite other memory!


{| class="wikitable"
{| class="wikitable"
Line 1,780: Line 1,809:
|uint
|uint
|item_id
|item_id
|The ID of the item, where all are listed in the Items tab of SkyTemple.
|The ID of the item, where all are listed in the Items tab of SkyTemple.  
|-
|-
|3
|3
Line 1,807: Line 1,836:
|2
|2
|uint
|uint
|table
|table_ID
|Some unknown item tables related to Spinda's Cafe.
|Some item tables related to Spinda's Cafe.
|}
The table IDs themselves are as follows. Values above 15 are currently unknown and untested.
{| class="wikitable"
!#
!Description
!#
!Description
|-
|0
|Sky Gift Item Pool
|8
|Silver Ticket Win Pool
|-
|1
|Numel "Give" Item Pool
|9
|Silver Ticket Big Win Pool
|-
|2
|Numel "Recieve" Item Pool
|10
|Gold Ticket Loss Pool
|-
|3
|Happiny Lost Item Pool
|11
|Gold Ticket Win Pool
|-
|4
|Prize Ticket Loss Pool
|12
|Gold Ticket Big Win Pool
|-
|5
|Prize Ticket Win Pool
|13
|Prism Ticket Loss Pool
|-
|6
|Prize Ticket Big Win Pool
|14
|Prism Ticket Win Pool
|-
|7
|Silver Ticket Loss Pool
|15
|Prism Ticket Big Win Pool
|}
|}
=== 0x86 - item_SetVariable ===
=== 0x86 - item_SetVariable ===
Saves the value of a script variable to an item slot. Items in slot 0 may also be added to the player's bag and storage with hardcoded menus, such as <code>message_Menu(MENU_GIVE_ITEM);</code> and <code>message_Menu(MENU_GIVE_ITEM2);</code>, respectively. Additionally, the text tag <code>[s_item:X]</code> will display the item's name, where X is the item slot number.
Saves the value of a script variable to an item slot. Items in slot 0 may also be added to the player's bag and storage with hardcoded menus, such as <code>message_Menu(MENU_GIVE_ITEM);</code> and <code>message_Menu(MENU_GIVE_ITEM2);</code>, respectively. Additionally, the text tag <code>[s_item:X]</code> will display the item's name, where X is the item slot number.
Line 1,845: Line 1,922:
|-
|-
|1
|1
|Coroutine
|Routine
|coro_id
|coro_id
|One of the 701 possible Unionall Coroutines.
|One of the 701 possible Unionall Coroutines.
Line 1,908: Line 1,985:
|}
|}
=== 0x8d - main_EnterDungeon ===
=== 0x8d - main_EnterDungeon ===
Exits ground mode and begins dungeon mode at a specific dungeon.
Attempts to exit ground mode and begins dungeon mode at a specific dungeon.
 
If attempting to run this opcode before selecting any option from the Top Menu, the game will not enter any dungeon and instead attempt to load a DEMO Unionall coroutine or the Top Menu.


{| class="wikitable"
{| class="wikitable"
Line 2,473: Line 2,552:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,502: Line 2,581:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,511: Line 2,590:
|}
|}
=== 0xb1 - Move2PositionMark ===
=== 0xb1 - Move2PositionMark ===
Moves an entity (i.e., an actor, object, or performer) to a Position Mark without restricting the angles used.
Moves an entity (i.e., an actor, object, or performer) to one or more Position Marks without restricting the angles used.


This opcode does not have a parameter for an entity, as it must be used in a with-statement or a targeted routine.
This opcode does not have a parameter for an entity, as it must be used in a with-statement or a targeted routine.
Line 2,534: Line 2,613:
This parameter may be repeated multiple times.
This parameter may be repeated multiple times.
|}
|}
=== 0xb2 - Move2PositionMark ===
=== 0xb2 - Move2PositionMark ===
Moves an entity (i.e., an actor, object, or performer) to a Position Mark without restricting the angles used.
Moves an entity (i.e., an actor, object, or performer) to a Position Mark without restricting the angles used.
Line 2,550: Line 2,630:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,598: Line 2,678:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,627: Line 2,707:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,656: Line 2,736:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,685: Line 2,765:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,733: Line 2,813:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,781: Line 2,861:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,810: Line 2,890:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,839: Line 2,919:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
|-
|-
|2
|2
Line 2,867: Line 2,947:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
|-
|-
|2
|2
Line 2,890: Line 2,970:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,919: Line 2,999:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,943: Line 3,023:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,996: Line 3,076:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 3,020: Line 3,100:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 3,073: Line 3,153:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 3,141: Line 3,221:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.


Line 3,307: Line 3,387:
|-
|-
|1
|1
|uint
|bitfield
|function_bitfield
|function_bitfield
|Most bits' purposes are unknown. Bit 1 appears to be the bit used for allowing an entity to follow a Type 1 actor, like the actor ACTOR_ATTENDANT1 in the overworld.
|Most bits' purposes are unknown. Bit 1 appears to be the bit used for allowing an entity to follow a Type 1 actor, like the actor ACTOR_ATTENDANT1 in the overworld.
Line 3,323: Line 3,403:
|-
|-
|1
|1
|uint
|bitfield
|hit_bitfield
|hit_bitfield
|Most bits' purposes are unknown.
|Most bits' purposes are unknown.
Line 3,343: Line 3,423:
|-
|-
|1
|1
|uint
|bitfield
|output_bitfield
|output_bitfield
|
|
Line 3,367: Line 3,447:
|-
|-
|1
|1
|uint
|bitfield
|reply_bitfield
|reply_bitfield
|Most bits' purposes are unknown.
|Most bits' purposes are unknown.
Line 3,433: Line 3,513:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and 1 is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and 1 is true.
Line 3,472: Line 3,552:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
Line 3,515: Line 3,595:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
Line 3,536: Line 3,616:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
Line 3,561: Line 3,641:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
Line 3,582: Line 3,662:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
Line 3,653: Line 3,733:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
Line 3,705: Line 3,785:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
Line 3,761: Line 3,841:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and 1 is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and 1 is true.
Line 3,800: Line 3,880:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
Line 3,885: Line 3,965:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
Line 3,906: Line 3,986:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
Line 3,927: Line 4,007:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and 1 is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and 1 is true.
Line 3,997: Line 4,077:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
Line 4,039: Line 4,119:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
Line 4,132: Line 4,212:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
Line 4,184: Line 4,264:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
Line 4,236: Line 4,316:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
Line 4,348: Line 4,428:
|-
|-
|1
|1
|bool
|uint
|suspension_flag
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
Line 4,664: Line 4,744:
|}
|}
=== 0x102 - SetEffect ===
=== 0x102 - SetEffect ===
<TO DO: Opcode description>
Plays back an [[List of Effect Animations|effect animation]] assigned to an actor or performer.


{| class="wikitable"
{| class="wikitable"
Line 4,677: Line 4,757:
|Effect
|Effect
|effect_id
|effect_id
|
|The ID of a given effect.
|-
|-
|2
|2
|uint
|uint
|position_marker_id?
|position_marker_id?
|
|Set to one of the following character sprite offsets:
0: Head<br>1: Right Hand<br>2: Left Hand<br>3: Center<br>4: No offset (bottom of sprite)
|}
|}
=== 0x103 - SetFunctionAttribute ===
=== 0x103 - SetFunctionAttribute ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Line 4,696: Line 4,778:
|-
|-
|1
|1
|uint
|bitfield
|unk0
|unk0
|
|
|}
|}
=== 0x104 - SetHeight ===
=== 0x104 - SetHeight ===
<TO DO: Opcode description>
Moves an actor "vertically" by distancing it from its shadow.


{| class="wikitable"
{| class="wikitable"
Line 4,714: Line 4,796:
|uint
|uint
|unk0
|unk0
|
|number of pixels to move up or down by.
|}
|}
=== 0x105 - SetHitAttribute ===
=== 0x105 - SetHitAttribute ===
Line 4,728: Line 4,810:
|-
|-
|1
|1
|uint
|bitfield
|unk0
|unk0
|
|
Line 4,759: Line 4,841:
|}
|}
=== 0x107 - SetOutputAttribute ===
=== 0x107 - SetOutputAttribute ===
<TO DO: Opcode description>
Sets certain bits of an entity's (i.e., an actor, object, or performer) "output" attribute to 1.
 
{| class="wikitable"
{| class="wikitable"
|+Parameters
|+Parameters
Line 4,770: Line 4,851:
|-
|-
|1
|1
|uint
|bitfield
|unk0
|output_bitfield
|
|
# Underlay below entities.
# Overlay above entities.
# Overlay above the current Map Background's Layer 2.
# Overlay above the game's canvas system, which includes the textbox, portrait, and some <code>screen_</code> commands that do not end in <code>All</code>.
# Flicker.
# Transparency.
# Invisibility.
# Displays shadow.
|}
|}
=== 0x108 - SetPosition ===
=== 0x108 - SetPosition ===
Line 4,885: Line 4,974:
|-
|-
|1
|1
|uint
|bitfield
|unk0
|unk0
|
|
Line 4,916: Line 5,005:
|}
|}
=== 0x110 - Slide2Position ===
=== 0x110 - Slide2Position ===
<TO DO: Opcode description>
Moves an entity (i.e., an actor, object, or performer) to a specific pixel position without animation. Must be used in a with-statement or a targeted routine.


{| class="wikitable"
{| class="wikitable"
Line 4,928: Line 5,017:
|1
|1
|uint
|uint
|unk0
|speed
|
|Movement speed. Higher values result in a faster speed. Values starting at 32770 and above will be slower than a value of 1.
|-
|-
|2
|2
|uint
|uint
|x
|x
|
|The pixel position on the X-axis.
|-
|-
|3
|3
|uint
|uint
|y
|y
|
|The pixel position on the Y-axis.
|}
|}
=== 0x111 - Slide2PositionLives ===
=== 0x111 - Slide2PositionLives ===
<TO DO: Opcode description>
Moves an entity (i.e., an actor, object, or performer) to an actor without animation. Must be used in a with-statement or a targeted routine.


{| class="wikitable"
{| class="wikitable"
Line 4,954: Line 5,044:
|1
|1
|uint
|uint
|unk0
|speed
|
|Movement speed. Higher values result in a faster speed. Values starting at 32770 and above will be slower than a value of 1.
|-
|-
|2
|2
|uint
|uint
|unk1
|actor_id
|
|The ID of the actor to move the entity to.
|}
|}
=== 0x112 - Slide2PositionMark ===
=== 0x112 - Slide2PositionMark ===
<TO DO: Opcode description>
Moves an entity (i.e., an actor, object, or performer) to one or more Position Marks without animation, and without restricting the angles used.
 
This opcode does not have a parameter for an entity, as it must be used in a with-statement or a targeted routine.


{| class="wikitable"
{| class="wikitable"
Line 4,976: Line 5,069:
|uint
|uint
|num_parameters
|num_parameters
|
|The number of parameters to read from this opcode.
|-
|-
|2+
|2+
|PositionMark
|PositionMark
|pos_marker
|pos_marker
|This parameter may be repeated multiple times
|A structure consisting of a name, X unit, and Y unit. Units are defined as 8 pixels.
This parameter may be repeated multiple times.
|}
|}
=== 0x113 - Slide2PositionMark ===
=== 0x113 - Slide2PositionMark ===
<TO DO: Opcode description>
Moves an entity (i.e., an actor, object, or performer) to a Position Mark without animation, and without restricting the angles used.
 
This opcode does not have a parameter for an entity, as it must be used in a with-statement or a targeted routine.


{| class="wikitable"
{| class="wikitable"
Line 4,996: Line 5,093:
|1
|1
|uint
|uint
|unk0
|speed
|
|Movement speed. Higher values result in a faster speed.  Values starting at 32770 and above will be slower than a value of 1.
|-
|-
|2
|2
|PositionMark
|PositionMark
|pos_mark
|pos_mark
|
|A structure consisting of a name, X unit, and Y unit. Units are defined as 8 pixels.
|}
|}
=== 0x114 - Slide2PositionOffset ===
=== 0x114 - Slide2PositionOffset ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Line 5,042: Line 5,140:
|1
|1
|uint
|uint
|unk0
|speed
|
|
|-
|-
Line 5,068: Line 5,166:
|1
|1
|uint
|uint
|unk0
|speed
|
|
|-
|-
Line 5,094: Line 5,192:
|1
|1
|uint
|uint
|unk0
|speed
|
|
|-
|-
Line 5,120: Line 5,218:
|1
|1
|uint
|uint
|unk0
|speed
|
|
|-
|-
|2
|2
|uint
|uint
|unk1
|actor_id
|
|
|}
|}
Line 5,162: Line 5,260:
|1
|1
|uint
|uint
|unk0
|speed
|
|
|-
|-
Line 5,183: Line 5,281:
|1
|1
|uint
|uint
|unk0
|num_parameters
|
|
|-
|-
Line 5,208: Line 5,306:
|1
|1
|uint
|uint
|unk0
|speed
|
|
|-
|-
Line 5,234: Line 5,332:
|1
|1
|uint
|uint
|unk0
|speed
|
|
|-
|-
Line 5,382: Line 5,480:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 5,451: Line 5,549:
|1
|1
|uint
|uint
|unk0
|speed
|
|
|-
|-
Line 5,489: Line 5,587:
No parameters.
No parameters.
=== 0x12a - supervision_Acting ===
=== 0x12a - supervision_Acting ===
<TO DO: Opcode description>
Loads a sector of the Acting scene.


{| class="wikitable"
{| class="wikitable"
Line 5,502: Line 5,600:
|uint
|uint
|layer_id
|layer_id
|
|The ID of the sector to load.
|}
|}
=== 0x12b - supervision_ActingInvisible ===
=== 0x12b - supervision_ActingInvisible ===
<TO DO: Opcode description>
Loads a sector of the Acting scene. Actors and objects in this sector will be invisible.


{| class="wikitable"
{| class="wikitable"
Line 5,518: Line 5,617:
|uint
|uint
|layer_id
|layer_id
|
|The ID of the sector to load.
|}
|}
=== 0x12c - supervision_ExecuteActing ===
=== 0x12c - supervision_ExecuteActing ===
<TO DO: Opcode description>
Loads a specified Acting script from the specified level from within Enter/Acting/Sub scripts.


{| class="wikitable"
{| class="wikitable"
Line 5,534: Line 5,634:
|Level
|Level
|level
|level
|
|Map LEVEL the script should be located in.
|-
|-
|2
|2
|ConstString
|ConstString
|script_id
|script_id
|
|Name of the script itself, only the first 8 characters are read.
|-
|-
|3
|3
|uint
|uint
|unk2
|script_sector
|
|The "sector" of the script, and the value <code>switch(sector())</code> will return in def 0. Often used to determine whether a cutscene should be played as a flashback or not.
|}
|}
 
=== 0x12d - supervision_ExecuteActingSub ===
=== 0x12d - supervision_ExecuteActingSub ===
<TO DO: Opcode description>
Loads a specified Acting script from the specified level from within Unionall.


{| class="wikitable"
{| class="wikitable"
Line 5,560: Line 5,661:
|Level
|Level
|level
|level
|
|Map LEVEL the script should be located in.
|-
|-
|2
|2
|ConstString
|ConstString
|script_id
|script_id
|
|Name of the script itself, only the first 8 characters are read.
|-
|-
|3
|3
|uint
|uint
|unk2
|script_sector
|
|The "sector" of the script, and the value <code>switch(sector())</code> will return in def 0. Often used to determine whether a cutscene should be played as a flashback or not.
|}
|}
=== 0x12e - supervision_ExecuteCommon ===
=== 0x12e - supervision_ExecuteCommon ===
<TO DO: Opcode description>
Loads a specified Unionall coroutine from within Enter/Acting/Sub scripts.


{| class="wikitable"
{| class="wikitable"
Line 5,588: Line 5,690:
|
|
|}
|}
=== 0x12f - supervision_ExecuteEnter ===
=== 0x12f - supervision_ExecuteEnter ===
<TO DO: Opcode description>
Loads an Enter script from the specified level.


{| class="wikitable"
{| class="wikitable"
Line 5,601: Line 5,704:
|1
|1
|uint
|uint
|unk0
|level_id
|
|An entry in the Level list.
|}
|}
=== 0x130 - supervision_ExecuteStation ===
=== 0x130 - supervision_ExecuteStation ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Line 5,699: Line 5,803:
|}
|}
=== 0x134 - supervision_ExecuteExport ===
=== 0x134 - supervision_ExecuteExport ===
<TO DO: Opcode description>
Loads a specified Acting scene of the level S00P01A


{| class="wikitable"
{| class="wikitable"
Line 5,711: Line 5,815:
|1
|1
|ConstString
|ConstString
|const
|script_id
|
|
|}
|}
=== 0x135 - supervision_ExecuteExportSub ===
=== 0x135 - supervision_ExecuteExportSub ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Line 5,752: Line 5,857:
|}
|}
=== 0x137 - supervision_Remove ===
=== 0x137 - supervision_Remove ===
<TO DO: Opcode description>
Unloads a sector of the Sub scene.


{| class="wikitable"
{| class="wikitable"
Line 5,764: Line 5,869:
|1
|1
|uint
|uint
|unk0
|layer_id
|
|The ID of the sector to unload.
|}
|}
=== 0x138 - supervision_RemoveActing ===
=== 0x138 - supervision_RemoveActing ===
<TO DO: Opcode description>
Unloads a sector of the Acting scene.


{| class="wikitable"
{| class="wikitable"
Line 5,781: Line 5,887:
|uint
|uint
|layer_id
|layer_id
|
|The ID of the sector to unload.
|}
|}
=== 0x139 - supervision_RemoveCommon ===
=== 0x139 - supervision_RemoveCommon ===
<TO DO: Opcode description>
Unloads a sector of the Enter scene.


{| class="wikitable"
{| class="wikitable"
Line 5,796: Line 5,903:
|1
|1
|uint
|uint
|unk0
|layer_id
|
|The ID of the sector to unload.
|}
|}
=== 0x13a - supervision_SpecialActing ===
=== 0x13a - supervision_SpecialActing ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Line 5,826: Line 5,934:
|}
|}
=== 0x13b - supervision_Station ===
=== 0x13b - supervision_Station ===
<TO DO: Opcode description>
Loads a sector of the Sub scene.


{| class="wikitable"
{| class="wikitable"
Line 5,839: Line 5,947:
|uint
|uint
|station_id
|station_id
|
|The ID of the sector to load.
|}
|}
=== 0x13c - supervision_StationCommon ===
=== 0x13c - supervision_StationCommon ===
<TO DO: Opcode description>
Loads a sector of the Enter scene.
 
Can be used to call sectors of an enter scene within acting scenes!


{| class="wikitable"
{| class="wikitable"
Line 5,855: Line 5,966:
|uint
|uint
|station_id
|station_id
|
|The ID of the sector to load.
|}
|}
=== 0x13d - supervision_Suspend ===
=== 0x13d - supervision_Suspend ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Line 5,900: Line 6,012:
|}
|}
=== 0x14c - Turn2Direction ===
=== 0x14c - Turn2Direction ===
<TO DO: Opcode description>
Makes an actor rotate to a specified direction.
 
This opcode does not have a parameter for an entity, as it must be used in a with-statement or a targeted routine.


{| class="wikitable"
{| class="wikitable"
Line 5,912: Line 6,026:
|1
|1
|uint
|uint
|unk0
|speed
|
|How fast the actor turns. The higher the number, the slower the turn.
|-
|-
|2
|2
|uint
|uint
|unk1
|rotationdirection
|
|The way that the actor will turn to face the specified direction. 1 = clockwise, 2 = counterclockwise, 10 = the most efficient direction to turn.
|-
|-
|3
|3
|Direction
|Direction
|direction
|direction
|
|The direction that the actor will turn to face.
|}
|}
=== 0x14d - Turn2DirectionLives ===
=== 0x14d - Turn2DirectionLives ===
<TO DO: Opcode description>
Makes an actor rotate to face another actor. Must be used in a with-statement or a targeted routine.


{| class="wikitable"
{| class="wikitable"
Line 5,938: Line 6,053:
|1
|1
|uint
|uint
|unk0
|speed
|
|How fast the actor turns. The higher the number, the slower the turn.
|-
|-
|2
|2
|uint
|uint
|unk1
|rotationdirection
|
|The way that the actor will turn to face the specified direction. 1 = clockwise, 2 = counterclockwise, 10 = the most efficient direction to turn.
|-
|-
|3
|3
|Entity
|Entity
|actor_id
|actor_id
|
|The target actor that the actor will turn to face.
|}
|}
=== 0x14e - Turn2DirectionLives2 ===
=== 0x14e - Turn2DirectionLives2 ===
<TO DO: Opcode description>
Makes an actor rotate to face another actor. Must be used in a with-statement or a targeted routine.


{| class="wikitable"
{| class="wikitable"
Line 5,964: Line 6,080:
|1
|1
|uint
|uint
|unk0
|speed
|
|How fast the actor turns. The higher the number, the slower the turn.
|-
|-
|2
|2
|uint
|uint
|unk1
|rotationdirection
|
|The way that the actor will turn to face the specified direction. 1 = clockwise, 2 = counterclockwise, 10 = the most efficient direction to turn.
|-
|-
|3
|3
|uint
|uint
|unk2
|actor_id
|
|ID of the target actor from Level List that the actor will turn to face.
|}
|}
=== 0x14f - Turn2DirectionMark ===
=== 0x14f - Turn2DirectionMark ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Line 6,014: Line 6,131:
|}
|}
=== 0x150 - Turn2DirectionTurn ===
=== 0x150 - Turn2DirectionTurn ===
<TO DO: Opcode description>
Makes an actor turn at a certain angle.
 
This opcode does not have a parameter for an entity, as it must be used in a with-statement or a targeted routine.


{| class="wikitable"
{| class="wikitable"
Line 6,026: Line 6,145:
|1
|1
|uint
|uint
|unk0
|speed
|
|How fast the actor turns. The higher the number, the slower the turn.
|-
|-
|2
|2
|uint
|uint
|unk1
|rotationdirection
|
|The way that the actor will turn to face the specified direction. 1 = clockwise, 2 = counterclockwise, 10 = the most efficient direction to turn.
|-
|-
|3
|3
|uint
|uint
|unk2
|angle
|
|1: 45 degrees left, 2: 45 degrees right, 3: 90 degrees right, 4: 90 degrees left, 5: 180 degrees
|}
|}
=== 0x151 - Turn3 ===
=== 0x151 - Turn3 ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Line 6,166: Line 6,286:
|}
|}
=== 0x157 - Wait ===
=== 0x157 - Wait ===
<TO DO: Opcode description>
Pauses the routine for a set number of frames. After the number of frames, the routine will resume.


{| class="wikitable"
{| class="wikitable"
Line 6,179: Line 6,299:
|uint
|uint
|duration
|duration
|
|The number of frames that the routine will wait for before resuming.
|}
|}
=== 0x158 - WaitAnimation ===
=== 0x158 - WaitAnimation ===
<TO DO: Opcode description>
Pauses the routine until the specified actor has finished its animation. After the actor finishes its animation, the routine will resume.
 
This opcode does not have a parameter for an entity, as it must be used in a with-statement or a targeted routine.


No parameters.
=== 0x159 - WaitBackEffect ===
=== 0x159 - WaitBackEffect ===
<TO DO: Opcode description>
Pauses the current routine until [[List of Opcodes#0x2 - back SetBackEffect|back_SetBackEffect]] is called.


No parameters.
No parameters.
=== 0x15a - WaitBack2Effect ===
=== 0x15a - WaitBack2Effect ===
<TO DO: Opcode description>
Pauses the current routine until [[List of Opcodes#0x12 - back2 SetBackEffect|back2_SetBackEffect]] is called.


No parameters.
No parameters.
=== 0x15b - WaitBgm ===
=== 0x15b - WaitBgm ===
<TO DO: Opcode description>
Pauses the current routine until the specified BGM on the first BGM track has ended. After the BGM ends, the routine will resume.


{| class="wikitable"
{| class="wikitable"
Line 6,207: Line 6,330:
|Bgm
|Bgm
|bgm_id
|bgm_id
|
|A non-looped music track defined in SOUND/BGM of the ROM. Looped music tracks softlocks the game.
|}
|}
=== 0x15c - WaitBgm2 ===
=== 0x15c - WaitBgm2 ===
<TO DO: Opcode description>
Pauses the current routine until the specified BGM on the second BGM track has ended. After the BGM ends, the routine will resume.


{| class="wikitable"
{| class="wikitable"
Line 6,223: Line 6,347:
|Bgm
|Bgm
|bgm_id
|bgm_id
|
|A non-looped music track defined in SOUND/BGM of the ROM. Looped music tracks softlocks the game.
|}
|}
=== 0x15d - WaitBgmSignal ===
=== 0x15d - WaitBgmSignal ===
<TO DO: Opcode description>
Pauses the routine until a DSE event with ID 0xF6 on the current BGM track is triggered. This can be used to sync certain parts of the scene to the background music.


No parameters.
No parameters.
=== 0x15e - WaitEffect ===
=== 0x15e - WaitEffect ===
<TO DO: Opcode description>
Pauses the routine until the effect on the specified actor/peformer has ended. After the effect ends, the routine will resume.
 
This opcode does not have a parameter for an entity, as it must be used in a with-statement or a targeted routine.


No parameters.
=== 0x15f - WaitEndAnimation ===
=== 0x15f - WaitEndAnimation ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Line 6,238: Line 6,364:
No parameters.
No parameters.
=== 0x160 - WaitExecuteLives ===
=== 0x160 - WaitExecuteLives ===
<TO DO: Opcode description>
Pauses the routine until the specified actor has finished its action (Move2Position, Slide2Position, etc.). After the actor finishes its action, the routine will resume.


{| class="wikitable"
{| class="wikitable"
Line 6,251: Line 6,377:
|Entity
|Entity
|actor_id
|actor_id
|
|The actor that the routine will wait for.
|}
|}
=== 0x161 - WaitExecuteObject ===
=== 0x161 - WaitExecuteObject ===
<TO DO: Opcode description>
Pauses the current routine until the specified object has finished its action (Move2Position, Slide2Position, etc.). After the object finishes its action, the routine will resume.


{| class="wikitable"
{| class="wikitable"
Line 6,267: Line 6,394:
|Object
|Object
|object_id
|object_id
|
|The ID of the object that the routine will wait for.
|}
|}
=== 0x162 - WaitExecutePerformer ===
=== 0x162 - WaitExecutePerformer ===
<TO DO: Opcode description>
Pauses the current routine until the specified performer has finished its current action (Move2Position, Slide2Position, etc.) After the performer has finished its action, the routine will resume.


{| class="wikitable"
{| class="wikitable"
Line 6,283: Line 6,411:
|uint
|uint
|performer_id
|performer_id
|
|The ID of the performer that the routine will wait for.
|}
|}
=== 0x163 - WaitFadeIn ===
=== 0x163 - WaitFadeIn ===
<TO DO: Opcode description>
Pauses the current routine and waits for the screen to fade in. After the screen fades in, the routine will resume.


No parameters.
No parameters.
=== 0x164 - WaitLockLives ===
=== 0x164 - WaitLockLives ===
<TO DO: Opcode description>
Pauses the current routine until a [[List of Opcodes#0x8b - Lock|Lock]] opcode with the specified ''lock_id'' is reached in the specified actor's targeted routine. After the lock is reached, the routine will resume.


{| class="wikitable"
{| class="wikitable"
Line 6,310: Line 6,440:
|
|
|}
|}
=== 0x165 - WaitLockObject ===
=== 0x165 - WaitLockObject ===
<TO DO: Opcode description>
Pauses the current routine until a [[List of Opcodes#0x8b - Lock|Lock]] opcode with the specified ''lock_id'' is reached in the specified object's targeted routine. After the lock is reached, the routine will resume.


{| class="wikitable"
{| class="wikitable"
Line 6,331: Line 6,462:
|
|
|}
|}
=== 0x166 - WaitLockPerformer ===
=== 0x166 - WaitLockPerformer ===
<TO DO: Opcode description>
Pauses the current routine until a [[List of Opcodes#0x8b - Lock|Lock]] opcode with the specified ''lock_id'' is reached in the specified performer's targeted routine. After the lock is reached, the routine will resume.


{| class="wikitable"
{| class="wikitable"
Line 6,352: Line 6,484:
|
|
|}
|}
=== 0x167 - WaitLockSupervision ===
=== 0x167 - WaitLockSupervision ===
<TO DO: Opcode description>
Pauses the current routine until a [[List of Opcodes#0x8b - Lock|Lock]] opcode with the specified ''lock_id'' is reached in <code>def 0</code>. After the lock is reached, the routine will resume.


{| class="wikitable"
{| class="wikitable"
Line 6,365: Line 6,498:
|1
|1
|uint
|uint
|unk0
|lock_id
|
|
|}
|}
=== 0x168 - WaitMe ===
=== 0x168 - WaitMe ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Line 6,393: Line 6,527:
No parameters.
No parameters.
=== 0x16b - WaitRandom ===
=== 0x16b - WaitRandom ===
<TO DO: Opcode description>
Pauses the routine for a random number of frames. After the number of frames, the routine will resume.


{| class="wikitable"
{| class="wikitable"
Line 6,405: Line 6,539:
|1
|1
|uint
|uint
|unk0
|duration_min
|
|Minimum number of frames that the routine will wait for before resuming.
|-
|-
|2
|2
|uint
|uint
|unk1
|duration_max
|
|Maximum number of frames that the routine will wait for before resuming.
|}
|}
=== 0x16c - WaitScreenFade ===
=== 0x16c - WaitScreenFade ===
<TO DO: Opcode description>
Waits until screen_FadeIn finishes executing.


No parameters.
No parameters.
=== 0x16d - WaitScreenFadeAll ===
=== 0x16d - WaitScreenFadeAll ===
<TO DO: Opcode description>
Waits until screen_FadeInAll finishes executing.


No parameters.
No parameters.
=== 0x16e - WaitScreen2Fade ===
=== 0x16e - WaitScreen2Fade ===
<TO DO: Opcode description>
Waits until screen2_FadeIn finishes executing.


No parameters.
No parameters.
=== 0x16f - WaitSe ===
=== 0x16f - WaitSe ===
<TO DO: Opcode description>
Pauses the current routine until the specified sound effect has ended. After the sound effect ends, the routine will resume.


{| class="wikitable"
{| class="wikitable"
Line 6,439: Line 6,574:
|uint
|uint
|se_id
|se_id
|
|The ID of the sound to wait for the end of before resuming the routine.
|}
|}
=== 0x170 - WaitSpecialActing ===
=== 0x170 - WaitSpecialActing ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Line 6,454: Line 6,590:
No parameters.
No parameters.
=== 0x173 - worldmap_BlinkMark ===
=== 0x173 - worldmap_BlinkMark ===
<TO DO: Opcode description>
Shows a blinking world map marker.


{| class="wikitable"
{| class="wikitable"
Line 6,466: Line 6,602:
|1
|1
|uint
|uint
|unk0
|world_map_marker_id
|
|
|}
|}
=== 0x174 - worldmap_ChangeLevel ===
=== 0x174 - worldmap_ChangeLevel ===
<TO DO: Opcode description>
Causes the clouds parting animation on the world map, presumably hardcoded by vanilla use-case.


{| class="wikitable"
{| class="wikitable"
Line 6,482: Line 6,619:
|1
|1
|uint
|uint
|unk0
|world_map_level
|
|Level to transition the world map state to.
|}
|}
=== 0x175 - worldmap_DeleteArrow ===
=== 0x175 - worldmap_DeleteArrow ===
<TO DO: Opcode description>
Remove the yellow arrow from the world map.


No parameters.
No parameters.
=== 0x176 - worldmap_MoveCamera ===
=== 0x176 - worldmap_MoveCamera ===
<TO DO: Opcode description>
Moves the camera to the specified world map marker.


{| class="wikitable"
{| class="wikitable"
Line 6,502: Line 6,640:
|1
|1
|uint
|uint
|unk0
|world_map_marker_id
|
|The world map id to move the camera to.
|}
|}
=== 0x177 - worldmap_OffMessage ===
=== 0x177 - worldmap_OffMessage ===
<TO DO: Opcode description>
Removes a textbox with the world map marker's name from the Top Screen


No parameters.
No parameters.
=== 0x178 - worldmap_SetArrow ===
=== 0x178 - worldmap_SetArrow ===
<TO DO: Opcode description>
Shows an arrow pointing to a specified world map marker


{| class="wikitable"
{| class="wikitable"
Line 6,522: Line 6,662:
|1
|1
|uint
|uint
|unk0
|world_map_marker_id
|
|
|}
|}
=== 0x179 - worldmap_SetCamera ===
=== 0x179 - worldmap_SetCamera ===
<TO DO: Opcode description>
Centers the world map camera on a specific world map marker.


{| class="wikitable"
{| class="wikitable"
Line 6,538: Line 6,679:
|1
|1
|uint
|uint
|unk0
|world_map_marker_id
|
|The world map id to set the camera to.
|}
|}
=== 0x17a - worldmap_SetLevel ===
=== 0x17a - worldmap_SetLevel ===
<TO DO: Opcode description>
Sets the current world map state. Additionally updates $WORLD_MAP_LEVEL


{| class="wikitable"
{| class="wikitable"
Line 6,554: Line 6,695:
|1
|1
|uint
|uint
|unk0
|world_map_level
|
|Level to assign the world map state to.
|}
|}
=== 0x17b - worldmap_SetMark ===
=== 0x17b - worldmap_SetMark ===
<TO DO: Opcode description>
Enables a yellow dot for the specified world map marker.


{| class="wikitable"
{| class="wikitable"
Line 6,570: Line 6,711:
|1
|1
|uint
|uint
|unk0
|world_map_marker_id
|
|The world map id to enable the yellow dot for.
|}
|}
=== 0x17c - worldmap_SetMessage ===
=== 0x17c - worldmap_SetMessage ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Seemingly unused in vanilla.


{| class="wikitable"
{| class="wikitable"
Line 6,590: Line 6,733:
|}
|}
=== 0x17d - worldmap_SetMessagePlace ===
=== 0x17d - worldmap_SetMessagePlace ===
<TO DO: Opcode description>
Shows a textbox on the Top Screen with the specified world map marker's name.


{| class="wikitable"
{| class="wikitable"
Line 6,602: Line 6,745:
|1
|1
|uint
|uint
|unk0
|world_map_marker_id
|
|
|}
|}
=== 0x17e - worldmap_SetMode ===
=== 0x17e - worldmap_SetMode ===
<TO DO: Opcode description>
Sets the "mode" of the world map, to align with a particular purpose.
 
Mode 1 seems to be for handling travel to a dungeon or area.
 
Mode 2 is only used by debug scripts.
 
Mode 3 is for handling moving clouds.
 
Mode 4 is for cutscene use, or for showing where things are on a map.
 
All other modes are unused.


{| class="wikitable"
{| class="wikitable"
Line 6,618: Line 6,772:
|1
|1
|uint
|uint
|unk0
|world_map_mode
|
|
|}
|}
Line 6,647: Line 6,801:
|-
|-
|3
|3
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,673: Line 6,827:
|-
|-
|3
|3
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,689: Line 6,843:
|-
|-
|1
|1
|bool
|uint
|param
|param
|
|
|-
|-
|2
|2
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,715: Line 6,869:
|-
|-
|2
|2
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,736: Line 6,890:
|-
|-
|2
|2
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,757: Line 6,911:
|-
|-
|2
|2
|bool
|uint
|value
|value
|
|
|-
|-
|3
|3
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,793: Line 6,947:
|-
|-
|4
|4
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,824: Line 6,978:
|-
|-
|4
|4
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,855: Line 7,009:
|-
|-
|4
|4
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,886: Line 7,040:
|-
|-
|4
|4
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,917: Line 7,071:
|-
|-
|4
|4
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,948: Line 7,102:
|-
|-
|4
|4
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,969: Line 7,123:
|-
|-
|2
|2
|Operator
|uint
|operator
|operator
|
|
Line 6,979: Line 7,133:
|-
|-
|4
|4
|Addr
|uint
|jump_address
|jump_address
|
|
Line 7,000: Line 7,154:
|-
|-
|2
|2
|Operator
|uint
|operator
|operator
|
|
Line 7,010: Line 7,164:
|-
|-
|4
|4
|Addr
|uint
|jump_address
|jump_address
|
|
|}
|}
=== 0x36 - BranchVariation ===
=== 0x36 - BranchVariation ===
<TO DO: Opcode description>
Used for demo cutscenes.
 
Jumps to the specified address if the first parameter is 0. On the demo version of the game, jumps if the first parameter is 3.


{| class="wikitable"
{| class="wikitable"
Line 7,028: Line 7,184:
|uint
|uint
|param
|param
|
|Unknown. Always 3.
|-
|-
|2
|2
|Addr
|uint
|jump_address
|jump_address
|
|Address to jump to.
|}
|}
=== 0x37 - Call ===
=== 0x37 - Call ===
Jumps to the specified address, runs code, and returns to the line of code in which this opcode was used (only if <code>return;</code> was used in the routine this opcode calls).
Jumps to the specified address, runs code, and returns to the line of code in which this opcode was used (only if <code>return;</code> was used in the routine this opcode calls). Only one call can be stored at a time!
 
Use within macros is ill-advised, as using <code>return;</code> within a macro will just end the macro!


{| class="wikitable"
{| class="wikitable"
Line 7,047: Line 7,205:
|-
|-
|1
|1
|Addr
|uint
|jump_address
|jump_address
|The address to call, e.g., <code>call @label_0;</code> if <code>§label_0;</code> is defined in the script.
|The address to call, e.g., <code>call @label_0;</code> if <code>§label_0;</code> is defined in the script.
Line 7,068: Line 7,226:
|-
|-
|2
|2
|Addr
|uint
|jump_address
|jump_address
|
|
Line 7,089: Line 7,247:
|-
|-
|2
|2
|Addr
|uint
|jump_address
|jump_address
|
|
Line 7,110: Line 7,268:
|-
|-
|2
|2
|Addr
|uint
|jump_address
|jump_address
|
|
Line 7,126: Line 7,284:
|-
|-
|1
|1
|Operator
|uint
|operator
|operator
|
|
Line 7,136: Line 7,294:
|-
|-
|3
|3
|Addr
|uint
|jump_address
|jump_address
|
|
Line 7,173: Line 7,331:
|-
|-
|1
|1
|Operator
|uint
|operator
|operator
|
|
Line 7,183: Line 7,341:
|-
|-
|3
|3
|Addr
|uint
|jump_address
|jump_address
|
|
Line 7,199: Line 7,357:
|-
|-
|1
|1
|Operator
|uint
|operator
|operator
|
|
Line 7,209: Line 7,367:
|-
|-
|3
|3
|Addr
|uint
|jump_address
|jump_address
|
|
Line 7,255: Line 7,413:
|-
|-
|3
|3
|bool
|uint
|value
|value
|
|
Line 7,276: Line 7,434:
|-
|-
|2
|2
|CalcOperator
|uint
|calc_operator
|calc_operator
|
|
Line 7,302: Line 7,460:
|-
|-
|2
|2
|CalcOperator
|uint
|calc_operator
|calc_operator
|
|
Line 7,459: Line 7,617:
|-
|-
|2
|2
|bool
|uint
|value
|value
|
|
Line 7,490: Line 7,648:
|}
|}
=== 0x82 - Hold ===
=== 0x82 - Hold ===
<TO DO: Opcode description>
Will stall a script forever.


No parameters.
No parameters.
Line 7,505: Line 7,663:
|-
|-
|1
|1
|Addr
|uint
|jump_address
|jump_address
|
|
Line 7,526: Line 7,684:
|}
|}
=== 0xaa - message_SwitchMenu ===
=== 0xaa - message_SwitchMenu ===
<TO DO: Opcode description>
Enclose within a switch case, and generates a dialogue prompt with the options present in subsequent "case menu("text"):"


{| class="wikitable"
{| class="wikitable"
Line 7,538: Line 7,696:
|1
|1
|uint
|uint
|unk0
|cancel
|
|If player can use the B button to back out of a menu. 0 for false, 1 for true.
|-
|-
|2
|2
|uint
|uint
|unk1
|init
|
|Entry number to start the cursor at, starting at 1
|}
|}
=== 0xab - message_SwitchMenu2 ===
=== 0xab - message_SwitchMenu2 ===
<TO DO: Opcode description>
Same as message_SwitchMenu, but it also takes an argument for a bitfield, and will only display dialogue options for which the corresponding bit is enabled (set to 1).


{| class="wikitable"
{| class="wikitable"
Line 7,559: Line 7,717:
|1
|1
|uint
|uint
|unk0
|cancel
|
|If player can use the B button to back out of a menu. 0 for false, 1 for true.
|-
|-
|2
|2
|uint
|uint
|unk1
|init
|
|Entry number to start the cursor at, starting at 1
|-
|-
|3
|3
|uint
|uint
|unk2
|unk2
|
|Bitfield $VAR
|}
|}
=== 0xac - message_SwitchMonologue ===
=== 0xac - message_SwitchMonologue ===
<TO DO: Opcode description>
Structured similarly to a switch statement. Typically uses <code>$HERO_TALK_KIND</code> as an argument, and uses multiple cases to display certain dialogue strings.
 
<code>case 4:</code> used when the player is male or genderless
 
<code>case 5:</code> used when the player is female
 
<code>default:</code> used when <code>$HERO_TALK_KIND</code>'s Talk Group has a value other than 4 or 5
 
This opcode supports displaying a portrait. No sound effect is used when text is scrolling.


{| class="wikitable"
{| class="wikitable"
Line 7,586: Line 7,752:
|GameVar
|GameVar
|var
|var
|
|<code>$x_TALK_KIND</code>, contains Talk Group number
|}
|}
=== 0xad - message_SwitchTalk ===
=== 0xad - message_SwitchTalk ===
<TO DO: Opcode description>
Same as _SwitchMonologue, but typically uses <code>$PARTNER_TALK_KIND</code> as an argument, and the cases used vary.
 
Of the vanilla game partner options:
 
<code>case 1:</code> used if Squirtle, Tododile, Chimchar, Meowth, or Munchlax
 
<code>case 2:</code> used for all other male partners
 
<code>case 3:</code> used for all female partners
 
<code>default:</code> used when <code>$PARTNER_TALK_KIND</code>'s Talk Group has a value other than 1, 2, or 3
 
This opcode supports displaying a portrait. The [[sound effect]] 16133 will emit from the each character scrolling in the text.


{| class="wikitable"
{| class="wikitable"
Line 7,602: Line 7,780:
|GameVar
|GameVar
|var
|var
|
|<code>$x_TALK_KIND</code>, contains Talk Group number
|}
|}
=== 0xc9 - object ===
=== 0xc9 - object ===
Line 7,637: Line 7,815:
|}
|}
=== 0xd5 - Return ===
=== 0xd5 - Return ===
<TO DO: Opcode description>
If run from within a macro, ends the macro.
 
If run after the "call" opcode was used, will return to the address of the call opcode.
 
If used within a script, ends the script.


No parameters.
No parameters.
Line 7,737: Line 7,919:
|}
|}
=== 0x145 - SwitchLives ===
=== 0x145 - SwitchLives ===
<TO DO: Opcode description>
If inside a Switch Case, take the case equal to the species ID of the specified Actor!


{| class="wikitable"
{| class="wikitable"
Line 7,748: Line 7,930:
|-
|-
|1
|1
|uint
|Entity
|unk0
|actor_id
|
|An entry in the Actor List.
|}
|}
=== 0x146 - SwitchRandom ===
=== 0x146 - SwitchRandom ===
<TO DO: Opcode description>
To be used in a switch statement. Will switch to a case of a random number below the specified integer.


{| class="wikitable"
{| class="wikitable"
Line 7,766: Line 7,948:
|uint
|uint
|max_value
|max_value
|
|Largest random output, plus 1
|}
|}
=== 0x147 - SwitchScenario ===
=== 0x147 - SwitchScenario ===
Line 7,857: Line 8,039:
|}
|}
{{NavScriptTerms}}
{{NavScriptTerms}}
[[Category:Documentation]]