List of Opcodes: Difference between revisions

Adex (talk | contribs)
m StopAnimation documentation
Happylappy (talk | contribs)
Expanded and re-organized [Re]Set[.*?]Attribute documentation.
Line 3,376: Line 3,376:
|}
|}
=== 0xd0 - ResetFunctionAttribute ===
=== 0xd0 - ResetFunctionAttribute ===
Sets certain bits of an entity's (i.e., an actor, object, or performer) "function" attribute to 0.
Enables bits that change properties of entities, namely how they follow other actors and how their talk script can be triggered. Is only intended to disable bits 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,384:
!Type
!Type
!Name
!Name
!Index
! colspan="2" |Bit value
!Description
!Description
|-
|-
| rowspan="6" |1
| rowspan="6" |bitfield
| rowspan="6" |function_bitfield
|0
|0b000001
|1
|1
|bitfield
|Must be OFF for an actor to follow. Potentially signals leader?
|function_bitfield
|-
|Most bits' purposes are unknown. Bit 1 appears to be the bit used for allowing an entity to follow a Type 1 actor, like the actor ACTOR_ATTENDANT1 in the overworld.
|1
|0b000010
|2
|Must be ON for an actor to follow. Potentially signals follower?
|-
|2
|0b000100
|4
|Unknown.
|-
|3
|0b001000
|8
|Unknown.
|-
|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. Is only intended to enable bits 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,430:
!Type
!Type
!Name
!Name
!Index
! colspan="2" |Bit value
!Description
!Description
|-
|-
| rowspan="5" |1
| rowspan="5" |bitfield
| rowspan="5" |hit_bitfield
|0
|0b00001
|1
|1
|bitfield
|Must be enabled for the entity to interact with layer 1 of map collision.
|hit_bitfield
|-
|Most bits' purposes are unknown.
|1
 
|0b00010
* 2: Entity collision.
|2
* 6: Talk Script upon collision.
|Must be enabled for the entity to interact with layer 2 of map collision.
* 7: Talk Script upon pressing the A Button near the entity.
|-
|2
|0b00100
|4
|Must be enabled for actor collisions to be recognized (GetCollidingActorID).
|-
|3
|0b01000
|8
|Must be enabled for object collisions to be recognized (GetCollidingObjectID).
|-
|4
|0b10000
|16
|Must be enabled for event (trigger) collisions to be recognized (GetCollidingEventID).
|}
|}
=== 0xd2 - ResetOutputAttribute ===
=== 0xd2 - ResetOutputAttribute ===
Sets certain bits of an entity's (i.e., an actor, object, or performer) "output" attribute to 0.
Resets certain bits of an entity's (i.e., an actor, object, or performer) "output" attribute to 1. Is only intended to enable bits 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,471:
!Type
!Type
!Name
!Name
!Id
! colspan="2" |Bit value
!Description
!Description
|-
|-
| rowspan="16" |1
| rowspan="16" |bitfield
| rowspan="16" |output_bitfield
|0
|0b0000000000000001
|1
|1
|bitfield
|Unknown.
|output_bitfield
|-
|
|1
# Underlay below entities.
|0b0000000000000010
# Overlay above entities.
|2
# Overlay above the current Map Background's Layer 2.
|Underlay below entities.
# 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.
|0b0000000000000100
# Invisibility.
|4
# Displays shadow.
|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 ===
=== 0xd3 - ResetReplyAttribute ===
Sets certain bits of an entity's (i.e., an actor, object, or performer) "reply" attribute to 0.
Resets bits that change properties of entities, namely how their talk script is triggered. Is only intended to enable bits 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,444: Line 3,566:
!Type
!Type
!Name
!Name
!Index
! colspan="2" |Bit value
!Description
!Description
|-
|-
| rowspan="5" |1
| rowspan="5" |bitfield
| rowspan="5" |reply_bitfield
|0
|0b00001
|1
|1
|bitfield
|Unknown.
|reply_bitfield
|-
|Most bits' purposes are unknown.
|1
 
|0b00010
* 1: Talk Script upon collision.
|2
* 2: Talk Script upon pressing the A Button near the entity.
|If enabled, plays talk script if colliding with entity.
* 6: Underlay below entities.
|-
* 7: Overlay above entities.
|2
|0b00100
|4
|If enabled, plays talk script when pressing A near the entity.
|-
|3
|0b01000
|8
|Unknown.
|-
|4
|0b10000
|16
|Unknown.
|}
|}
=== 0xd4 - ResumeEffect ===
=== 0xd4 - ResumeEffect ===
Line 4,771: Line 4,913:


=== 0x103 - SetFunctionAttribute ===
=== 0x103 - SetFunctionAttribute ===
<TO DO: Opcode description>
Enables bits that change properties of entities, namely how they follow other actors and how their talk script can be triggered. Is only intended to enable bits on the range [0,5], but larger values seem to affect other bitfields. Skytemple accepts binary inputs for params, it is recommended you use them for this opcode!


{| class="wikitable"
{| class="wikitable"
Line 4,779: Line 4,921:
!Type
!Type
!Name
!Name
!Index
! colspan="2" |Bit value
!Description
!Description
|-
|-
| rowspan="6" |1
| rowspan="6" |bitfield
| rowspan="6" |func_bitfield
|0
|0b000001
|1
|1
|bitfield
|Must be OFF for an actor to follow. Potentially signals leader?
|unk0
|-
|
|1
|0b000010
|2
|Must be ON for an actor to follow. Potentially signals follower?
|-
|2
|0b000100
|4
|Unknown.
|-
|3
|0b001000
|8
|Unknown.
|-
|4
|0b010000
|16
|Unknown.
|-
|5
|0b100000
|32
|Related to follower status and shadow. If a follower has it enabled, output 8 will be enabled.
|}
|}
=== 0x104 - SetHeight ===
=== 0x104 - SetHeight ===
Line 4,803: Line 4,975:
|}
|}
=== 0x105 - SetHitAttribute ===
=== 0x105 - SetHitAttribute ===
<TO DO: Opcode description>
Sets bits that change properties of entities, namely how their collision works. Is only intended to enable bits on the range [6,10], but larger values seem to affect other bitfields. Skytemple accepts binary inputs for params, it is recommended you use them for this opcode!


{| class="wikitable"
{| class="wikitable"
Line 4,811: Line 4,983:
!Type
!Type
!Name
!Name
!Index
! colspan="2" |Bit value
!Description
!Description
|-
| rowspan="5" |1
| rowspan="5" |bitfield
| rowspan="5" |hit_bitfield
|0
|0b00001
|1
|Must be enabled for the entity to interact with layer 1 of map collision.
|-
|-
|1
|1
|bitfield
|0b00010
|unk0
|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 ===
=== 0x106 - SetMoveRange ===
Line 4,845: Line 5,042:
|}
|}
=== 0x107 - SetOutputAttribute ===
=== 0x107 - SetOutputAttribute ===
Sets certain bits of an entity's (i.e., an actor, object, or performer) "output" attribute to 1.
Sets certain bits of an entity's (i.e., an actor, object, or performer) "output" attribute to 1. Is only intended to enable bits on the range [16,31]. Skytemple accepts binary inputs for params, it is recommended you use them for this opcode!
{| class="wikitable"
{| class="wikitable"
|+Parameters
|+Parameters
Line 4,852: Line 5,049:
!Type
!Type
!Name
!Name
!Id
! colspan="2" |Bit value
!Description
!Description
|-
|-
| rowspan="16" |1
| rowspan="16" |bitfield
| rowspan="16" |output_bitfield
|0
|0b0000000000000001
|1
|1
|bitfield
|Unknown.
|output_bitfield
|-
|
|1
# Underlay below entities.
|0b0000000000000010
# Overlay above entities.
|2
# Overlay above the current Map Background's Layer 2.
|Underlay below entities.
# 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.
|0b0000000000000100
# Invisibility.
|4
# Displays shadow.
|Overlay above entities.
|}
|-
=== 0x108 - SetPosition ===
|3
<TO DO: Opcode description>
|0b0000000000001000
 
|8
{| class="wikitable"
|Overlay above the current Map Background's Layer 2.
|+Parameters
|-
|-
|4
!#
|0b0000000000010000
!Type
|16
!Name
|Overlay above the game's canvas system, including textbox, portrait, and some screen_ commands not ending in <code>All</code>.
!Description
|-
|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
|1
Line 4,967: Line 5,236:
|}
|}
=== 0x10e - SetReplyAttribute ===
=== 0x10e - SetReplyAttribute ===
<TO DO: Opcode description>
Sets bits that change properties of entities, namely how their talk script is triggered. Is only intended to enable bits 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,975: Line 5,243:
!Type
!Type
!Name
!Name
!Index
! colspan="2" |Bit value
!Description
!Description
|-
|-
| rowspan="5" |1
| rowspan="5" |bitfield
| rowspan="5" |reply_bitfield
|0
|0b00001
|1
|1
|bitfield
|Unknown.
|unk0
|-
|
|1
|0b00010
|2
|If enabled, plays talk script if colliding with entity.
|-
|2
|0b00100
|4
|If enabled, plays talk script when pressing A near the entity.
|-
|3
|0b01000
|8
|Unknown.
|-
|4
|0b10000
|16
|Unknown.
|}
|}
=== 0x10f - SetupOutputAttributeAndAnimation ===
=== 0x10f - SetupOutputAttributeAndAnimation ===