List of Opcodes: Difference between revisions
m BranchSum operator description + SetEffect list tweak |
|||
| (16 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 === | ||
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 | ||
| | |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. | |||
|} | |} | ||
=== 0xd1 - ResetHitAttribute === | === 0xd1 - ResetHitAttribute === | ||
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 | ||
| | |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). | |||
|} | |} | ||
=== 0xd2 - ResetOutputAttribute === | === 0xd2 - ResetOutputAttribute === | ||
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 | ||
| | |Unknown. | ||
|- | |- | ||
|1 | |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. | ||
|} | |} | ||
=== | === 0xd3 - ResetReplyAttribute === | ||
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! | |||
{| 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 | ||
| | |Unknown. | ||
|- | |- | ||
|1 | |1 | ||
| | |0b00010 | ||
| | |2 | ||
| | |If enabled, plays talk script if colliding with entity. | ||
|- | |- | ||
|2 | |2 | ||
| | |0b00100 | ||
| | |4 | ||
| | |If enabled, plays talk script when pressing A near the entity. | ||
|- | |- | ||
|3 | |3 | ||
| | |0b01000 | ||
| | |8 | ||
| | |Unknown. | ||
|- | |- | ||
|4 | |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" | {| class="wikitable" | ||
| Line 3,552: | Line 3,614: | ||
|- | |- | ||
|1 | |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" | {| class="wikitable" | ||
| Line 3,596: | Line 3,638: | ||
|1 | |1 | ||
|uint | |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 | 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 | |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. | ||
| | |- | ||
|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. | ||
|} | |||
=== 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. | |||
|} | |} | ||
=== | === 0xd9 - screen_FadeIn === | ||
Changes the brightness of the screen to its | 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. | ||
|} | |} | ||
=== | === 0xda - screen_FadeInAll === | ||
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 | ||
| | |suspension_flag | ||
| | |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 | ||
| | |The number of frames used to change the Touch Screen's brightness. | ||
|} | |} | ||
=== 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: | |||
* 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,740: | Line 3,792: | ||
|uint | |uint | ||
|duration | |duration | ||
|The number of frames used to change the Touch Screen's | |The number of frames used to change the Touch Screen's brightness. | ||
|} | |} | ||
=== | === 0xdc - screen_FadeOutAll === | ||
Changes the | 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 | |The number of frames used to change the Touch Screen's brightness. | ||
|} | |||
=== 0xdd - screen_FlushChange === | |||
Does nothing. | |||
{| class="wikitable" | |||
|+Parameters | |||
!# | |||
!Type | |||
!Name | |||
!Description | |||
|- | |- | ||
| | |1 | ||
|uint | |uint | ||
| | |unk0 | ||
| | |Does nothing. | ||
|- | |||
|2 | |||
|uint | |||
|unk1 | |||
|Does nothing. | |||
|- | |||
|3 | |||
|uint | |||
|unk2 | |||
|Does nothing. | |||
|- | |- | ||
|4 | |4 | ||
|uint | |uint | ||
| | |unk3 | ||
| | |Does nothing. | ||
|- | |- | ||
|5 | |5 | ||
|uint | |uint | ||
| | |unk4 | ||
| | |Does nothing. | ||
|- | |- | ||
|6 | |6 | ||
|uint | |uint | ||
| | |unk5 | ||
| | |Does nothing. | ||
|- | |||
|7 | |||
|uint | |||
|unk6 | |||
|Does nothing. | |||
|- | |||
|8 | |||
|uint | |||
|unk7 | |||
|Does nothing. | |||
|} | |} | ||
=== 0xde - screen_FlushIn === | |||
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. | |||
{| 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 | |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 | |The number of frames used to change the Touch Screen's color. | ||
|- | |- | ||
|3 | |3 | ||
|uint | |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 | |4 | ||
|uint | |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 === | ||
Changes the | 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 | |The number of frames used to change the Touch Screen's color. | ||
|- | |- | ||
|3 | |3 | ||
|uint | |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 | |4 | ||
|uint | |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. | |||
|} | |||
=== 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). | ||
* Portraits. | |||
* Textboxes. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 3,920: | Line 3,986: | ||
|1 | |1 | ||
|uint | |uint | ||
| | |suspension_flag | ||
| | |Determines whether the script will suspend until this opcode's operation is complete. 0 is false and 1 is true. | ||
|- | |- | ||
|2 | |2 | ||
|uint | |uint | ||
| | |duration | ||
| | |The number of frames used to change the Touch Screen's brightness. | ||
|- | |- | ||
|3 | |||
| | |||
|uint | |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 | |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. | |||
|} | |} | ||
=== | === 0xe1 - screen_WhiteChangeAll === | ||
Changes the brightness of the screen | 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,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. | ||
|- | |- | ||
|3 | |||
|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 | * 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 | * 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 | * 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 | * The maximum brightness is 512, which results in a black screen. | ||
|} | |} | ||
=== | === 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. | ||
|} | |||
=== 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" | {| class="wikitable" | ||
| Line 4,078: | Line 4,085: | ||
|1 | |1 | ||
|uint | |uint | ||
| | |unk0 | ||
| | |Does nothing. | ||
|- | |- | ||
|2 | |2 | ||
|uint | |uint | ||
| | |unk1 | ||
| | |Does nothing. | ||
|} | |} | ||
=== | === 0xe4 - screen_WhiteOut === | ||
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 | ||
| | |suspension_flag | ||
| | |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 | ||
| | |The number of frames used to change the Touch Screen's brightness. | ||
|} | |} | ||
=== | === 0xe5 - screen_WhiteOutAll === | ||
Changes the brightness of the screen to its | 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 | |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" | {| class="wikitable" | ||
| Line 4,141: | Line 4,152: | ||
|1 | |1 | ||
|uint | |uint | ||
| | |suspension_flag | ||
| | |Determines whether the script will suspend until this opcode's operation is complete. 0 is false and 1 is true. | ||
|- | |- | ||
|2 | |2 | ||
|uint | |uint | ||
| | |duration | ||
| | |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. | |||
|} | |} | ||
=== | === 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 | |||
|- | |- | ||
!# | |||
!Type | |||
!Name | |||
!Description | |||
|- | |- | ||
| | |1 | ||
|uint | |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 | |uint | ||
| | |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. | ||
|- | |- | ||
| | |2 | ||
|uint | |uint | ||
| | |unk1 | ||
|Does nothing. | |Does nothing. | ||
|} | |} | ||
=== | === 0xea - screen2_FadeOut === | ||
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 | |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. | |||
|- | |- | ||
| | |2 | ||
|uint | |uint | ||
| | |unk1 | ||
| | |Does nothing. | ||
|} | |} | ||
=== | === 0xec - screen2_FlushChange === | ||
Does nothing. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 4,265: | Line 4,306: | ||
|1 | |1 | ||
|uint | |uint | ||
| | |unk0 | ||
| | |Does nothing. | ||
|- | |- | ||
|2 | |2 | ||
|uint | |uint | ||
| | |unk1 | ||
| | |Does nothing. | ||
|- | |- | ||
|3 | |3 | ||
|uint | |uint | ||
| | |unk2 | ||
| | |Does nothing. | ||
|- | |||
|4 | |||
|uint | |||
|unk3 | |||
|Does nothing. | |||
|- | |||
|5 | |||
|uint | |||
|unk4 | |||
|Does nothing. | |||
|- | |- | ||
| | |6 | ||
|uint | |uint | ||
| | |unk5 | ||
| | |Does nothing. | ||
|- | |- | ||
| | |7 | ||
|uint | |uint | ||
| | |unk6 | ||
| | |Does nothing. | ||
|- | |- | ||
| | |8 | ||
|uint | |uint | ||
| | |unk7 | ||
| | |Does nothing. | ||
|} | |} | ||
=== | === 0xed - screen2_FlushIn === | ||
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 | |The number of frames used to change the Top Screen's color. | ||
|- | |- | ||
|3 | |3 | ||
|uint | |uint | ||
| | |mode | ||
| | | | ||
# 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 | |4 | ||
|uint | |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 === | ||
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 | ||
| | |suspension_flag | ||
| | |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 | ||
| | |The number of frames used to change the Top Screen's color. | ||
|- | |- | ||
|3 | |3 | ||
|uint | |uint | ||
| | |mode | ||
| | | | ||
# 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 | |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 | |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. | ||
|} | |} | ||
=== | === 0xef - screen2_WhiteChange === | ||
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 | ||
| | |suspension_flag | ||
| | |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 | ||
| | |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 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 | ||
| | |unk0 | ||
| | |Does nothing. | ||
|- | |- | ||
|2 | |2 | ||
|uint | |uint | ||
| | |unk1 | ||
| | |Does nothing. | ||
|- | |||
|3 | |||
|uint | |||
|unk2 | |||
|Does nothing. | |||
|- | |||
|4 | |||
|uint | |||
|unk3 | |||
|Does nothing. | |||
|} | |} | ||
=== | === 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. | ||
|} | |} | ||
=== | === 0xf2 - screen2_WhiteInAll === | ||
Does nothing. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 4,471: | Line 4,552: | ||
|1 | |1 | ||
|uint | |uint | ||
| | |unk0 | ||
| | |Does nothing. | ||
|- | |- | ||
|2 | |2 | ||
|uint | |uint | ||
| | |unk1 | ||
| | |Does nothing. | ||
|} | |} | ||
=== | === 0xf3 - screen2_WhiteOut === | ||
Changes the | 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 | ||
| | |suspension_flag | ||
| | |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 | |The number of frames used to change the Top Screen's brightness. | ||
|} | |} | ||
=== | === 0xf4 - screen2_WhiteOutAll === | ||
Does nothing. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 4,529: | Line 4,594: | ||
|1 | |1 | ||
|uint | |uint | ||
| | |unk0 | ||
| | |Does nothing. | ||
|- | |- | ||
|2 | |2 | ||
|uint | |uint | ||
| | |unk1 | ||
| | |Does nothing. | ||
|} | |} | ||
=== | === 0xf5 - se_ChangePan === | ||
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. | ||
|- | |- | ||
|2 | |||
| | |||
|uint | |uint | ||
| | |duration | ||
| | |The number of frames used to change the SE's panning. | ||
|- | |- | ||
|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. | ||
|} | |} | ||
=== | === 0xf6 - se_ChangeVolume === | ||
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 | ||
| | |duration | ||
|The | |The number of frames used to change the SE's volume. | ||
|- | |||
|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 === | ||
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 | ||
| | |duration | ||
|The | |The number of frames used to fade out and silence a given SE. | ||
|} | |} | ||
=== | === 0xf8 - se_Play === | ||
Instantly | 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. | ||
|} | |} | ||
=== | === 0xf9 - se_PlayFull === | ||
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 | ||
| | |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. | ||
|- | |||
|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. | |||
|} | |} | ||
=== | === 0xfa - se_PlayPan === | ||
Instantly plays a [[sound effect]] at a specified panning. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 4,678: | Line 4,742: | ||
|1 | |1 | ||
|uint | |uint | ||
| | |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. | ||
|- | |||
|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. | |||
|} | |} | ||
=== | === 0xfb - se_PlayVolume === | ||
Instantly plays a [[sound effect]] at a specified volume. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 4,696: | Line 4,769: | ||
|1 | |1 | ||
|uint | |uint | ||
| | |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. | ||
|- | |- | ||
|2 | |2 | ||
|uint | |uint | ||
| | |volume | ||
|The | |The volume that the SE will play at. It has a maximum of 256 and a minimum of 0. | ||
|} | |} | ||
=== | === 0xfc - se_Stop === | ||
Instantly | Instantly stops a specified sound effect. | ||
{| class="wikitable" | {| class="wikitable" | ||
| Line 4,718: | Line 4,789: | ||
|- | |- | ||
|1 | |1 | ||
| | |uint | ||
| | |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. | ||
|} | |} | ||
=== | === 0xfd - SetAnimation === | ||
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 | ||
| | |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]. | |||
| | |||
|} | |} | ||
=== | === 0xfe - SetAttribute === | ||
Does nothing. | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 4,755: | Line 4,821: | ||
|- | |- | ||
|1 | |1 | ||
|uint | |uint | ||
| | |unk0 | ||
| | |Does nothing. | ||
|} | |} | ||
=== 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. | |||
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,782: | Line 4,839: | ||
|- | |- | ||
|1 | |1 | ||
| | |uint | ||
| | |visible_interval | ||
| | |The number of frames to wait for while the entity is visible. | ||
|- | |- | ||
|2 | |||
| | |||
|uint | |uint | ||
| | |invisible_interval | ||
|number of | |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,814: | Line 4,862: | ||
|- | |- | ||
|1 | |1 | ||
| | |Direction | ||
| | |direction | ||
| | |The type of direction, the list of which can be seen by typing <code>DIR_</code> in SkyTemple's Script Engine Debugger. | ||
|} | |} | ||
=== | === 0x101 - SetDirectionLives === | ||
<TO DO: Opcode description> | <TO DO: Opcode description> | ||
| Line 4,830: | Line 4,878: | ||
|- | |- | ||
|1 | |1 | ||
|uint | |uint | ||
| | |unk0 | ||
| | | | ||
|- | |- | ||
| | |2 | ||
|uint | |uint | ||
| | |unk1 | ||
| | | | ||
|} | |} | ||
=== | === 0x102 - SetEffect === | ||
Plays back an [[List of Effect Animations|effect animation]] assigned to an actor or performer. | |||
{| class="wikitable" | {| class="wikitable" | ||
|+Parameters | |+Parameters | ||
| Line 4,855: | Line 4,899: | ||
|- | |- | ||
|1 | |1 | ||
|bitfield | |Effect | ||
|output_bitfield | |effect_id | ||
| | |The ID of a given effect. | ||
|- | |||
|2 | |||
|uint | |||
|position_marker_id? | |||
|Set to one of the following character sprite offsets: | |||
# <li value="0">Head</li> | |||
# Right Hand | |||
# Left Hand | |||
|} | # Center | ||
=== 0x108 - SetPosition === | # No offset (bottom of sprite) | ||
|} | |||
=== 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" | |||
|+Parameters | |||
|- | |||
!# | |||
!Type | |||
!Name | |||
!Index | |||
! colspan="2" |Bit value | |||
!Description | |||
|- | |||
| rowspan="6" |1 | |||
| rowspan="6" |bitfield | |||
| rowspan="6" |func_bitfield | |||
|0 | |||
|0b000001 | |||
|1 | |||
|Must be OFF for an actor to follow. Potentially signals leader? | |||
|- | |||
|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 === | |||
Moves an actor "vertically" by distancing it from its shadow. | |||
{| class="wikitable" | |||
|+Parameters | |||
|- | |||
!# | |||
!Type | |||
!Name | |||
!Description | |||
|- | |||
|1 | |||
|uint | |||
|unk0 | |||
|number of pixels to move up or down by. | |||
|} | |||
=== 0x105 - SetHitAttribute === | |||
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" | |||
|+Parameters | |||
|- | |||
!# | |||
!Type | |||
!Name | |||
!Index | |||
! colspan="2" |Bit value | |||
!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 | |||
|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 | |||
|PositionMark | |||
|pos_marker | |||
| | |||
|} | |||
=== 0x10c - SetPositionOffset === | |||
<TO DO: Opcode description> | <TO DO: Opcode description> | ||
| Line 4,879: | Line 5,207: | ||
|- | |- | ||
|1 | |1 | ||
| | |sint | ||
|x | |x | ||
| | | | ||
|- | |- | ||
|2 | |2 | ||
| | |sint | ||
|y | |y | ||
| | | | ||
|} | |} | ||
=== | === 0x10d - SetPositionOffsetRandom === | ||
<TO DO: Opcode description> | <TO DO: Opcode description> | ||
| Line 4,945: | Line 5,237: | ||
| | | | ||
|} | |} | ||
=== | === 0x10e - SetReplyAttribute === | ||
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,954: | 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 | |1 | ||
| | |Unknown. | ||
| | |- | ||
| | |1 | ||
|0b00010 | |||
|2 | |||
|If enabled, plays talk script if colliding with entity. | |||
|- | |- | ||
|2 | |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,591: | Line 5,886: | ||
No parameters. | No parameters. | ||
=== 0x129 - StopAnimation === | === 0x129 - StopAnimation === | ||
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,652: | 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,679: | 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,916: | 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,929: | 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,994: | Line 6,317: | ||
|} | |} | ||
=== 0x13e - supervision2_SpecialActing === | === 0x13e - supervision2_SpecialActing === | ||
<TO DO: | 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,360: | 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,785: | 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,776: | 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 | Of the game's partner options: | ||
<code>case 1:</code> used if Squirtle, | <code>case 1:</code> used if male Squirtle, Totodile, Chimchar, Meowth, or Munchlax | ||
<code>case 2:</code> | <code>case 2:</code> default (all other male partners in vanilla) | ||
<code>case 3:</code> used | <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,801: | 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 8,007: | Line 8,335: | ||
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> | ||