List of Opcodes: Difference between revisions
Happylappy (talk | contribs) Expanded and re-organized [Re]Set[.*?]Attribute documentation. |
|||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 3,376: | Line 3,376: | ||
|} | |} | ||
=== 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. 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! | 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,409: | Line 3,409: | ||
|0b001000 | |0b001000 | ||
|8 | |8 | ||
|Unknown. | |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 | |4 | ||
| Line 3,422: | Line 3,422: | ||
|} | |} | ||
=== 0xd1 - ResetHitAttribute === | === 0xd1 - ResetHitAttribute === | ||
Resets bits that change properties of entities, namely how their collision works. Is only intended to | 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,463: | Line 3,463: | ||
|} | |} | ||
=== 0xd2 - ResetOutputAttribute === | === 0xd2 - ResetOutputAttribute === | ||
Resets certain bits of an entity's (i.e., an actor, object, or performer) "output" attribute to | 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,559: | Line 3,559: | ||
|} | |} | ||
=== 0xd3 - ResetReplyAttribute === | === 0xd3 - ResetReplyAttribute === | ||
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! | 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 4,624: | Line 4,624: | ||
|uint | |uint | ||
|pan | |pan | ||
|The panning of the SE. This parameter gets recalculated internally as <code>((''pan'' * 0x3f + ((''pan'' * 0x3f >> 7) >> 0x18)) >> 8) + 0x40</code>, which is eventually split up into two halfwords, then recalculated further into a signed byte. | |The panning of the SE. Has an intended range of -260 (left) to 260 (right), with 0 being the center. | ||
This parameter gets recalculated internally as <code>((''pan'' * 0x3f + ((''pan'' * 0x3f >> 7) >> 0x18)) >> 8) + 0x40</code>, which is eventually split up into two halfwords, then recalculated further into a signed byte. | |||
What this means is that: | What this means is that: | ||
* A ''pan'' parameter of 260 will result in sound panning only to the right channel. | * A ''pan'' parameter of 260 will result in sound panning only to the right channel. | ||
* A ''pan'' parameter of 261 will result in sound panning only to the left channel. | * A ''pan'' parameter of 261 will result in sound panning only to the left channel. | ||
|} | |} | ||
=== 0xf6 - se_ChangeVolume === | === 0xf6 - se_ChangeVolume === | ||
| Line 4,719: | Line 4,719: | ||
|uint | |uint | ||
|pan | |pan | ||
|The panning of the SE. This parameter gets recalculated internally as <code>((''pan'' * 0x3f + ((''pan'' * 0x3f >> 7) >> 0x18)) >> 8) + 0x40</code>, which is eventually split up into two halfwords, then recalculated further into a signed byte. | |The panning of the SE. Has an intended range of -260 (left) to 260 (right), with 0 being the center. | ||
This parameter gets recalculated internally as <code>((''pan'' * 0x3f + ((''pan'' * 0x3f >> 7) >> 0x18)) >> 8) + 0x40</code>, which is eventually split up into two halfwords, then recalculated further into a signed byte. | |||
What this means is that: | What this means is that: | ||
* A ''pan'' parameter of 260 will result in sound panning only to the right channel. | * A ''pan'' parameter of 260 will result in sound panning only to the right channel. | ||
* A ''pan'' parameter of 261 will result in sound panning only to the left channel. | * A ''pan'' parameter of 261 will result in sound panning only to the left channel. | ||
|} | |} | ||
=== 0xfa - se_PlayPan === | === 0xfa - se_PlayPan === | ||
| Line 4,746: | Line 4,746: | ||
|uint | |uint | ||
|pan | |pan | ||
|The panning of the SE. This parameter gets recalculated internally as <code>((''pan'' * 0x3f + ((''pan'' * 0x3f >> 7) >> 0x18)) >> 8) + 0x40</code>, which is eventually split up into two halfwords, then recalculated further into a signed byte. | |The panning of the SE. Has an intended range of -260 (left) to 260 (right), with 0 being the center. | ||
This parameter gets recalculated internally as <code>((''pan'' * 0x3f + ((''pan'' * 0x3f >> 7) >> 0x18)) >> 8) + 0x40</code>, which is eventually split up into two halfwords, then recalculated further into a signed byte. | |||
What this means is that: | What this means is that: | ||
* A ''pan'' parameter of 260 will result in sound panning only to the right channel. | * A ''pan'' parameter of 260 will result in sound panning only to the right channel. | ||
* A ''pan'' parameter of 261 will result in sound panning only to the left channel. | * A ''pan'' parameter of 261 will result in sound panning only to the left channel. | ||
|} | |} | ||
=== 0xfb - se_PlayVolume === | === 0xfb - se_PlayVolume === | ||
| Line 4,913: | Line 4,913: | ||
=== 0x103 - SetFunctionAttribute === | === 0x103 - SetFunctionAttribute === | ||
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! | Enables bits that change properties of entities, namely how they follow other actors and how their talk script can be triggered, to 1. Is only intended to enable bits of a shared "attribute" bitfield on the range [0,5], but larger values seem to affect other bitfields. Skytemple accepts binary inputs for params, it is recommended you use them for this opcode! | ||
{| class="wikitable" | {| class="wikitable" | ||
| Line 4,946: | Line 4,946: | ||
|0b001000 | |0b001000 | ||
|8 | |8 | ||
|Unknown. | |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 | |4 | ||
| Line 4,975: | Line 4,975: | ||
|} | |} | ||
=== 0x105 - SetHitAttribute === | === 0x105 - SetHitAttribute === | ||
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! | Sets bits that change properties of entities, namely how their collision works, to 1. Is only intended to enable bits of a shared "attribute" bitfield on the range [6,10], but larger values seem to affect other bitfields. Skytemple accepts binary inputs for params, it is recommended you use them for this opcode! | ||
{| class="wikitable" | {| class="wikitable" | ||
| Line 5,042: | 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. 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! | Sets certain bits of an entity's (i.e., an actor, object, or performer) "output" attribute to 1. Is only intended to enable bits of a shared "attribute" bitfield on the range [16,31]. Skytemple accepts binary inputs for params, it is recommended you use them for this opcode! | ||
{| class="wikitable" | {| class="wikitable" | ||
|+Parameters | |+Parameters | ||
| Line 5,236: | Line 5,236: | ||
|} | |} | ||
=== 0x10e - SetReplyAttribute === | === 0x10e - SetReplyAttribute === | ||
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! | 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 8,073: | Line 8,073: | ||
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 8,098: | Line 8,098: | ||
|<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> | ||