List of Opcodes: Difference between revisions

Adex (talk | contribs)
m StopAnimation documentation
 
(21 intermediate revisions by 5 users not shown)
Line 382: Line 382:
|}
|}
=== 0xf - back_SetWeatherEffect ===
=== 0xf - back_SetWeatherEffect ===
Currently unknown. The only values this opcode accepts seems to be 1, 2, and 3. Its only known use is in V00P02/m01a04a.ssb, which is a test script used by the developers.
Currently unknown. The only values this opcode accepts seems to be 1, 2, and 3. Value 3 was previously used in S02P01A/m00a01a.ssb in Time/Darkness, for its iteration of the personality test. In Sky, its only use is in V00P02/m01a04a.ssb, which is a leftover test script used by the developers to test the visuals of the Time/Darkness iteration of the aura test.


{| class="wikitable"
{| class="wikitable"
Line 397: Line 397:
|Currently unknown.
|Currently unknown.
|}
|}
=== 0x10 - back_SetWeatherScrollOffset ===
=== 0x10 - back_SetWeatherScrollOffset ===
Currently unknown. This opcode is not used in the base game.
Currently unknown. This opcode is not used in the base game.
Line 1,835: Line 1,836:
|2
|2
|uint
|uint
|table
|table_ID
|Some unknown item tables related to Spinda's Cafe.
|Some item tables related to Spinda's Cafe.
|}
|}
The table IDs themselves are as follows. Values above 15 are currently unknown and untested.
{| class="wikitable"
!#
!Description
!#
!Description
|-
|0
|Sky Gift Item Pool
|8
|Silver Ticket Win Pool
|-
|1
|Numel "Give" Item Pool
|9
|Silver Ticket Big Win Pool
|-
|2
|Numel "Recieve" Item Pool
|10
|Gold Ticket Loss Pool
|-
|3
|Happiny Lost Item Pool
|11
|Gold Ticket Win Pool
|-
|4
|Prize Ticket Loss Pool
|12
|Gold Ticket Big Win Pool
|-
|5
|Prize Ticket Win Pool
|13
|Prism Ticket Loss Pool
|-
|6
|Prize Ticket Big Win Pool
|14
|Prism Ticket Win Pool
|-
|7
|Silver Ticket Loss Pool
|15
|Prism Ticket Big Win Pool
|}
=== 0x86 - item_SetVariable ===
=== 0x86 - item_SetVariable ===
Saves the value of a script variable to an item slot. Items in slot 0 may also be added to the player's bag and storage with hardcoded menus, such as <code>message_Menu(MENU_GIVE_ITEM);</code> and <code>message_Menu(MENU_GIVE_ITEM2);</code>, respectively. Additionally, the text tag <code>[s_item:X]</code> will display the item's name, where X is the item slot number.
Saves the value of a script variable to an item slot. Items in slot 0 may also be added to the player's bag and storage with hardcoded menus, such as <code>message_Menu(MENU_GIVE_ITEM);</code> and <code>message_Menu(MENU_GIVE_ITEM2);</code>, respectively. Additionally, the text tag <code>[s_item:X]</code> will display the item's name, where X is the item slot number.
Line 4,695: Line 4,744:
|}
|}
=== 0x102 - SetEffect ===
=== 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,708: Line 4,757:
|Effect
|Effect
|effect_id
|effect_id
|
|The ID of a given effect.
|-
|-
|2
|2
|uint
|uint
|position_marker_id?
|position_marker_id?
|
|Set to one of the following character sprite offsets:
# <li value="0">Head</li>
# Right Hand
# Left Hand
# Center
# No offset (bottom of sprite)
|}
|}
=== 0x103 - SetFunctionAttribute ===
=== 0x103 - SetFunctionAttribute ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Line 4,790: Line 4,845:
|}
|}
=== 0x107 - SetOutputAttribute ===
=== 0x107 - SetOutputAttribute ===
<TO DO: Opcode description>
Sets certain bits of an entity's (i.e., an actor, object, or performer) "output" attribute to 1.
 
{| class="wikitable"
{| class="wikitable"
|+Parameters
|+Parameters
Line 4,802: Line 4,856:
|1
|1
|bitfield
|bitfield
|unk0
|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.
|}
|}
=== 0x108 - SetPosition ===
=== 0x108 - SetPosition ===
Line 5,045: Line 5,107:


=== 0x114 - Slide2PositionOffset ===
=== 0x114 - Slide2PositionOffset ===
<TO DO: Opcode description>
Offsets an entity (i.e., an actor, object, or performer) from its current position across both axes without restricting the angles used. The entity does not change the direction that it faces.
 
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 5,070: Line 5,134:
|}
|}
=== 0x115 - Slide2PositionOffset ===
=== 0x115 - Slide2PositionOffset ===
<TO DO: Opcode description>
Offsets an entity (i.e., an actor, object, or performer) from its current position across both axes without restricting the angles used. The entity does not change the direction that it faces.
 
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 5,083: Line 5,149:
|uint
|uint
|speed
|speed
|
|Movement speed. Higher values result in a faster speed. Values starting at 32770 or above will be slower than a value of 1.
|-
|-
|2
|2
|sint
|sint
|x
|x
|
|How much the entity is offset in the x direction.
|-
|-
|3
|3
|sint
|sint
|y
|y
|
|How much the entity is offset in the y direction.
|}
|}
=== 0x116 - Slide2PositionOffsetRandom ===
=== 0x116 - Slide2PositionOffsetRandom ===
Line 5,525: Line 5,591:
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,576: Line 5,644:
|Level
|Level
|level
|level
|
|Map LEVEL the script should be located in.
|-
|-
|2
|2
|ConstString
|ConstString
|script_id
|script_id
|
|Name of the script itself, only the first 8 characters are read.
|-
|-
|3
|3
|uint
|uint
|unk2
|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. Sector ids above a certain threshold do not function. Perhaps 100, or 127?
|}
|}


=== 0x12d - supervision_ExecuteActingSub ===
=== 0x12d - supervision_ExecuteActingSub ===
Loads a specified Acting script from the specified level from within Unionall
Loads a specified Acting script from the specified level from within Unionall.


{| class="wikitable"
{| class="wikitable"
Line 5,603: Line 5,671:
|Level
|Level
|level
|level
|
|Map LEVEL the script should be located in.
|-
|-
|2
|2
|ConstString
|ConstString
|script_id
|script_id
|
|Name of the script itself, only the first 8 characters are read.
|-
|-
|3
|3
|uint
|uint
|unk2
|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. Note: Sector ids above a certain threshold do not function. Perhaps 100, or 127?
|}
|}


Line 5,850: Line 5,918:


=== 0x13a - supervision_SpecialActing ===
=== 0x13a - supervision_SpecialActing ===
<TO DO: Opcode description>
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 6,294: 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,549: Line 6,619:


=== 0x174 - worldmap_ChangeLevel ===
=== 0x174 - worldmap_ChangeLevel ===
<TO DO: Opcode description>
Causes the clouds parting animation on the world map, presumably hardcoded by vanilla use-case.


{| class="wikitable"
{| class="wikitable"
Line 6,561: Line 6,631:
|1
|1
|uint
|uint
|unk0
|world_map_level
|
|Level to transition the world map state to.
|}
|}
=== 0x175 - worldmap_DeleteArrow ===
=== 0x175 - worldmap_DeleteArrow ===
Line 6,583: Line 6,653:
|uint
|uint
|world_map_marker_id
|world_map_marker_id
|
|The world map id to move the camera to.
|}
|}


Line 6,609: Line 6,679:


=== 0x179 - worldmap_SetCamera ===
=== 0x179 - worldmap_SetCamera ===
<TO DO: Opcode description>
Centers the world map camera on a specific world map marker.


{| class="wikitable"
{| class="wikitable"
Line 6,621: Line 6,691:
|1
|1
|uint
|uint
|unk0
|world_map_marker_id
|
|The world map id to set the camera to.
|}
|}
=== 0x17a - worldmap_SetLevel ===
=== 0x17a - worldmap_SetLevel ===
<TO DO: Opcode description>
Sets the current world map state. Additionally updates $WORLD_MAP_LEVEL


{| class="wikitable"
{| class="wikitable"
Line 6,637: Line 6,707:
|1
|1
|uint
|uint
|unk0
|world_map_level
|
|Level to assign the world map state to.
|}
|}
=== 0x17b - worldmap_SetMark ===
=== 0x17b - worldmap_SetMark ===
<TO DO: Opcode description>
Enables a yellow dot for the specified world map marker.


{| class="wikitable"
{| class="wikitable"
Line 6,653: Line 6,723:
|1
|1
|uint
|uint
|unk0
|world_map_marker_id
|
|The world map id to enable the yellow dot for.
|}
|}
=== 0x17c - worldmap_SetMessage ===
=== 0x17c - worldmap_SetMessage ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Seemingly unused in vanilla.


{| class="wikitable"
{| class="wikitable"
Line 6,690: Line 6,762:


=== 0x17e - worldmap_SetMode ===
=== 0x17e - worldmap_SetMode ===
<TO DO: Opcode description>
Sets the "mode" of the world map, to align with a particular purpose.
 
Mode 1 seems to be for handling travel to a dungeon or area.
 
Mode 2 is only used by debug scripts.
 
Mode 3 is for handling moving clouds.
 
Mode 4 is for cutscene use, or for showing where things are on a map.
 
All other modes are unused.


{| class="wikitable"
{| class="wikitable"
Line 6,702: Line 6,784:
|1
|1
|uint
|uint
|unk0
|world_map_mode
|
|
|}
|}


== 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,006: Line 7,088:
|}
|}
=== 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,017: Line 7,099:
|-
|-
|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,099: Line 7,192:
|}
|}
=== 0x36 - BranchVariation ===
=== 0x36 - BranchVariation ===
<TO DO: Opcode description>
Used for demo cutscenes.
 
Jumps to the specified address if the first parameter is 0. On the demo version of the game, jumps if the first parameter is 3.


{| class="wikitable"
{| class="wikitable"
Line 7,112: Line 7,207:
|uint
|uint
|param
|param
|
|Unknown. Always 3.
|-
|-
|2
|2
|uint
|uint
|jump_address
|jump_address
|
|Address to jump to.
|}
|}
=== 0x37 - Call ===
=== 0x37 - Call ===
Line 7,911: Line 8,006:
|}
|}
=== 0x149 - SwitchSector ===
=== 0x149 - SwitchSector ===
<TO DO: Opcode description>
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>.


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>