List of Opcodes: Difference between revisions

Adex (talk | contribs)
Document SwitchSector
RRad (talk | contribs)
 
(20 intermediate revisions by 4 users not shown)
Line 1,988: Line 1,988:


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.
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.
Entering a given dungeon is made in two time: first by calling this function with dungeon_id set to the dungeon you want to enter, the second time with dungeon_id set to -1.


{| class="wikitable"
{| class="wikitable"
Line 3,376: Line 3,378:
|}
|}
=== 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,384: Line 3,386:
!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
|bitfield
|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,400: Line 3,432:
!Type
!Type
!Name
!Name
!Index
! colspan="2" |Bit value
!Description
!Description
|-
| rowspan="5" |1
| rowspan="5" |bitfield
| rowspan="5" |hit_bitfield
|0
|0b00001
|1
|Must be enabled for the entity to interact with layer 1 of map collision.
|-
|-
|1
|1
|bitfield
|0b00010
|hit_bitfield
|2
|Most bits' purposes are unknown.
|Must be enabled for the entity to interact with layer 2 of map collision.
 
|-
* 2: Entity collision.
|2
* 6: Talk Script upon collision.
|0b00100
* 7: Talk Script upon pressing the A Button near the entity.
|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,420: Line 3,473:
!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
|bitfield
|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
|bitfield
|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,490: Line 3,568:
!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.
|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).
* Portraits.
* Textboxes.
 
{| class="wikitable"
|+Parameters
|-
!#
!Type
!Name
!Description
|-
|-
|1
|1
|uint
|0b00010
|suspension_flag
|2
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and 1 is true.
|If enabled, plays talk script if colliding with entity.
|-
|-
|2
|2
|uint
|0b00100
|duration
|4
|The number of frames used to change the Touch Screen's brightness.
|If enabled, plays talk script when pressing A near the entity.
|-
|-
|3
|3
|uint
|0b01000
|start_brightness
|8
|The brightness level the opcode will begin at.
|Unknown.
 
* The minimum brightness is 0, which results in a black screen.
* The default brightness is 256.
* The maximum brightness is 512, which results in a white screen.
|-
|-
|4
|4
|uint
|0b10000
|end_brightness
|16
|The brightness level the opcode will end at.
|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.


* The minimum brightness is 0, which results in a black screen.
This opcode does not have a parameter for an entity, as it must be used in a with-statement or a targeted routine.
* The default brightness is 256.
* The maximum brightness is 512, which results in a white screen.
|}
=== 0xd8 - screen_FadeChangeAll ===
Changes the brightness of the screen across a certain number of frames. This opcode will affect everything on the Touch Screen.


{| class="wikitable"
{| class="wikitable"
Line 3,552: Line 3,614:
|-
|-
|1
|1
|uint
|Effect
|suspension_flag
|effect_id
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|A graphical effect to display relative to an entity.
|-
|}
|2
=== 0xd6 - SavePosition ===
|uint
Saves various attributes of an entity (i.e., an actor, object, or performer) to the following script variables:
|duration
 
|The number of frames used to change the Touch Screen's brightness.
* <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.
|3
* <code>$POSITION_HEIGHT</code>: The pixel height (i.e., displacement of the entity from their shadow) of the entity multiplied by 256.
|uint
* <code>$POSITION_DIRECTION</code>: The direction the entity is facing.
|start_brightness
|The brightness level the opcode will begin at.


* The minimum brightness is 0, which results in a black screen.
This opcode does not have a parameter for an entity, as it must be used in a with-statement or a targeted routine.
* The default brightness is 256.
* The maximum brightness is 512, which results in a white screen.
|-
|4
|uint
|end_brightness
|The brightness level the opcode will end at.
 
* The minimum brightness is 0, which results in a black screen.
* The default brightness is 256.
* The maximum brightness is 512, which results in a white screen.
|}
=== 0xd9 - screen_FadeIn ===
Changes the brightness of the screen to its default state 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).
* Portraits.
* Textboxes.


{| class="wikitable"
{| class="wikitable"
Line 3,596: Line 3,638:
|1
|1
|uint
|uint
|suspension_flag
|index
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Index used by all <code>$POSITION_</code> script variables, ranged from 0-2 (inclusive).
|-
|2
|uint
|duration
|The number of frames used to change the Touch Screen's brightness.
|}
|}
=== 0xda - screen_FadeInAll ===
=== 0xd7 - screen_FadeChange ===
Changes the brightness of the screen to its default state across a certain number of frames. This opcode will affect everything on the Touch Screen.
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).
* Portraits.
* Textboxes.


{| class="wikitable"
{| class="wikitable"
Line 3,618: Line 3,659:
|uint
|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 1 is true.
|-
|-
|2
|2
Line 3,624: Line 3,665:
|duration
|duration
|The number of frames used to change the Touch Screen's brightness.
|The number of frames used to change the Touch Screen's brightness.
|}
|-
=== 0xdb - screen_FadeOut ===
|3
Changes the brightness of the screen to its minimum (i.e., a black screen) across a certain number of frames. This opcode will not affect:
|uint
|start_brightness
|The brightness level the opcode will begin at.
 
* The minimum brightness is 0, which results in a black screen.
* The default brightness is 256.
* The maximum brightness is 512, which results in a white screen.
|-
|4
|uint
|end_brightness
|The brightness level the opcode will end at.


* Entities who have had their 4th "output" bit set to 1 (e.g., by using <code>SetOutputAttribute(16);</code> with them).
* The minimum brightness is 0, which results in a black screen.
* Portraits.
* The default brightness is 256.
* Textboxes.
* The maximum brightness is 512, which results in a white screen.
|}
=== 0xd8 - screen_FadeChangeAll ===
Changes the brightness of the screen across a certain number of frames. This opcode will affect everything on the Touch Screen.


{| class="wikitable"
{| class="wikitable"
Line 3,649: Line 3,704:
|duration
|duration
|The number of frames used to change the Touch Screen's brightness.
|The number of frames used to change the Touch Screen's brightness.
|-
|3
|uint
|start_brightness
|The brightness level the opcode will begin at.
* The minimum brightness is 0, which results in a black screen.
* The default brightness is 256.
* The maximum brightness is 512, which results in a white screen.
|-
|4
|uint
|end_brightness
|The brightness level the opcode will end at.
* The minimum brightness is 0, which results in a black screen.
* The default brightness is 256.
* The maximum brightness is 512, which results in a white screen.
|}
|}
=== 0xdc - screen_FadeOutAll ===
=== 0xd9 - screen_FadeIn ===
Changes the brightness of the screen to its minimum (i.e., a black screen) across a certain number of frames. This opcode will affect everything on the Touch Screen.
Changes the brightness of the screen to its default state 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).
* Portraits.
* Textboxes.


{| class="wikitable"
{| class="wikitable"
Line 3,671: Line 3,748:
|The number of frames used to change the Touch Screen's brightness.
|The number of frames used to change the Touch Screen's brightness.
|}
|}
=== 0xdd - screen_FlushChange ===
=== 0xda - screen_FadeInAll ===
Does nothing.
Changes the brightness of the screen to its default state across a certain number of frames. This opcode will affect everything on the Touch Screen.
 
{| class="wikitable"
{| class="wikitable"
|+Parameters
|+Parameters
|-
!#
!#
!Type
!Type
Line 3,682: Line 3,761:
|1
|1
|uint
|uint
|unk0
|suspension_flag
|Does nothing.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|-
|-
|2
|2
|uint
|uint
|unk1
|duration
|Does nothing.
|The number of frames used to change the Touch Screen's brightness.
|-
|3
|uint
|unk2
|Does nothing.
|-
|4
|uint
|unk3
|Does nothing.
|-
|5
|uint
|unk4
|Does nothing.
|-
|6
|uint
|unk5
|Does nothing.
|-
|7
|uint
|unk6
|Does nothing.
|-
|8
|uint
|unk7
|Does nothing.
|}
|}
=== 0xdb - screen_FadeOut ===
Changes the brightness of the screen to its minimum (i.e., a black screen) across a certain number of frames. This opcode will not affect:


=== 0xde - screen_FlushIn ===
* Entities who have had their 4th "output" bit set to 1 (e.g., by using <code>SetOutputAttribute(16);</code> with them).
Changes the color of the screen from a specific state (given by the opcode's parameters, which affect the Touch Screen instantly) to its default state across a certain number of frames. This opcode will affect all entities (i.e., actors, objects, and performers) on the Touch Screen.
* Portraits.
* Textboxes.


{| class="wikitable"
{| class="wikitable"
Line 3,740: Line 3,792:
|uint
|uint
|duration
|duration
|The number of frames used to change the Touch Screen's color.
|The number of frames used to change the Touch Screen's brightness.
|-
|3
|uint
|mode
|
# Completely darkens the Touch Screen.
# Completely turns the Touch Screen to a certain color.
# Instantly darkens the Touch Screen?
# Overlays the Touch Screen with a certain color.
# Instantly darkens the Touch Screen?
# Overlays the Touch Screen with hardcoded color bytes: 144, 144, and 255.
# Instantly darkens the Touch Screen?
# Overlays the Touch Screen with hardcoded color bytes: 255, 192, and 128.
# Instantly darkens the Touch Screen?
# Overlays the Touch Screen with hardcoded color bytes: All 255. The Touch Screen is not turned completely white.
# Instantly overlays the Touch Screen with hardcoded color bytes: All 255. The Touch Screen is not turned completely white.
|-
|4
|uint
|r
|Unused if ''mode'' is not 2 or 4. Byte used for the color red. Has a minimum of 0 and a maximium of 255.
|-
|5
|uint
|g
|Unused if ''mode'' is not 2 or 4. Byte used for the color green. Has a minimum of 0 and a maximium of 255.
|-
|6
|uint
|b
|Unused if ''mode'' is not 2 or 4. Byte used for the color blue. Has a minimum of 0 and a maximium of 255.
|}
|}
=== 0xdf - screen_FlushOut ===
=== 0xdc - screen_FadeOutAll ===
Changes the color of the screen across a certain number of frames. This opcode will affect all entities (i.e., actors, objects, and performers) on the Touch Screen.
Changes the brightness of the screen to its minimum (i.e., a black screen) across a certain number of frames. This opcode will affect everything on the Touch Screen.


{| class="wikitable"
{| class="wikitable"
Line 3,792: Line 3,813:
|uint
|uint
|duration
|duration
|The number of frames used to change the Touch Screen's color.
|The number of frames used to change the Touch Screen's brightness.
|}
=== 0xdd - screen_FlushChange ===
Does nothing.
{| class="wikitable"
|+Parameters
!#
!Type
!Name
!Description
|-
|-
|3
|1
|uint
|uint
|mode
|unk0
|
|Does nothing.
# Completely darkens the Touch Screen.
|-
# Completely turns the Touch Screen to a certain color.
|2
# Instantly darkens the Touch Screen?
|uint
# Overlays the Touch Screen with a certain color.
|unk1
# Instantly darkens the Touch Screen?
|Does nothing.
# Overlays the Touch Screen with hardcoded color bytes: 144, 144, and 255.
|-
# Instantly darkens the Touch Screen?
|3
# Overlays the Touch Screen with hardcoded color bytes: 255, 192, and 128.
|uint
# Instantly darkens the Touch Screen?
|unk2
# Overlays the Touch Screen with hardcoded color bytes: All 255. The Touch Screen is not turned completely white.
|Does nothing.
# Instantly overlays the Touch Screen with hardcoded color bytes: All 255. The Touch Screen is not turned completely white.
|-
|-
|4
|4
|uint
|uint
|r
|unk3
|Unused if ''mode'' is not 2 or 4. Byte used for the color red. Has a minimum of 0 and a maximium of 255.
|Does nothing.
|-
|-
|5
|5
|uint
|uint
|g
|unk4
|Unused if ''mode'' is not 2 or 4. Byte used for the color green. Has a minimum of 0 and a maximium of 255.
|Does nothing.
|-
|-
|6
|6
|uint
|uint
|b
|unk5
|Unused if ''mode'' is not 2 or 4. Byte used for the color blue. Has a minimum of 0 and a maximium of 255.
|Does nothing.
|-
|7
|uint
|unk6
|Does nothing.
|-
|8
|uint
|unk7
|Does nothing.
|}
|}
=== 0xe0 - screen_WhiteChange ===
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).
=== 0xde - screen_FlushIn ===
* Portraits.
Changes the color of the screen from a specific state (given by the opcode's parameters, which affect the Touch Screen instantly) to its default state across a certain number of frames. This opcode will affect all entities (i.e., actors, objects, and performers) on the Touch Screen.
* Textboxes.


{| class="wikitable"
{| class="wikitable"
Line 3,843: Line 3,879:
|uint
|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 anything else is true.
|-
|-
|2
|2
|uint
|uint
|duration
|duration
|The number of frames used to change the Touch Screen's brightness.
|The number of frames used to change the Touch Screen's color.
|-
|-
|3
|3
|uint
|uint
|start_brightness
|mode
|The brightness level the opcode will begin at.
|
 
# Completely darkens the Touch Screen.
* The minimum brightness is 0, which results in a white screen.
# Completely turns the Touch Screen to a certain color.
* The default brightness is 256.
# Instantly darkens the Touch Screen?
* The maximum brightness is 512, which results in a black screen.
# Overlays the Touch Screen with a certain color.
# Instantly darkens the Touch Screen?
# Overlays the Touch Screen with hardcoded color bytes: 144, 144, and 255.
# Instantly darkens the Touch Screen?
# Overlays the Touch Screen with hardcoded color bytes: 255, 192, and 128.
# Instantly darkens the Touch Screen?
# Overlays the Touch Screen with hardcoded color bytes: All 255. The Touch Screen is not turned completely white.
# Instantly overlays the Touch Screen with hardcoded color bytes: All 255. The Touch Screen is not turned completely white.
|-
|-
|4
|4
|uint
|uint
|end_brightness
|r
|The brightness level the opcode will end at.
|Unused if ''mode'' is not 2 or 4. Byte used for the color red. Has a minimum of 0 and a maximium of 255.
 
|-
* The minimum brightness is 0, which results in a white screen.
|5
* The default brightness is 256.
|uint
* The maximum brightness is 512, which results in a black screen.
|g
|Unused if ''mode'' is not 2 or 4. Byte used for the color green. Has a minimum of 0 and a maximium of 255.
|-
|6
|uint
|b
|Unused if ''mode'' is not 2 or 4. Byte used for the color blue. Has a minimum of 0 and a maximium of 255.
|}
|}
=== 0xe1 - screen_WhiteChangeAll ===
=== 0xdf - screen_FlushOut ===
Changes the brightness of the screen across a certain number of frames. This opcode will affect everything on the Touch Screen.
Changes the color of the screen across a certain number of frames. This opcode will affect all entities (i.e., actors, objects, and performers) on the Touch Screen.


{| class="wikitable"
{| class="wikitable"
Line 3,887: Line 3,936:
|uint
|uint
|duration
|duration
|The number of frames used to change the Touch Screen's brightness.
|The number of frames used to change the Touch Screen's color.
|-
|-
|3
|3
|uint
|uint
|start_brightness
|mode
|The brightness level the opcode will begin at.
|
 
# Completely darkens the Touch Screen.
* The minimum brightness is 0, which results in a white screen.
# Completely turns the Touch Screen to a certain color.
* The default brightness is 256.
# Instantly darkens the Touch Screen?
* The maximum brightness is 512, which results in a black screen.
# Overlays the Touch Screen with a certain color.
# Instantly darkens the Touch Screen?
# Overlays the Touch Screen with hardcoded color bytes: 144, 144, and 255.
# Instantly darkens the Touch Screen?
# Overlays the Touch Screen with hardcoded color bytes: 255, 192, and 128.
# Instantly darkens the Touch Screen?
# Overlays the Touch Screen with hardcoded color bytes: All 255. The Touch Screen is not turned completely white.
# Instantly overlays the Touch Screen with hardcoded color bytes: All 255. The Touch Screen is not turned completely white.
|-
|-
|4
|4
|uint
|uint
|end_brightness
|r
|The brightness level the opcode will end at.
|Unused if ''mode'' is not 2 or 4. Byte used for the color red. Has a minimum of 0 and a maximium of 255.
|-
|5
|uint
|g
|Unused if ''mode'' is not 2 or 4. Byte used for the color green. Has a minimum of 0 and a maximium of 255.
|-
|6
|uint
|b
|Unused if ''mode'' is not 2 or 4. Byte used for the color blue. Has a minimum of 0 and a maximium of 255.
|}
=== 0xe0 - screen_WhiteChange ===
Changes the brightness of the screen across a certain number of frames. This opcode will not affect:


* The minimum brightness is 0, which results in a white screen.
* Entities who have had their 4th "output" bit set to 1 (e.g., by using <code>SetOutputAttribute(16);</code> with them).
* The default brightness is 256.
* Portraits.
* The maximum brightness is 512, which results in a black screen.
* Textboxes.
|}
=== 0xe2 - screen_WhiteIn ===
Does nothing. Do not be deceived by this opcode's name: After using <code>screen_WhiteOut</code>, use <code>screen_FadeIn</code> to restore the Touch Screen's brightness level!


{| class="wikitable"
{| class="wikitable"
Line 3,920: Line 3,986:
|1
|1
|uint
|uint
|unk0
|suspension_flag
|Does nothing.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and 1 is true.
|-
|-
|2
|2
|uint
|uint
|unk1
|duration
|Does nothing.
|The number of frames used to change the Touch Screen's brightness.
|}
=== 0xe3 - screen_WhiteInAll ===
Does nothing. Do not be deceived by this opcode's name: After using <code>screen_WhiteOutAll</code>, use <code>screen_FadeInAll</code> to restore the Touch Screen's brightness level!
 
{| class="wikitable"
|+Parameters
|-
|-
!#
|3
!Type
!Name
!Description
|-
|1
|uint
|uint
|unk0
|start_brightness
|Does nothing.
|The brightness level the opcode will begin at.
 
* The minimum brightness is 0, which results in a white screen.
* The default brightness is 256.
* The maximum brightness is 512, which results in a black screen.
|-
|-
|2
|4
|uint
|uint
|unk1
|end_brightness
|Does nothing.
|The brightness level the opcode will end at.
 
* The minimum brightness is 0, which results in a white screen.
* The default brightness is 256.
* The maximum brightness is 512, which results in a black screen.
|}
|}
=== 0xe4 - screen_WhiteOut ===
=== 0xe1 - screen_WhiteChangeAll ===
Changes the brightness of the screen to its maximum (i.e., a white screen) across a certain number of frames. This opcode will not affect:
Changes the brightness of the screen across a certain number of frames. This opcode will affect everything on the Touch Screen.
 
* Entities who have had their 4th "output" bit set to 1 (e.g., by using <code>SetOutputAttribute(16);</code> with them).
* Portraits.
* Textboxes.


{| class="wikitable"
{| class="wikitable"
Line 3,973: Line 4,032:
|duration
|duration
|The number of frames used to change the Touch Screen's brightness.
|The number of frames used to change the Touch Screen's brightness.
|}
=== 0xe5 - screen_WhiteOutAll ===
Changes the brightness of the screen to its maximum (i.e., a white screen) across a certain number of frames. This opcode will affect everything on the Touch Screen.
{| class="wikitable"
|+Parameters
|-
|-
!#
|3
!Type
!Name
!Description
|-
|1
|uint
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|-
|2
|uint
|duration
|The number of frames used to change the Touch Screen's brightness.
|}
=== 0xe6 - screen2_FadeChange ===
Changes the brightness of the screen across a certain number of frames. This opcode will affect everything on the Top Screen.
 
{| class="wikitable"
|+Parameters
|-
!#
!Type
!Name
!Description
|-
|1
|uint
|suspension_flag
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and 1 is true.
|-
|2
|uint
|duration
|The number of frames used to change the Top Screen's brightness.
|-
|3
|uint
|uint
|start_brightness
|start_brightness
|The brightness level the opcode will begin at.
|The brightness level the opcode will begin at.


* The minimum brightness is 0, which results in a black screen.
* The minimum brightness is 0, which results in a white screen.
* The default brightness is 256.
* The default brightness is 256.
* The maximum brightness is 512, which results in a white screen.
* The maximum brightness is 512, which results in a black screen.
|-
|-
|4
|4
Line 4,030: Line 4,047:
|The brightness level the opcode will end at.
|The brightness level the opcode will end at.


* The minimum brightness is 0, which results in a black screen.
* The minimum brightness is 0, which results in a white screen.
* The default brightness is 256.
* The default brightness is 256.
* The maximum brightness is 512, which results in a white screen.
* The maximum brightness is 512, which results in a black screen.
|}
|}
=== 0xe7 - screen2_FadeChangeAll ===
=== 0xe2 - screen_WhiteIn ===
Does nothing.
Does nothing. Do not be deceived by this opcode's name: After using <code>screen_WhiteOut</code>, use <code>screen_FadeIn</code> to restore the Touch Screen's brightness level!


{| class="wikitable"
{| class="wikitable"
Line 4,054: Line 4,071:
|unk1
|unk1
|Does nothing.
|Does nothing.
|-
|}
|3
=== 0xe3 - screen_WhiteInAll ===
|uint
Does nothing. Do not be deceived by this opcode's name: After using <code>screen_WhiteOutAll</code>, use <code>screen_FadeInAll</code> to restore the Touch Screen's brightness level!
|unk2
|Does nothing.
|-
|4
|uint
|unk3
|Does nothing.
|}
=== 0xe8 - screen2_FadeIn ===
Changes the brightness of the screen to its default state across a certain number of frames. This opcode will affect everything on the Top Screen.


{| class="wikitable"
{| class="wikitable"
Line 4,078: Line 4,085:
|1
|1
|uint
|uint
|suspension_flag
|unk0
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Does nothing.
|-
|-
|2
|2
|uint
|uint
|duration
|unk1
|The number of frames used to change the Top Screen's brightness.
|Does nothing.
|}
|}
=== 0xe9 - screen2_FadeInAll ===
=== 0xe4 - screen_WhiteOut ===
Does nothing.
Changes the brightness of the screen to its maximum (i.e., a white 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).
* Portraits.
* Textboxes.


{| class="wikitable"
{| class="wikitable"
Line 4,099: Line 4,110:
|1
|1
|uint
|uint
|unk0
|suspension_flag
|Does nothing.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|-
|-
|2
|2
|uint
|uint
|unk1
|duration
|Does nothing.
|The number of frames used to change the Touch Screen's brightness.
|}
|}
=== 0xea - screen2_FadeOut ===
=== 0xe5 - screen_WhiteOutAll ===
Changes the brightness of the screen to its minimum (i.e., a black screen) across a certain number of frames. This opcode will affect everything on the Top Screen.
Changes the brightness of the screen to its maximum (i.e., a white screen) across a certain number of frames. This opcode will affect everything on the Touch Screen.


{| class="wikitable"
{| class="wikitable"
Line 4,126: Line 4,137:
|uint
|uint
|duration
|duration
|The number of frames used to change the Top Screen's brightness.
|The number of frames used to change the Touch Screen's brightness.
|}
|}
=== 0xeb - screen2_FadeOutAll ===
=== 0xe6 - screen2_FadeChange ===
Does nothing.
Changes the brightness of the screen across a certain number of frames. This opcode will affect everything on the Top Screen.


{| class="wikitable"
{| class="wikitable"
Line 4,141: Line 4,152:
|1
|1
|uint
|uint
|unk0
|suspension_flag
|Does nothing.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and 1 is true.
|-
|-
|2
|2
|uint
|uint
|unk1
|duration
|Does nothing.
|The number of frames used to change the Top Screen's brightness.
|-
|3
|uint
|start_brightness
|The brightness level the opcode will begin at.
 
* The minimum brightness is 0, which results in a black screen.
* The default brightness is 256.
* The maximum brightness is 512, which results in a white screen.
|-
|4
|uint
|end_brightness
|The brightness level the opcode will end at.
 
* The minimum brightness is 0, which results in a black screen.
* The default brightness is 256.
* The maximum brightness is 512, which results in a white screen.
|}
|}
=== 0xec - screen2_FlushChange ===
=== 0xe7 - screen2_FadeChangeAll ===
Does nothing.
Does nothing.


Line 4,179: Line 4,208:
|unk3
|unk3
|Does nothing.
|Does nothing.
|}
=== 0xe8 - screen2_FadeIn ===
Changes the brightness of the screen to its default state across a certain number of frames. This opcode will affect everything on the Top Screen.
{| class="wikitable"
|+Parameters
|-
|-
|5
!#
|uint
!Type
|unk4
!Name
|Does nothing.
!Description
|-
|-
|6
|1
|uint
|uint
|unk5
|suspension_flag
|Does nothing.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|-
|-
|7
|2
|uint
|uint
|unk6
|duration
|The number of frames used to change the Top Screen's brightness.
|}
=== 0xe9 - screen2_FadeInAll ===
Does nothing.
 
{| class="wikitable"
|+Parameters
|-
!#
!Type
!Name
!Description
|-
|1
|uint
|unk0
|Does nothing.
|Does nothing.
|-
|-
|8
|2
|uint
|uint
|unk7
|unk1
|Does nothing.
|Does nothing.
|}
|}
=== 0xed - screen2_FlushIn ===
=== 0xea - screen2_FadeOut ===
The same as <code>screen_FlushIn</code>, but for the Top Screen.
Changes the brightness of the screen to its minimum (i.e., a black screen) across a certain number of frames. This opcode will affect everything on the Top Screen.


{| class="wikitable"
{| class="wikitable"
Line 4,219: Line 4,270:
|uint
|uint
|duration
|duration
|The number of frames used to change the Top Screen's color.
|The number of frames used to change the Top Screen's brightness.
|}
=== 0xeb - screen2_FadeOutAll ===
Does nothing.
 
{| class="wikitable"
|+Parameters
|-
!#
!Type
!Name
!Description
|-
|1
|uint
|unk0
|Does nothing.
|-
|-
|3
|2
|uint
|uint
|mode
|unk1
|
|Does nothing.
# Completely darkens the Top Screen.
# Completely turns the Top Screen to a certain color.
# Instantly darkens the Top Screen?
# Overlays the Top Screen with a certain color.
# Instantly darkens the Top Screen?
# Overlays the Top Screen with hardcoded color bytes: 144, 144, and 255.
# Instantly darkens the Top Screen?
# Overlays the Top Screen with hardcoded color bytes: 255, 192, and 128.
# Instantly darkens the Top Screen?
# Overlays the Top Screen with hardcoded color bytes: All 255. The Top Screen is not turned completely white.
# Instantly overlays the Top Screen with hardcoded color bytes: All 255. The Top Screen is not turned completely white.
|-
|4
|uint
|r
|Unused if ''mode'' is not 2 or 4. Byte used for the color red. Has a minimum of 0 and a maximium of 255.
|-
|5
|uint
|g
|Unused if ''mode'' is not 2 or 4. Byte used for the color green. Has a minimum of 0 and a maximium of 255.
|-
|6
|uint
|b
|Unused if ''mode'' is not 2 or 4. Byte used for the color blue. Has a minimum of 0 and a maximium of 255.
|}
|}
=== 0xee - screen2_FlushOut ===
=== 0xec - screen2_FlushChange ===
The same as <code>screen_FlushOut</code>, but for the Top Screen.
Does nothing.


{| class="wikitable"
{| class="wikitable"
Line 4,265: Line 4,306:
|1
|1
|uint
|uint
|suspension_flag
|unk0
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Does nothing.
|-
|-
|2
|2
|uint
|uint
|duration
|unk1
|The number of frames used to change the Top Screen's color.
|Does nothing.
|-
|-
|3
|3
|uint
|uint
|mode
|unk2
|
|Does nothing.
# Completely darkens the Top Screen.
|-
# Completely turns the Top Screen to a certain color.
|4
# Instantly darkens the Top Screen?
|uint
# Overlays the Top Screen with a certain color.
|unk3
# Instantly darkens the Top Screen?
|Does nothing.
# Overlays the Top Screen with hardcoded color bytes: 144, 144, and 255.
|-
# Instantly darkens the Top Screen?
|5
# Overlays the Top Screen with hardcoded color bytes: 255, 192, and 128.
|uint
# Instantly darkens the Top Screen?
|unk4
# Overlays the Top Screen with hardcoded color bytes: All 255. The Top Screen is not turned completely white.
|Does nothing.
# Instantly overlays the Top Screen with hardcoded color bytes: All 255. The Top Screen is not turned completely white.
|-
|-
|4
|6
|uint
|uint
|r
|unk5
|Unused if ''mode'' is not 2 or 4. Byte used for the color red. Has a minimum of 0 and a maximium of 255.
|Does nothing.
|-
|-
|5
|7
|uint
|uint
|g
|unk6
|Unused if ''mode'' is not 2 or 4. Byte used for the color green. Has a minimum of 0 and a maximium of 255.
|Does nothing.
|-
|-
|6
|8
|uint
|uint
|b
|unk7
|Unused if ''mode'' is not 2 or 4. Byte used for the color blue. Has a minimum of 0 and a maximium of 255.
|Does nothing.
|}
|}
=== 0xef - screen2_WhiteChange ===
=== 0xed - screen2_FlushIn ===
Changes the brightness of the screen across a certain number of frames. This opcode will affect everything on the Top Screen.
The same as <code>screen_FlushIn</code>, but for the Top Screen.


{| class="wikitable"
{| class="wikitable"
Line 4,323: Line 4,363:
|uint
|uint
|duration
|duration
|The number of frames used to change the Top Screen's brightness.
|The number of frames used to change the Top Screen's color.
|-
|-
|3
|3
|uint
|uint
|start_brightness
|mode
|The brightness level the opcode will begin at.
|
 
# Completely darkens the Top Screen.
* The minimum brightness is 0, which results in a white screen.
# Completely turns the Top Screen to a certain color.
* The default brightness is 256.
# Instantly darkens the Top Screen?
* The maximum brightness is 512, which results in a black screen.
# Overlays the Top Screen with a certain color.
|-
# Instantly darkens the Top Screen?
# Overlays the Top Screen with hardcoded color bytes: 144, 144, and 255.
# Instantly darkens the Top Screen?
# Overlays the Top Screen with hardcoded color bytes: 255, 192, and 128.
# Instantly darkens the Top Screen?
# Overlays the Top Screen with hardcoded color bytes: All 255. The Top Screen is not turned completely white.
# Instantly overlays the Top Screen with hardcoded color bytes: All 255. The Top Screen is not turned completely white.
|-
|4
|4
|uint
|uint
|end_brightness
|r
|The brightness level the opcode will end at.
|Unused if ''mode'' is not 2 or 4. Byte used for the color red. Has a minimum of 0 and a maximium of 255.
 
|-
* The minimum brightness is 0, which results in a white screen.
|5
* The default brightness is 256.
|uint
* The maximum brightness is 512, which results in a black screen.
|g
|Unused if ''mode'' is not 2 or 4. Byte used for the color green. Has a minimum of 0 and a maximium of 255.
|-
|6
|uint
|b
|Unused if ''mode'' is not 2 or 4. Byte used for the color blue. Has a minimum of 0 and a maximium of 255.
|}
|}
=== 0xf0 - screen2_WhiteChangeAll ===
=== 0xee - screen2_FlushOut ===
Does nothing.
The same as <code>screen_FlushOut</code>, but for the Top Screen.


{| class="wikitable"
{| class="wikitable"
Line 4,356: Line 4,409:
|1
|1
|uint
|uint
|unk0
|suspension_flag
|Does nothing.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|-
|-
|2
|2
|uint
|uint
|unk1
|duration
|Does nothing.
|The number of frames used to change the Top Screen's color.
|-
|-
|3
|3
|uint
|uint
|unk2
|mode
|Does nothing.
|
|-
# Completely darkens the Top Screen.
|4
# Completely turns the Top Screen to a certain color.
|uint
# Instantly darkens the Top Screen?
|unk3
# Overlays the Top Screen with a certain color.
|Does nothing.
# Instantly darkens the Top Screen?
|}
# Overlays the Top Screen with hardcoded color bytes: 144, 144, and 255.
=== 0xf1 - screen2_WhiteIn ===
# Instantly darkens the Top Screen?
Does nothing. Do not be deceived by this opcode's name: After using <code>screen2_WhiteOut</code>, use <code>screen2_FadeIn</code> to restore the Top Screen's brightness level!
# Overlays the Top Screen with hardcoded color bytes: 255, 192, and 128.
 
# Instantly darkens the Top Screen?
{| class="wikitable"
# Overlays the Top Screen with hardcoded color bytes: All 255. The Top Screen is not turned completely white.
|+Parameters
# Instantly overlays the Top Screen with hardcoded color bytes: All 255. The Top Screen is not turned completely white.
|-
|-
!#
|4
!Type
|uint
!Name
|r
!Description
|Unused if ''mode'' is not 2 or 4. Byte used for the color red. Has a minimum of 0 and a maximium of 255.
|-
|-
|1
|5
|uint
|uint
|unk0
|g
|Does nothing.
|Unused if ''mode'' is not 2 or 4. Byte used for the color green. Has a minimum of 0 and a maximium of 255.
|-
|-
|2
|6
|uint
|uint
|unk1
|b
|Does nothing.
|Unused if ''mode'' is not 2 or 4. Byte used for the color blue. Has a minimum of 0 and a maximium of 255.
|}
|}
=== 0xf2 - screen2_WhiteInAll ===
=== 0xef - screen2_WhiteChange ===
Does nothing.
Changes the brightness of the screen across a certain number of frames. This opcode will affect everything on the Top Screen.


{| class="wikitable"
{| class="wikitable"
Line 4,408: Line 4,461:
|1
|1
|uint
|uint
|unk0
|suspension_flag
|Does nothing.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|-
|-
|2
|2
|uint
|uint
|unk1
|duration
|Does nothing.
|The number of frames used to change the Top Screen's brightness.
|}
|-
=== 0xf3 - screen2_WhiteOut ===
|3
Changes the brightness of the screen to its maximum (i.e., a white screen) across a certain number of frames. This opcode will affect everything on the Top Screen.
|uint
|start_brightness
|The brightness level the opcode will begin at.
 
* The minimum brightness is 0, which results in a white screen.
* The default brightness is 256.
* The maximum brightness is 512, which results in a black screen.
|-
|4
|uint
|end_brightness
|The brightness level the opcode will end at.
 
* The minimum brightness is 0, which results in a white screen.
* The default brightness is 256.
* The maximum brightness is 512, which results in a black screen.
|}
=== 0xf0 - screen2_WhiteChangeAll ===
Does nothing.


{| class="wikitable"
{| class="wikitable"
Line 4,429: Line 4,500:
|1
|1
|uint
|uint
|suspension_flag
|unk0
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|Does nothing.
|-
|-
|2
|2
|uint
|uint
|duration
|unk1
|The number of frames used to change the Top Screen's brightness.
|Does nothing.
|-
|3
|uint
|unk2
|Does nothing.
|-
|4
|uint
|unk3
|Does nothing.
|}
|}
=== 0xf4 - screen2_WhiteOutAll ===
=== 0xf1 - screen2_WhiteIn ===
Does nothing.
Does nothing. Do not be deceived by this opcode's name: After using <code>screen2_WhiteOut</code>, use <code>screen2_FadeIn</code> to restore the Top Screen's brightness level!


{| class="wikitable"
{| class="wikitable"
Line 4,458: Line 4,539:
|Does nothing.
|Does nothing.
|}
|}
=== 0xf5 - se_ChangePan ===
=== 0xf2 - screen2_WhiteInAll ===
Changes the panning of the currently-playing [[sound effect]] across a certain number of frames.
Does nothing.


{| class="wikitable"
{| class="wikitable"
Line 4,471: Line 4,552:
|1
|1
|uint
|uint
|se_id
|unk0
|A sound effect defined in SOUND/SE of the ROM. Actually encoded as <code>sound_bank_id << 8 + sound_id</code>, but it can also be represented as an integer.
|Does nothing.
|-
|-
|2
|2
|uint
|uint
|duration
|unk1
|The number of frames used to change the SE's panning.
|Does nothing.
|-
|3
|uint
|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.
What this means is that:
 
* 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.
 
More research on this parameter may be needed.
|}
|}
=== 0xf6 - se_ChangeVolume ===
=== 0xf3 - screen2_WhiteOut ===
Changes the volume of the currently-playing [[sound effect]] across a certain number of frames.
Changes the brightness of the screen to its maximum (i.e., a white screen) across a certain number of frames. This opcode will affect everything on the Top Screen.


{| class="wikitable"
{| class="wikitable"
Line 4,503: Line 4,573:
|1
|1
|uint
|uint
|se_id
|suspension_flag
|A sound effect defined in SOUND/SE of the ROM. Actually encoded as <code>sound_bank_id << 8 + sound_id</code>, but it can also be represented as an integer.
|Determines whether the script will suspend until this opcode's operation is complete. 0 is false and anything else is true.
|-
|-
|2
|2
|uint
|uint
|duration
|duration
|The number of frames used to change the SE's volume.
|The number of frames used to change the Top Screen's brightness.
|-
|3
|uint
|volume
|The volume that the SE will play at. It has a maximum of 256 and a minimum of 0.
|}
|}
=== 0xf7 - se_FadeOut ===
=== 0xf4 - screen2_WhiteOutAll ===
Fades out the currently-playing [[sound effect]] across a certain number of frames.
Does nothing.


{| class="wikitable"
{| class="wikitable"
Line 4,529: Line 4,594:
|1
|1
|uint
|uint
|se_id
|unk0
|A sound effect defined in SOUND/SE of the ROM. Actually encoded as <code>sound_bank_id << 8 + sound_id</code>, but it can also be represented as an integer.
|Does nothing.
|-
|-
|2
|2
|uint
|uint
|duration
|unk1
|The number of frames used to fade out and silence a given SE.
|Does nothing.
|}
|}
=== 0xf8 - se_Play ===
=== 0xf5 - se_ChangePan ===
Instantly plays a [[sound effect]].
Changes the panning of the currently-playing [[sound effect]] across a certain number of frames.


{| class="wikitable"
{| class="wikitable"
Line 4,552: Line 4,617:
|se_id
|se_id
|A sound effect defined in SOUND/SE of the ROM. Actually encoded as <code>sound_bank_id << 8 + sound_id</code>, but it can also be represented as an integer.
|A sound effect defined in SOUND/SE of the ROM. Actually encoded as <code>sound_bank_id << 8 + sound_id</code>, but it can also be represented as an integer.
|}
=== 0xf9 - se_PlayFull ===
Instantly plays a [[sound effect]] at a specified volume and panning.
{| class="wikitable"
|+Parameters
|-
|-
!#
|2
!Type
!Name
!Description
|-
|1
|uint
|uint
|se_id
|duration
|A sound effect defined in SOUND/SE of the ROM. Actually encoded as <code>sound_bank_id << 8 + sound_id</code>, but it can also be represented as an integer.
|The number of frames used to change the SE's panning.
|-
|2
|uint
|volume
|The volume that the SE will play at. It has a maximum of 256 and a minimum of 0.
|-
|-
|3
|3
|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 ===
=== 0xf6 - se_ChangeVolume ===
Instantly plays a [[sound effect]] at a specified panning.
Changes the volume of the currently-playing [[sound effect]] across a certain number of frames.


{| class="wikitable"
{| class="wikitable"
Line 4,603: Line 4,652:
|2
|2
|uint
|uint
|pan
|duration
|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 number of frames used to change the SE's volume.
What this means is that:
|-
 
|3
* A ''pan'' parameter of 260 will result in sound panning only to the right channel.
|uint
* A ''pan'' parameter of 261 will result in sound panning only to the left channel.
|volume
 
|The volume that the SE will play at. It has a maximum of 256 and a minimum of 0.
More research on this parameter may be needed.
|}
|}
=== 0xfb - se_PlayVolume ===
=== 0xf7 - se_FadeOut ===
Instantly plays a [[sound effect]] at a specified volume.
Fades out the currently-playing [[sound effect]] across a certain number of frames.


{| class="wikitable"
{| class="wikitable"
Line 4,630: Line 4,678:
|2
|2
|uint
|uint
|volume
|duration
|The volume that the SE will play at. It has a maximum of 256 and a minimum of 0.
|The number of frames used to fade out and silence a given SE.
|}
|}
=== 0xfc - se_Stop ===
=== 0xf8 - se_Play ===
Instantly stops a specified sound effect.
Instantly plays a [[sound effect]].


{| class="wikitable"
{| class="wikitable"
Line 4,649: Line 4,697:
|A sound effect defined in SOUND/SE of the ROM. Actually encoded as <code>sound_bank_id << 8 + sound_id</code>, but it can also be represented as an integer.
|A sound effect defined in SOUND/SE of the ROM. Actually encoded as <code>sound_bank_id << 8 + sound_id</code>, but it can also be represented as an integer.
|}
|}
=== 0xfd - SetAnimation ===
=== 0xf9 - se_PlayFull ===
Plays a sprite's animation, optionally changing its speed and animation flags.
Instantly plays a [[sound effect]] at a specified volume and panning.


{| class="wikitable"
{| class="wikitable"
Line 4,662: Line 4,710:
|1
|1
|uint
|uint
|id
|se_id
|Animation table index. Converted to an [[Animation ID]] for the current sprite using the [https://docs.google.com/spreadsheets/d/11xHv80Def5mtF60ZsfI1lF1eNX0dBE2It837Q08AlRk/htmlview SetAnimation table].
|A sound effect defined in SOUND/SE of the ROM. Actually encoded as <code>sound_bank_id << 8 + sound_id</code>, but it can also be represented as an integer.
|-
|2
|uint
|volume
|The volume that the SE will play at. It has a maximum of 256 and a minimum of 0.
|-
|3
|uint
|pan
|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:
 
* 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.
|}
|}
=== 0xfe - SetAttribute ===
=== 0xfa - se_PlayPan ===
Does nothing.
Instantly plays a [[sound effect]] at a specified panning.


{| class="wikitable"
{| class="wikitable"
Line 4,678: Line 4,742:
|1
|1
|uint
|uint
|unk0
|se_id
|Does nothing.
|A sound effect defined in SOUND/SE of the ROM. Actually encoded as <code>sound_bank_id << 8 + sound_id</code>, but it can also be represented as an integer.
|-
|2
|uint
|pan
|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:
 
* 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.
|}
|}
=== 0xff - SetBlink ===
=== 0xfb - se_PlayVolume ===
Sets a specific entity (i.e., an actor, object, or performer) to continuously flicker in and out of view at a certain interval.
Instantly plays a [[sound effect]] at a specified volume.
 
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,696: Line 4,769:
|1
|1
|uint
|uint
|visible_interval
|se_id
|The number of frames to wait for while the entity is visible.  
|A sound effect defined in SOUND/SE of the ROM. Actually encoded as <code>sound_bank_id << 8 + sound_id</code>, but it can also be represented as an integer.
|-
|-
|2
|2
|uint
|uint
|invisible_interval
|volume
|The number of frames to wait for while the entity is invisible.  
|The volume that the SE will play at. It has a maximum of 256 and a minimum of 0.
|}
|}
=== 0x100 - SetDirection ===
=== 0xfc - se_Stop ===
Instantly sets a specific entity (i.e., an actor, object, or performer) to a specified direction.
Instantly stops a specified sound effect.
 
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,718: Line 4,789:
|-
|-
|1
|1
|Direction
|uint
|direction
|se_id
|The type of direction, the list of which can be seen by typing <code>DIR_</code> in SkyTemple's Script Engine Debugger.
|A sound effect defined in SOUND/SE of the ROM. Actually encoded as <code>sound_bank_id << 8 + sound_id</code>, but it can also be represented as an integer.
|}
|}
=== 0x101 - SetDirectionLives ===
=== 0xfd - SetAnimation ===
<TO DO: Opcode description>
Plays a sprite's animation, optionally changing its speed and animation flags.


{| class="wikitable"
{| class="wikitable"
Line 4,735: Line 4,806:
|1
|1
|uint
|uint
|unk0
|id
|
|Animation table index. Converted to an [[Animation ID]] for the current sprite using the [https://docs.google.com/spreadsheets/d/11xHv80Def5mtF60ZsfI1lF1eNX0dBE2It837Q08AlRk/htmlview SetAnimation table].
|-
|2
|uint
|unk1
|
|}
|}
=== 0x102 - SetEffect ===
=== 0xfe - SetAttribute ===
Plays back an [[List of Effect Animations|effect animation]] assigned to an actor or performer.
Does nothing.


{| class="wikitable"
{| class="wikitable"
Line 4,755: Line 4,821:
|-
|-
|1
|1
|Effect
|effect_id
|The ID of a given effect.
|-
|2
|uint
|uint
|position_marker_id?
|unk0
|Set to one of the following character sprite offsets:
|Does nothing.
0: Head<br>1: Right Hand<br>2: Left Hand<br>3: Center<br>4: No offset (bottom of sprite)
|}
|}
=== 0xff - SetBlink ===
Sets a specific entity (i.e., an actor, object, or performer) to continuously flicker in and out of view at a certain interval.


=== 0x103 - SetFunctionAttribute ===
This opcode does not have a parameter for an entity, as it must be used in a with-statement or a targeted routine.
<TO DO: Opcode description>


{| class="wikitable"
{| class="wikitable"
Line 4,778: Line 4,839:
|-
|-
|1
|1
|bitfield
|uint
|unk0
|visible_interval
|
|The number of frames to wait for while the entity is visible.
|}
|-
=== 0x104 - SetHeight ===
|2
Moves an actor "vertically" by distancing it from its shadow.  
|uint
|invisible_interval
|The number of frames to wait for while the entity is invisible.
|}
=== 0x100 - SetDirection ===
Instantly sets a specific entity (i.e., an actor, object, or performer) 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 4,794: Line 4,862:
|-
|-
|1
|1
|uint
|Direction
|unk0
|direction
|number of pixels to move up or down by.
|The type of direction, the list of which can be seen by typing <code>DIR_</code> in SkyTemple's Script Engine Debugger.
|}
|}
=== 0x105 - SetHitAttribute ===
=== 0x101 - SetDirectionLives ===
<TO DO: Opcode description>
<TO DO: Opcode description>


Line 4,810: Line 4,878:
|-
|-
|1
|1
|bitfield
|uint
|unk0
|unk0
|
|-
|2
|uint
|unk1
|
|
|}
|}
=== 0x106 - SetMoveRange ===
=== 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,826: Line 4,899:
|-
|-
|1
|1
|PositionMark
|Effect
|pos_marker
|effect_id
|
|The ID of a given effect.
|-
|-
|5
|2
|uint
|uint
|unk4
|position_marker_id?
|
|Set to one of the following character sprite offsets:
|-
# <li value="0">Head</li>
|6
# Right Hand
|uint
# Left Hand
|unk5
# Center
|
# No offset (bottom of sprite)
|}
|}
=== 0x107 - SetOutputAttribute ===
 
Sets certain bits of an entity's (i.e., an actor, object, or performer) "output" attribute to 1.
=== 0x103 - SetFunctionAttribute ===
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"
|+Parameters
|+Parameters
Line 4,848: Line 4,923:
!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
|bitfield
|Must be OFF for an actor to follow. Potentially signals leader?
|output_bitfield
|-
|
|1
# Underlay below entities.
|0b000010
# Overlay above entities.
|2
# Overlay above the current Map Background's Layer 2.
|Must be ON for an actor to follow. Potentially signals follower?
# 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.
|2
# Transparency.
|0b000100
# Invisibility.
|4
# Displays shadow.
|Unknown.
|}
|-
=== 0x108 - SetPosition ===
|3
<TO DO: Opcode description>
|0b001000
 
|8
{| class="wikitable"
|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?
|+Parameters
|-
|-
|4
!#
|0b010000
!Type
|16
!Name
|Unknown.
!Description
|-
|-
|5
|1
|0b100000
|uint
|32
|x
|Related to follower status and shadow. If a follower has it enabled, output 8 will be enabled.
|
|}
|-
=== 0x104 - SetHeight ===
|2
Moves an actor "vertically" by distancing it from its shadow.
|uint
 
|y
{| class="wikitable"
|
|+Parameters
|}
|-
=== 0x109 - SetPositionInitial ===
!#
<TO DO: Opcode description>
!Type
 
!Name
No parameters.
!Description
=== 0x10a - SetPositionLives ===
|-
<TO DO: Opcode description>
|1
 
|uint
{| class="wikitable"
|unk0
|+Parameters
|number of pixels to move up or down by.
|-
|}
!#
=== 0x105 - SetHitAttribute ===
!Type
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!
!Name
 
!Description
{| class="wikitable"
|-
|+Parameters
|1
|-
|uint
!#
|unk0
!Type
|
!Name
|}
!Index
=== 0x10b - SetPositionMark ===
! colspan="2" |Bit value
<TO DO: Opcode description>
!Description
 
|-
{| class="wikitable"
| rowspan="5" |1
|+Parameters
| rowspan="5" |bitfield
|-
| rowspan="5" |hit_bitfield
!#
|0
!Type
|0b00001
!Name
|1
!Description
|Must be enabled for the entity to interact with layer 1 of map collision.
|-
|-
|1
|0b00010
|2
|Must be enabled for the entity to interact with layer 2 of map collision.
|-
|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).
|}
=== 0x106 - SetMoveRange ===
<TO DO: Opcode description>
 
{| class="wikitable"
|+Parameters
|-
!#
!Type
!Name
!Description
|-
|1
|PositionMark
|pos_marker
|
|-
|5
|uint
|unk4
|
|-
|6
|uint
|unk5
|
|}
=== 0x107 - SetOutputAttribute ===
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"
|+Parameters
|-
!#
!Type
!Name
!Id
! colspan="2" |Bit value
!Description
|-
| rowspan="16" |1
| rowspan="16" |bitfield
| rowspan="16" |output_bitfield
|0
|0b0000000000000001
|1
|Unknown.
|-
|1
|0b0000000000000010
|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 ===
<TO DO: Opcode description>
 
{| class="wikitable"
|+Parameters
|-
!#
!Type
!Name
!Description
|-
|1
|uint
|x
|
|-
|2
|uint
|y
|
|}
=== 0x109 - SetPositionInitial ===
<TO DO: Opcode description>
 
No parameters.
=== 0x10a - SetPositionLives ===
<TO DO: Opcode description>
 
{| class="wikitable"
|+Parameters
|-
!#
!Type
!Name
!Description
|-
|1
|uint
|unk0
|
|}
=== 0x10b - SetPositionMark ===
<TO DO: Opcode description>
 
{| class="wikitable"
|+Parameters
|-
!#
!Type
!Name
!Description
|-
|1
|1
|PositionMark
|PositionMark
Line 4,963: Line 5,238:
|}
|}
=== 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,971: Line 5,245:
!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
|bitfield
|0b00010
|unk0
|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 5,587: Line 5,886:
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.
Line 5,648: Line 5,949:
|uint
|uint
|script_sector
|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.
|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?
|}
|}


Line 5,675: Line 5,976:
|uint
|uint
|script_sector
|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.
|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?
|}
|}


Line 5,912: Line 6,213:


=== 0x13a - supervision_SpecialActing ===
=== 0x13a - supervision_SpecialActing ===
It performs various hardcoded functionalities, mostly fancy graphical things like the Waterfall Cave flood, the beach bubbles, SE1 spotlight, etc
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,925: Line 6,226:
|uint
|uint
|unk0
|unk0
|
|Performs the following effect/function:
# <li value="3">Exclusively used when scenes end. Related to screen fadeouts/whiteouts? <TODO: Details?></li>
# Bubble stream (only used in base game by the Krabby in V01P04B scenes) <TODO: Details?>
# Bubble stream 2 (only used in base game by the Krabby in V01P05B scenes) <TODO: Details?>
# Unsure; only used in scene <code>m26a0606</code> (beach bubble or light effect related) <TODO: Details>
# Waterfall Cave flood. <TODO: Details?>
# <li value="10">"Glass shards" effect used when Primal Dialga stops Celebi in scene <code>m19b1008</code>. <TODO: Details?></li>
# <li value="13">"Boss battle starts" wipe. <TODO: Details?></li>
# Crystal effect used while Azelf blocks off the Crystal Lake in scene <code>m15b0908</code>. <TODO: Details?>
# <li value="16">Unsure; used by <code>V00P03/m01a01a</code>, a debug Waterfall Cave geyser script. <TODO: Details></li>
# "Frozen time zone expands to left" electric effect used in scene <code>m14a0802</code> (Underground Lake). <TODO: Details?>
# "Frozen time zone expands to right" electric effect used in scene <code>m14a0803</code>. <TODO: Details?>
# Unsure; used by the Luminous Spring <code>evolve</code> script. <TODO: Details>
# Unsure; one of the effects in scene <code>m24a0204</code> (finding Hidden Land scene). <TODO: Details>
# Floating Beach bubbles. <TODO: Details?>
# <li value="23">Unsure; effect related to the staff credits scene. <TODO: Details></li>
# Related to special Team Charm "Boss battle starts" wipe (heart effect). <TODO: Details>
# Related to special Team Charm "Boss battle starts" wipe (heart effect). <TODO: Details>
# Related to special Team Charm "Boss battle starts" wipe (heart effect). <TODO: Details>
# <li value="27">Allocating memory for the spotlight (see <code>n01a0101</code>, the SE1 intro scene); MUST USE ONCE WHEN CREATING A SPOTLIGHT</li>
# Sets the center of the spotlight at X and Y coordinates (in pixels)
# SIZE parameter is the size of the spotlight. Third parameter seems unused.
# FRAMES parameter is the amount of frames it will take for the spotlight to close. Third parameter seems unused.
# FRAMES parameter is the amount of frames it will take for the spotlight to open. Third parameter seems unused.
# Frees up the memory; MUST USE ONCE WHEN ENDING A SPOTLIGHT!
# <li value="34">Unsure; used solely alongside <code>back_SetWeather(11);</code> (purple smog) in Sky Peak Summit cutscenes, but the smog seems functional without this. <TODO: Details></li>
|-
|-
|2
|2
|uint
|uint
|unk1
|unk1
|
|Function is dependent on parameter 1.
|-
|-
|3
|3
|uint
|uint
|unk2
|unk2
|
|Function is dependent on parameter 1.
|}
|}
=== 0x13b - supervision_Station ===
=== 0x13b - supervision_Station ===
Loads a sector of the Sub scene.
Loads a sector of the Sub scene.
Line 5,990: Line 6,317:
|}
|}
=== 0x13e - supervision2_SpecialActing ===
=== 0x13e - supervision2_SpecialActing ===
<TO DO: Opcode description>
Appears to perform similar functions as <code>[[#0x13a - supervision_SpecialActing|supervision_SpecialActing]]</code>, specifically for the Top Screen.
 
<TO DO: Details>


{| class="wikitable"
{| class="wikitable"
Line 6,356: Line 6,685:
=== 0x15d - WaitBgmSignal ===
=== 0x15d - WaitBgmSignal ===
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.
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.
Line 6,781: Line 7,112:


== 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 7,080: Line 7,411:
|}
|}
=== 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 7,091: Line 7,422:
|-
|-
|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
|uint
|uint
|jump_address
|jump_address
|
|Address to jump to if the comparison meets the condition.
|}
|}
=== 0x34 - BranchValue ===
=== 0x34 - BranchValue ===
Line 7,761: Line 8,103:
Same as _SwitchMonologue, but typically uses <code>$PARTNER_TALK_KIND</code> as an argument, and the cases used vary.
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:
Of the game's partner options:


<code>case 1:</code> used if Squirtle, Tododile, Chimchar, Meowth, or Munchlax
<code>case 1:</code> used if male Squirtle, Totodile, Chimchar, Meowth, or Munchlax


<code>case 2:</code> used for all other male partners
<code>case 2:</code> default (all other male partners in vanilla)


<code>case 3:</code> used for all female partners
<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
<code>default:</code> used when <code>$PARTNER_TALK_KIND</code>'s Talk Group has a value other than 1, 2, or 3
Line 7,786: Line 8,128:
|<code>$x_TALK_KIND</code>, contains Talk Group number
|<code>$x_TALK_KIND</code>, contains Talk Group number
|}
|}
=== 0xc9 - object ===
=== 0xc9 - object ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Line 7,987: Line 8,330:
|}
|}
=== 0x149 - SwitchSector ===
=== 0x149 - SwitchSector ===
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, i.e., 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.
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 simpluy represented as <code>switch(sector())</code>.
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>