List of Opcodes: Difference between revisions

0x162 - WaitExecutePerformer: Added description for WaitExecutePerformer (assistance from Sergey)
Tags: Mobile edit Mobile web edit
RRad (talk | contribs)
 
(104 intermediate revisions by 9 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,296: Line 3,376:
|}
|}
=== 0xd0 - ResetFunctionAttribute ===
=== 0xd0 - ResetFunctionAttribute ===
Sets certain bits of an entity's (i.e., an actor, object, or performer) "function" attribute to 0.
Enables bits that change properties of entities, namely how they follow other actors and how their talk script can be triggered, to 0. Is only intended to disable bits of a shared "attribute" bitfield on the range [0,5], but larger values seem to affect other bitfields. Skytemple accepts binary inputs for params, it is recommended you use them for this opcode!


{| class="wikitable"
{| class="wikitable"
Line 3,304: Line 3,384:
!Type
!Type
!Name
!Name
!Index
! colspan="2" |Bit value
!Description
!Description
|-
| rowspan="6" |1
| rowspan="6" |bitfield
| rowspan="6" |function_bitfield
|0
|0b000001
|1
|Must be OFF for an actor to follow. Potentially signals leader?
|-
|-
|1
|1
|uint
|0b000010
|function_bitfield
|2
|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.
|Must be ON for an actor to follow. Potentially signals follower?
|-
|2
|0b000100
|4
|Unknown.
|-
|3
|0b001000
|8
|Unknown. Seems to prevent the actor from turning to face you if disabled. May be interfering with assignment of ACTOR_TALK_SUB or ACTOR_TALK_MAIN, or just preventing movement?
|-
|4
|0b010000
|16
|Unknown.
|-
|5
|0b100000
|32
|Related to follower status and shadow. If a follower has it enabled, output 8 will be enabled.
|}
|}
=== 0xd1 - ResetHitAttribute ===
=== 0xd1 - ResetHitAttribute ===
Sets certain bits of an entity's (i.e., an actor, object, or performer) "hit" attribute to 0.
Resets bits that change properties of entities, namely how their collision works, to 0. Is only intended to disable bits of a shared "attribute" bitfield on the range [6,10], but larger values seem to affect other bitfields. Skytemple accepts binary inputs for params, it is recommended you use them for this opcode!


{| class="wikitable"
{| class="wikitable"
Line 3,320: Line 3,430:
!Type
!Type
!Name
!Name
!Index
! colspan="2" |Bit value
!Description
!Description
|-
|-
| rowspan="5" |1
| rowspan="5" |bitfield
| rowspan="5" |hit_bitfield
|0
|0b00001
|1
|1
|uint
|Must be enabled for the entity to interact with layer 1 of map collision.
|hit_bitfield
|-
|Most bits' purposes are unknown.
|1
 
|0b00010
* 2: Entity collision.
|2
* 6: Talk Script upon collision.
|Must be enabled for the entity to interact with layer 2 of map collision.
* 7: Talk Script upon pressing the A Button near the entity.
|-
|2
|0b00100
|4
|Must be enabled for actor collisions to be recognized (GetCollidingActorID).
|-
|3
|0b01000
|8
|Must be enabled for object collisions to be recognized (GetCollidingObjectID).
|-
|4
|0b10000
|16
|Must be enabled for event (trigger) collisions to be recognized (GetCollidingEventID).
|}
|}
=== 0xd2 - ResetOutputAttribute ===
=== 0xd2 - ResetOutputAttribute ===
Sets certain bits of an entity's (i.e., an actor, object, or performer) "output" attribute to 0.
Resets certain bits of an entity's (i.e., an actor, object, or performer) "output" attribute to 0. Is only intended to disable bits of a shared "attribute" bitfield on the range [16,31]. Skytemple accepts binary inputs for params, it is recommended you use them for this opcode!


{| class="wikitable"
{| class="wikitable"
Line 3,340: Line 3,471:
!Type
!Type
!Name
!Name
!Id
! colspan="2" |Bit value
!Description
!Description
|-
|-
| rowspan="16" |1
| rowspan="16" |bitfield
| rowspan="16" |output_bitfield
|0
|0b0000000000000001
|1
|1
|uint
|Unknown.
|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.
|}
=== 0xd3 - ResetReplyAttribute ===
Sets certain bits of an entity's (i.e., an actor, object, or performer) "reply" attribute to 0.
 
{| class="wikitable"
|+Parameters
|-
!#
!Type
!Name
!Description
|-
|-
|1
|1
|uint
|0b0000000000000010
|reply_bitfield
|2
|Most bits' purposes are unknown.
|Underlay below entities.
 
* 1: Talk Script upon collision.
* 2: Talk Script upon pressing the A Button near the entity.
* 6: Underlay below entities.
* 7: Overlay above entities.
|}
=== 0xd4 - ResumeEffect ===
Resumes the current graphical effect of an entity (i.e., an actor, object, or performer) that has been paused with <code>PauseEffect</code> prior to using this opcode.
 
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"
|+Parameters
|-
|-
!#
|2
!Type
|0b0000000000000100
!Name
|4
!Description
|Overlay above entities.
|-
|3
|0b0000000000001000
|8
|Overlay above the current Map Background's Layer 2.
|-
|4
|0b0000000000010000
|16
|Overlay above the game's canvas system, including textbox, portrait, and some screen_ commands not ending in <code>All</code>.
|-
|5
|0b0000000000100000
|32
|Flicker.
|-
|6
|0b0000000001000000
|64
|Transparency.
|-
|7
|0b0000000010000000
|128
|Invisibility.
|-
|8
|0b0000000100000000
|256
|Displays shadow.
|-
|9
|0b0000001000000000
|512
|Unknown.
|-
|10
|0b0000010000000000
|1024
|Always render, regardless of distance from the screen.
|-
|11
|0b0000100000000000
|2048
|Makes coordinates relative to the screen rather than the map. (Likely only for rendering and not collision, untested.)
|-
|12
|0b0001000000000000
|4096
|Unknown.
|-
|13
|0b0010000000000000
|8192
|Unknown.
|-
|14
|0b0100000000000000
|16384
|Unknown.
|-
|-
|1
|15
|Effect
|0b1000000000000000
|effect_id
|32768
|A graphical effect to display relative to an entity.
|In 0x22F655C [EU], determines the first bit of alloc_flags for <code>LoadWanTableEntryFromPack</code>. Seems to be enabled in 0x22F8818 [EU] if its fifth param is true.
|}
|}
=== 0xd6 - SavePosition ===
=== 0xd3 - ResetReplyAttribute ===
Saves various attributes of an entity (i.e., an actor, object, or performer) to the following script variables:
Resets bits that change properties of entities, namely how their talk script is triggered, to 0. Is only intended to enable bits of a shared "attribute" bitfield on the range [11,15], but larger values seem to affect other bitfields. Skytemple accepts binary inputs for params, it is recommended you use them for this opcode!
 
* <code>$POSITION_X</code>: The pixel position of the entity on the X-axis multiplied by 256.
* <code>$POSITION_Y</code>: The pixel position of the entity on the Y-axis multiplied by 256.
* <code>$POSITION_HEIGHT</code>: The pixel height (i.e., displacement of the entity from their shadow) of the entity multiplied by 256.
* <code>$POSITION_DIRECTION</code>: The direction the entity is facing.
 
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"
|+Parameters
|+Parameters
Line 3,410: Line 3,566:
!Type
!Type
!Name
!Name
!Index
! colspan="2" |Bit value
!Description
!Description
|-
| rowspan="5" |1
| rowspan="5" |bitfield
| rowspan="5" |reply_bitfield
|0
|0b00001
|1
|Unknown.
|-
|-
|1
|1
|uint
|0b00010
|index
|2
|Index used by all <code>$POSITION_</code> script variables, ranged from 0-2 (inclusive).
|If enabled, plays talk script if colliding with entity.
|}
|-
=== 0xd7 - screen_FadeChange ===
|2
Changes the brightness of the screen across a certain number of frames. This opcode will not affect:
|0b00100
|4
|If enabled, plays talk script when pressing A near the entity.
|-
|3
|0b01000
|8
|Unknown.
|-
|4
|0b10000
|16
|Unknown.
|}
=== 0xd4 - ResumeEffect ===
Resumes the current graphical effect of an entity (i.e., an actor, object, or performer) that has been paused with <code>PauseEffect</code> prior to using this opcode.
 
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"
|+Parameters
|-
!#
!Type
!Name
!Description
|-
|1
|Effect
|effect_id
|A graphical effect to display relative to an entity.
|}
=== 0xd6 - SavePosition ===
Saves various attributes of an entity (i.e., an actor, object, or performer) to the following script variables:
 
* <code>$POSITION_X</code>: The pixel position of the entity on the X-axis multiplied by 256.
* <code>$POSITION_Y</code>: The pixel position of the entity on the Y-axis multiplied by 256.
* <code>$POSITION_HEIGHT</code>: The pixel height (i.e., displacement of the entity from their shadow) of the entity multiplied by 256.
* <code>$POSITION_DIRECTION</code>: The direction the entity is facing.
 
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"
|+Parameters
|-
!#
!Type
!Name
!Description
|-
|1
|uint
|index
|Index used by all <code>$POSITION_</code> script variables, ranged from 0-2 (inclusive).
|}
=== 0xd7 - screen_FadeChange ===
Changes the brightness of the screen across a certain number of frames. This opcode will not affect:


* Entities who have had their 4th "output" bit set to 1 (e.g., by using <code>SetOutputAttribute(16);</code> with them).
* Entities who have had their 4th "output" bit set to 1 (e.g., by using <code>SetOutputAttribute(16);</code> with them).
Line 3,433: Line 3,655:
|-
|-
|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,694:
|-
|-
|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,737:
|-
|-
|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,758:
|-
|-
|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,783:
|-
|-
|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,804:
|-
|-
|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,875:
|-
|-
|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,927:
|-
|-
|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,983:
|-
|-
|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 4,022:
|-
|-
|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 4,107:
|-
|-
|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 4,128:
|-
|-
|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,149:
|-
|-
|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,219:
|-
|-
|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,261:
|-
|-
|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,354:
|-
|-
|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,406:
|-
|-
|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,458:
|-
|-
|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,570:
|-
|-
|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,402: Line 4,624:
|uint
|uint
|pan
|pan
|The panning of the SE. This parameter gets recalculated internally as  <code>((''pan'' * 0x3f + ((''pan'' * 0x3f >> 7) >> 0x18)) >> 8) + 0x40</code>, which is eventually split up into two halfwords, then recalculated further into a signed byte.
|The panning of the SE. Has an intended range of -260 (left) to 260 (right), with 0 being the center.
 
This parameter gets recalculated internally as  <code>((''pan'' * 0x3f + ((''pan'' * 0x3f >> 7) >> 0x18)) >> 8) + 0x40</code>, which is eventually split up into two halfwords, then recalculated further into a signed byte.
What this means is that:
What this means is that:


* A ''pan'' parameter of 260 will result in sound panning only to the right channel.
* A ''pan'' parameter of 260 will result in sound panning only to the right channel.
* A ''pan'' parameter of 261 will result in sound panning only to the left channel.
* A ''pan'' parameter of 261 will result in sound panning only to the left channel.
More research on this parameter may be needed.
|}
|}
=== 0xf6 - se_ChangeVolume ===
=== 0xf6 - se_ChangeVolume ===
Line 4,497: Line 4,719:
|uint
|uint
|pan
|pan
|The panning of the SE. This parameter gets recalculated internally as  <code>((''pan'' * 0x3f + ((''pan'' * 0x3f >> 7) >> 0x18)) >> 8) + 0x40</code>, which is eventually split up into two halfwords, then recalculated further into a signed byte.
|The panning of the SE. Has an intended range of -260 (left) to 260 (right), with 0 being the center.
 
This parameter gets recalculated internally as  <code>((''pan'' * 0x3f + ((''pan'' * 0x3f >> 7) >> 0x18)) >> 8) + 0x40</code>, which is eventually split up into two halfwords, then recalculated further into a signed byte.
What this means is that:
What this means is that:


* A ''pan'' parameter of 260 will result in sound panning only to the right channel.
* A ''pan'' parameter of 260 will result in sound panning only to the right channel.
* A ''pan'' parameter of 261 will result in sound panning only to the left channel.
* A ''pan'' parameter of 261 will result in sound panning only to the left channel.
More research on this parameter may be needed.
|}
|}
=== 0xfa - se_PlayPan ===
=== 0xfa - se_PlayPan ===
Line 4,524: Line 4,746:
|uint
|uint
|pan
|pan
|The panning of the SE. This parameter gets recalculated internally as  <code>((''pan'' * 0x3f + ((''pan'' * 0x3f >> 7) >> 0x18)) >> 8) + 0x40</code>, which is eventually split up into two halfwords, then recalculated further into a signed byte.
|The panning of the SE. Has an intended range of -260 (left) to 260 (right), with 0 being the center.
 
This parameter gets recalculated internally as  <code>((''pan'' * 0x3f + ((''pan'' * 0x3f >> 7) >> 0x18)) >> 8) + 0x40</code>, which is eventually split up into two halfwords, then recalculated further into a signed byte.
What this means is that:
What this means is that:


* A ''pan'' parameter of 260 will result in sound panning only to the right channel.
* A ''pan'' parameter of 260 will result in sound panning only to the right channel.
* A ''pan'' parameter of 261 will result in sound panning only to the left channel.
* A ''pan'' parameter of 261 will result in sound panning only to the left channel.
More research on this parameter may be needed.
|}
|}
=== 0xfb - se_PlayVolume ===
=== 0xfb - se_PlayVolume ===
Line 4,664: Line 4,886:
|}
|}
=== 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,899:
|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:
# <li value="0">Head</li>
# Right Hand
# Left Hand
# Center
# No offset (bottom of sprite)
|}
|}
=== 0x103 - SetFunctionAttribute ===
=== 0x103 - SetFunctionAttribute ===
<TO DO: Opcode description>
Enables bits that change properties of entities, namely how they follow other actors and how their talk script can be triggered, to 1. Is only intended to enable bits of a shared "attribute" bitfield on the range [0,5], but larger values seem to affect other bitfields. Skytemple accepts binary inputs for params, it is recommended you use them for this opcode!


{| class="wikitable"
{| class="wikitable"
Line 4,693: Line 4,921:
!Type
!Type
!Name
!Name
!Index
! colspan="2" |Bit value
!Description
!Description
|-
|-
| rowspan="6" |1
| rowspan="6" |bitfield
| rowspan="6" |func_bitfield
|0
|0b000001
|1
|1
|uint
|Must be OFF for an actor to follow. Potentially signals leader?
|unk0
|-
|
|1
|0b000010
|2
|Must be ON for an actor to follow. Potentially signals follower?
|-
|2
|0b000100
|4
|Unknown.
|-
|3
|0b001000
|8
|Unknown. Seems to prevent the actor from turning to face you if disabled. May be interfering with assignment of ACTOR_TALK_SUB or ACTOR_TALK_MAIN, or just preventing movement?
|-
|4
|0b010000
|16
|Unknown.
|-
|5
|0b100000
|32
|Related to follower status and shadow. If a follower has it enabled, output 8 will be enabled.
|}
|}
=== 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,972:
|uint
|uint
|unk0
|unk0
|
|number of pixels to move up or down by.
|}
|}
=== 0x105 - SetHitAttribute ===
=== 0x105 - SetHitAttribute ===
<TO DO: Opcode description>
Sets bits that change properties of entities, namely how their collision works, to 1. Is only intended to enable bits of a shared "attribute" bitfield on the range [6,10], but larger values seem to affect other bitfields. Skytemple accepts binary inputs for params, it is recommended you use them for this opcode!


{| class="wikitable"
{| class="wikitable"
Line 4,725: Line 4,983:
!Type
!Type
!Name
!Name
!Index
! colspan="2" |Bit value
!Description
!Description
|-
|-
| rowspan="5" |1
| rowspan="5" |bitfield
| rowspan="5" |hit_bitfield
|0
|0b00001
|1
|1
|uint
|Must be enabled for the entity to interact with layer 1 of map collision.
|unk0
|-
|
|1
|}
|0b00010
=== 0x106 - SetMoveRange ===
|2
<TO DO: Opcode description>
|Must be enabled for the entity to interact with layer 2 of map collision.
 
|-
{| class="wikitable"
|2
|+Parameters
|0b00100
|4
|Must be enabled for actor collisions to be recognized (GetCollidingActorID).
|-
|3
|0b01000
|8
|Must be enabled for object collisions to be recognized (GetCollidingObjectID).
|-
|4
|0b10000
|16
|Must be enabled for event (trigger) collisions to be recognized (GetCollidingEventID).
|}
=== 0x106 - SetMoveRange ===
<TO DO: Opcode description>
 
{| class="wikitable"
|+Parameters
|-
|-
!#
!#
Line 4,759: Line 5,042:
|}
|}
=== 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. Is only intended to enable bits of a shared "attribute" bitfield on the range [16,31]. Skytemple accepts binary inputs for params, it is recommended you use them for this opcode!
 
{| class="wikitable"
{| class="wikitable"
|+Parameters
|+Parameters
Line 4,767: Line 5,049:
!Type
!Type
!Name
!Name
!Id
! colspan="2" |Bit value
!Description
!Description
|-
| rowspan="16" |1
| rowspan="16" |bitfield
| rowspan="16" |output_bitfield
|0
|0b0000000000000001
|1
|Unknown.
|-
|-
|1
|1
|uint
|0b0000000000000010
|unk0
|2
|
|Underlay below entities.
|-
|2
|0b0000000000000100
|4
|Overlay above entities.
|-
|3
|0b0000000000001000
|8
|Overlay above the current Map Background's Layer 2.
|-
|4
|0b0000000000010000
|16
|Overlay above the game's canvas system, including textbox, portrait, and some screen_ commands not ending in <code>All</code>.
|-
|5
|0b0000000000100000
|32
|Flicker.
|-
|6
|0b0000000001000000
|64
|Transparency.
|-
|7
|0b0000000010000000
|128
|Invisibility.
|-
|8
|0b0000000100000000
|256
|Displays shadow.
|-
|9
|0b0000001000000000
|512
|Unknown.
|-
|10
|0b0000010000000000
|1024
|Always render, regardless of distance from the screen.
|-
|11
|0b0000100000000000
|2048
|Makes coordinates relative to the screen rather than the map. (Likely only for rendering and not collision, untested.)
|-
|12
|0b0001000000000000
|4096
|Unknown.
|-
|13
|0b0010000000000000
|8192
|Unknown.
|-
|14
|0b0100000000000000
|16384
|Unknown.
|-
|15
|0b1000000000000000
|32768
|In 0x22F655C [EU], determines the first bit of alloc_flags for <code>LoadWanTableEntryFromPack</code>. Seems to be enabled in 0x22F8818 [EU] if its fifth param is true. (Further detail is not currently known)
|}
|}
=== 0x108 - SetPosition ===
=== 0x108 - SetPosition ===
Line 4,874: Line 5,236:
|}
|}
=== 0x10e - SetReplyAttribute ===
=== 0x10e - SetReplyAttribute ===
<TO DO: Opcode description>
Sets bits that change properties of entities, namely how their talk script is triggered, to 1. Is only intended to enable bits of a shared "attribute" bitfield on the range [11,15], but larger values seem to affect other bitfields. Skytemple accepts binary inputs for params, it is recommended you use them for this opcode!
 
{| class="wikitable"
{| class="wikitable"
|+Parameters
|+Parameters
Line 4,882: Line 5,243:
!Type
!Type
!Name
!Name
!Index
! colspan="2" |Bit value
!Description
!Description
|-
|-
| rowspan="5" |1
| rowspan="5" |bitfield
| rowspan="5" |reply_bitfield
|0
|0b00001
|1
|1
|uint
|Unknown.
|unk0
|-
|
|1
|0b00010
|2
|If enabled, plays talk script if colliding with entity.
|-
|2
|0b00100
|4
|If enabled, plays talk script when pressing A near the entity.
|-
|3
|0b01000
|8
|Unknown.
|-
|4
|0b10000
|16
|Unknown.
|}
|}
=== 0x10f - SetupOutputAttributeAndAnimation ===
=== 0x10f - SetupOutputAttributeAndAnimation ===
Line 4,916: Line 5,302:
|}
|}
=== 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,314:
|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,341:
|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,366:
|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,390:
|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>
Offsets an entity (i.e., an actor, object, or performer) from its current position across both axes without restricting the angles used. The entity does not change the direction that it faces.
 
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,030: Line 5,427:
|}
|}
=== 0x115 - Slide2PositionOffset ===
=== 0x115 - Slide2PositionOffset ===
<TO DO: Opcode description>
Offsets an entity (i.e., an actor, object, or performer) from its current position across both axes without restricting the angles used. The entity does not change the direction that it faces.
 
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,042: Line 5,441:
|1
|1
|uint
|uint
|unk0
|speed
|
|Movement speed. Higher values result in a faster speed. Values starting at 32770 or above will be slower than a value of 1.
|-
|-
|2
|2
|sint
|sint
|x
|x
|
|How much the entity is offset in the x direction.
|-
|-
|3
|3
|sint
|sint
|y
|y
|
|How much the entity is offset in the y direction.
|}
|}
=== 0x116 - Slide2PositionOffsetRandom ===
=== 0x116 - Slide2PositionOffsetRandom ===
Line 5,068: Line 5,467:
|1
|1
|uint
|uint
|unk0
|speed
|
|
|-
|-
Line 5,094: Line 5,493:
|1
|1
|uint
|uint
|unk0
|speed
|
|
|-
|-
Line 5,120: Line 5,519:
|1
|1
|uint
|uint
|unk0
|speed
|
|
|-
|-
|2
|2
|uint
|uint
|unk1
|actor_id
|
|
|}
|}
Line 5,162: Line 5,561:
|1
|1
|uint
|uint
|unk0
|speed
|
|
|-
|-
Line 5,183: Line 5,582:
|1
|1
|uint
|uint
|unk0
|num_parameters
|
|
|-
|-
Line 5,208: Line 5,607:
|1
|1
|uint
|uint
|unk0
|speed
|
|
|-
|-
Line 5,234: Line 5,633:
|1
|1
|uint
|uint
|unk0
|speed
|
|
|-
|-
Line 5,382: Line 5,781:
|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,850:
|1
|1
|uint
|uint
|unk0
|speed
|
|
|-
|-
Line 5,485: Line 5,884:
No parameters.
No parameters.
=== 0x129 - StopAnimation ===
=== 0x129 - StopAnimation ===
<TO DO: Opcode description>
Stops a sprite's current animation, freezing it to its first frame.
 
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.
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,903:
|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,920:
|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,937:
|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. Sector ids above a certain threshold do not function. Perhaps 100, or 127?
|}
|}
=== 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,964:
|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. Note: Sector ids above a certain threshold do not function. Perhaps 100, or 127?
|}
|}
=== 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,993:
|
|
|}
|}
=== 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 6,007:
|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 6,106:
|}
|}
=== 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 6,118:
|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 6,160:
|}
|}
=== 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 6,172:
|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 6,190:
|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 6,206:
|1
|1
|uint
|uint
|unk0
|layer_id
|
|The ID of the sector to unload.
|}
|}
=== 0x13a - supervision_SpecialActing ===
=== 0x13a - supervision_SpecialActing ===
<TO DO: Opcode description>
It performs various hardcoded functionalities, mostly fancy graphical things like the Waterfall Cave flood, the beach bubbles, SE1 spotlight, etc


{| class="wikitable"
{| class="wikitable"
Line 5,826: Line 6,237:
|}
|}
=== 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 6,250:
|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 6,269:
|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,315:
|}
|}
=== 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,329:
|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,356:
|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,383:
|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,434:
|}
|}
=== 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,448:
|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,183: Line 6,606:


=== 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,208: Line 6,633:
|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,224: Line 6,650:
|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.
 
Also unpauses if there is no BGM playing, making it a general purpose WaitBgm.


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,239: Line 6,669:
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,252: Line 6,682:
|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,268: Line 6,699:
|Object
|Object
|object_id
|object_id
|
|The ID of the object that the routine will wait for.
|}
|}
=== 0x162 - WaitExecutePerformer ===
=== 0x162 - WaitExecutePerformer ===
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.
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.
Line 6,288: Line 6,720:


=== 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,312: Line 6,745:
|
|
|}
|}
=== 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,333: Line 6,767:
|
|
|}
|}
=== 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,354: Line 6,789:
|
|
|}
|}
=== 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,367: Line 6,803:
|1
|1
|uint
|uint
|unk0
|lock_id
|
|
|}
|}
=== 0x168 - WaitMe ===
=== 0x168 - WaitMe ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Line 6,395: Line 6,832:
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,407: Line 6,844:
|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,441: Line 6,879:
|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,456: Line 6,895:
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,468: Line 6,907:
|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,484: Line 6,924:
|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,504: Line 6,945:
|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,524: Line 6,967:
|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,540: Line 6,984:
|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,556: Line 7,000:
|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,572: Line 7,016:
|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,592: Line 7,038:
|}
|}
=== 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,604: Line 7,050:
|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,620: Line 7,077:
|1
|1
|uint
|uint
|unk0
|world_map_mode
|
|
|}
|}


== Other Opcodes ==
== Other Opcodes ==
These opcodes cannot be directly called from ExplorerScript, since they are represented as higher-level constructs.
These opcodes cannot be directly called from ExplorerScript, since they are represented as higher-level constructs, but are present in [[SSBScript]].


=== 0x28 - Branch ===
=== 0x28 - Branch ===
Line 6,649: Line 7,106:
|-
|-
|3
|3
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,675: Line 7,132:
|-
|-
|3
|3
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,691: Line 7,148:
|-
|-
|1
|1
|bool
|uint
|param
|param
|
|
|-
|-
|2
|2
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,717: Line 7,174:
|-
|-
|2
|2
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,738: Line 7,195:
|-
|-
|2
|2
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,759: Line 7,216:
|-
|-
|2
|2
|bool
|uint
|value
|value
|
|
|-
|-
|3
|3
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,795: Line 7,252:
|-
|-
|4
|4
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,826: Line 7,283:
|-
|-
|4
|4
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,857: Line 7,314:
|-
|-
|4
|4
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,888: Line 7,345:
|-
|-
|4
|4
|Addr
|uint
|jump_address
|jump_address
|
|
Line 6,919: Line 7,376:
|-
|-
|4
|4
|Addr
|uint
|jump_address
|jump_address
|
|
|}
|}
=== 0x33 - BranchSum ===
=== 0x33 - BranchSum ===
<TO DO: Opcode description>
Calculates the sum of an indexed variable, compares it against a value, and jumps to a relative address if a certain condition is met (e.g., equal).


{| class="wikitable"
{| class="wikitable"
Line 6,935: Line 7,392:
|-
|-
|1
|1
|uint
|GameVar
|unk0
|var
|
|One of the 115 possible script variables. Specifically, an indexed variable is expected.
|-
|-
|2
|2
|uint
|uint
|unk1
|operator
|
|Comparison operator used when comparing variable sum against a value.
# <li value="0">Always true</li>
# Always false
# Equal
# Greater than
# Less than
# Greater than or equal
# Less than or equal
# Not equal
# Bitwise AND
# Bitwise XOR
# Test specific bit
|-
|-
|3
|3
|uint
|uint
|unk2
|value
|
|Value used in comparison.
|-
|-
|4
|4
|Addr
|uint
|jump_address
|jump_address
|
|Address to jump to if the comparison meets the condition.
|}
|}
=== 0x34 - BranchValue ===
=== 0x34 - BranchValue ===
Line 6,971: Line 7,439:
|-
|-
|2
|2
|Operator
|uint
|operator
|operator
|
|
Line 6,981: Line 7,449:
|-
|-
|4
|4
|Addr
|uint
|jump_address
|jump_address
|
|
Line 7,002: Line 7,470:
|-
|-
|2
|2
|Operator
|uint
|operator
|operator
|
|
Line 7,012: Line 7,480:
|-
|-
|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,030: Line 7,500:
|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,049: Line 7,521:
|-
|-
|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,070: Line 7,542:
|-
|-
|2
|2
|Addr
|uint
|jump_address
|jump_address
|
|
Line 7,091: Line 7,563:
|-
|-
|2
|2
|Addr
|uint
|jump_address
|jump_address
|
|
Line 7,112: Line 7,584:
|-
|-
|2
|2
|Addr
|uint
|jump_address
|jump_address
|
|
Line 7,128: Line 7,600:
|-
|-
|1
|1
|Operator
|uint
|operator
|operator
|
|
Line 7,138: Line 7,610:
|-
|-
|3
|3
|Addr
|uint
|jump_address
|jump_address
|
|
Line 7,175: Line 7,647:
|-
|-
|1
|1
|Operator
|uint
|operator
|operator
|
|
Line 7,185: Line 7,657:
|-
|-
|3
|3
|Addr
|uint
|jump_address
|jump_address
|
|
Line 7,201: Line 7,673:
|-
|-
|1
|1
|Operator
|uint
|operator
|operator
|
|
Line 7,211: Line 7,683:
|-
|-
|3
|3
|Addr
|uint
|jump_address
|jump_address
|
|
Line 7,257: Line 7,729:
|-
|-
|3
|3
|bool
|uint
|value
|value
|
|
Line 7,278: Line 7,750:
|-
|-
|2
|2
|CalcOperator
|uint
|calc_operator
|calc_operator
|
|
Line 7,304: Line 7,776:
|-
|-
|2
|2
|CalcOperator
|uint
|calc_operator
|calc_operator
|
|
Line 7,461: Line 7,933:
|-
|-
|2
|2
|bool
|uint
|value
|value
|
|
Line 7,492: Line 7,964:
|}
|}
=== 0x82 - Hold ===
=== 0x82 - Hold ===
<TO DO: Opcode description>
Will stall a script forever.


No parameters.
No parameters.
Line 7,507: Line 7,979:
|-
|-
|1
|1
|Addr
|uint
|jump_address
|jump_address
|
|
Line 7,528: Line 8,000:
|}
|}
=== 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,540: Line 8,012:
|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,561: Line 8,033:
|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,588: Line 8,068:
|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 game's partner options:
 
<code>case 1:</code> used if male Squirtle, Totodile, Chimchar, Meowth, or Munchlax
 
<code>case 2:</code> default (all other male partners in vanilla)
 
<code>case 3:</code> used if female Vulpix, Eevee, Chikorita, Torchic or Skitty (all female partners in vanilla)
 
<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,604: Line 8,096:
|GameVar
|GameVar
|var
|var
|
|<code>$x_TALK_KIND</code>, contains Talk Group number
|}
|}
=== 0xc9 - object ===
=== 0xc9 - object ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Line 7,639: Line 8,132:
|}
|}
=== 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,739: Line 8,236:
|}
|}
=== 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,750: Line 8,247:
|-
|-
|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,768: Line 8,265:
|uint
|uint
|max_value
|max_value
|
|Largest random output, plus 1
|}
|}
=== 0x147 - SwitchScenario ===
=== 0x147 - SwitchScenario ===
Line 7,803: Line 8,300:
|}
|}
=== 0x149 - SwitchSector ===
=== 0x149 - SwitchSector ===
<TO DO: Opcode description>
Returns the currently-loaded "sector" for a given routine. When used in targeted routines, this returns the sector the entity is loaded on. When used in the main routine, this returns a value passed in to load the scene, e.g., the final parameter of <code>supervision_ExecuteActingSub</code>. Most often used in Enter scenes to mark a Cutscene -> Overworld transition, but can also be checked within Acting scenes.
 
In ExplorerScript, this can be simply represented as <code>switch(sector())</code>.


No parameters.
No parameters.
Note: Sector ids above a certain threshold do not function. Perhaps 100, or 127?
=== 0x14a - SwitchValue ===
=== 0x14a - SwitchValue ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Line 7,859: Line 8,360:
|}
|}
{{NavScriptTerms}}
{{NavScriptTerms}}
[[Category:Documentation]]