List of Opcodes: Difference between revisions
m oops minor spelling mistake |
m StopAnimation documentation |
||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 4,763: | Line 4,763: | ||
|position_marker_id? | |position_marker_id? | ||
|Set to one of the following character sprite offsets: | |Set to one of the following character sprite offsets: | ||
0 | # <li value="0">Head</li> | ||
# Right Hand | |||
# Left Hand | |||
# Center | |||
# No offset (bottom of sprite) | |||
|} | |} | ||
| Line 5,587: | Line 5,591: | ||
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,648: | Line 5,654: | ||
|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,681: | ||
|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 6,356: | Line 6,362: | ||
=== 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 6,789: | ||
== 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,088: | ||
|} | |} | ||
=== 0x33 - BranchSum === | === 0x33 - BranchSum === | ||
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,099: | ||
|- | |- | ||
|1 | |1 | ||
| | |GameVar | ||
| | |var | ||
| | |One of the 115 possible script variables. Specifically, an indexed variable is expected. | ||
|- | |- | ||
|2 | |2 | ||
|uint | |uint | ||
| | |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 | ||
| | |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,987: | Line 8,006: | ||
|} | |} | ||
=== 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, | Returns the currently-loaded "sector" for a given routine. When used in targeted routines, this returns the sector the entity is loaded on. When used in the main routine, this returns a value passed in to load the scene, e.g., the final parameter of <code>supervision_ExecuteActingSub</code>. Most often used in Enter scenes to mark a Cutscene -> Overworld transition, but can also be checked within Acting scenes. | ||
In ExplorerScript, this can be simply represented as <code>switch(sector())</code>. | 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> | ||