List of Opcodes: Difference between revisions

Adex (talk | contribs)
m A bit more opcodes, up to 0x81
Adex (talk | contribs)
m A bit more opcodes, up to 0x8E
Line 133: Line 133:
|2
|2
|uint
|uint
|unk0
|unk1
|Currently unknown.
|Currently unknown.
|}
|}
Line 154: Line 154:
|2
|2
|uint
|uint
|unk0
|unk1
|Currently unknown. Typically, the game uses 0 for this parameter, but it seems to have no effect.
|Currently unknown. Typically, the game uses 0 for this parameter, but it seems to have no effect.
|-
|-
Line 226: Line 226:
|2
|2
|uint
|uint
|unk0
|unk1
|Currently unknown. Does not seem to affect much.
|Currently unknown. Does not seem to affect much.
|}
|}
Line 1,538: Line 1,538:
|1
|1
|uint
|uint
|behavior
|mode
|Values of 0 or 3+ mean the camera will not shake.
|Values of 0 or 3+ mean the camera will not shake.


Line 1,730: Line 1,730:
|2
|2
|uint
|uint
|unk0
|unk1
|Unknown.
|Unknown.
|}
|}
=== 0x81 - Flash ===
=== 0x81 - Flash ===
Does nothing. This opcode is not used in the base game.
Currently unknown; it does not seem to affect much. This opcode is not used in the base game.


No parameters.
No parameters.
=== 0x83 - item_GetVariable ===
=== 0x83 - item_GetVariable ===
<TO DO: Opcode description>
Saves the value in a specific item slot (set by <code>item_Set</code>) to a script variable.


{| class="wikitable"
{| class="wikitable"
Line 1,751: Line 1,751:
|uint
|uint
|slot
|slot
|
|An item slot used by many <code>item_</code> opcodes.
|-
|-
|2
|2
|GameVar
|GameVar
|var
|var
|
|One of the 115 possible script variables.
|}
|}
=== 0x84 - item_Set ===
=== 0x84 - item_Set ===
<TO DO: Opcode description>
Sets an item into an item slot, which can be used by other various <code>item_</code> opcodes.
 
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.


{| class="wikitable"
{| class="wikitable"
Line 1,771: Line 1,773:
|1
|1
|uint
|uint
|unk0
|slot
|
|An item slot used by many <code>item_</code> opcodes.
|-
|-
|2
|2
|uint
|uint
|item_id
|item_id
|
|The ID of the item, where all are listed in the Items tab of SkyTemple.
|-
|-
|3
|3
|uint
|uint
|unk2
|item_stack
|
|The stack count of an item, if it belongs to a Thrown category. Treasure Boxes will also use this as the item earned when opening the box at Xatu's Appraisal.
|}
|}
=== 0x85 - item_SetTableData ===
=== 0x85 - item_SetTableData ===
<TO DO: Opcode description>
Sets a random item from predefined tables into an item slot, which can be used by other various <code>item_</code> opcodes. This opcode is used mainly in Spinda's Cafe, for redeeming a random Recycle Shop prize and for receiving items from Treasure Town NPCs after giving them Sky Gifts.
 
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.


{| class="wikitable"
{| class="wikitable"
Line 1,797: Line 1,801:
|1
|1
|uint
|uint
|unk0
|slot
|
|An item slot used by many <code>item_</code> opcodes.
|-
|-
|2
|2
|uint
|uint
|unk1
|table
|
|Some unknown item tables related to Spinda's Cafe.
|}
|}
=== 0x86 - item_SetVariable ===
=== 0x86 - item_SetVariable ===
<TO DO: Opcode description>
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.


{| class="wikitable"
{| class="wikitable"
Line 1,818: Line 1,822:
|1
|1
|uint
|uint
|unk0
|slot
|
|An item slot used by many <code>item_</code> opcodes.
|-
|-
|2
|2
|GameVar
|GameVar
|var
|var
|
|One of the 115 possible script variables.
|}
|}
=== 0x88 - JumpCommon ===
=== 0x88 - JumpCommon ===
<TO DO: Opcode description>
Jumps to the specified Unionall Coroutine and runs its code, without returning to the line in which this opcode was first used. This opcode can be used in any script, no matter the type (Common, Enter, Acting, or Sub), but is mostly used by the base game in Unionall.
 
If attempting to execute a Unionall Coroutine from inside an Enter, Acting, or Sub script to play Acting scripts, use <code>supervision_ExecuteCommon</code> instead.


{| class="wikitable"
{| class="wikitable"
Line 1,838: Line 1,844:
|-
|-
|1
|1
|Routine
|Coroutine
|coro_id
|coro_id
|
|One of the 701 possible Unionall Coroutines.
|}
|}
=== 0x8a - LoadPosition ===
=== 0x8a - LoadPosition ===
<TO DO: Opcode description>
Sets various attributes of an entity (i.e., an actor, object, or performer) to the values of all indexed <code>$POSITION_</code> script variables. These include changing the entity's X and Y coordinates, height, and 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 1,855: Line 1,863:
|1
|1
|uint
|uint
|unk0
|index
|
|Index used by all <code>$POSITION_</code> script variables, ranged from 0-2 (inclusive).
|}
|}
=== 0x8b - Lock ===
=== 0x8b - Lock ===
Line 1,875: Line 1,883:
|}
|}
=== 0x8c - main_EnterAdventure ===
=== 0x8c - main_EnterAdventure ===
<TO DO: Opcode description>
Performs various functions related to entering a dungeon using the crossroads menu.


{| class="wikitable"
{| class="wikitable"
Line 1,886: Line 1,894:
|-
|-
|1
|1
|uint
|sint
|unk0
|mode
|
|Most modes are not known, but 32767 opens the crossroads menu, and 251 stops the current script to reload Unionall starting from the Coroutine CORO_MOVE_WORLD_MAP.
|-
|-
|2
|2
|uint
|uint
|unk1
|unk1
|
|Currently unknown.
|}
|}
=== 0x8d - main_EnterDungeon ===
=== 0x8d - main_EnterDungeon ===
<TO DO: Opcode description>
Exits ground mode and begins dungeon mode at a specific dungeon.


{| class="wikitable"
{| class="wikitable"
Line 1,909: Line 1,917:
|sint
|sint
|dungeon_id
|dungeon_id
|
|The dungeon ID to enter, which are all listed in the Dungeons tab of SkyTemple. A value of -1 actually enters the dungeon—it is insufficient to use this opcode a single time to enter a specific dungeon.
|-
|-
|2
|2
|uint
|uint
|unk1
|duration
|
|The number of frames to fade out the screens.
|}
|}
=== 0x8e - main_EnterGround ===
=== 0x8e - main_EnterGround ===
<TO DO: Opcode description>
Stops the current script to reload Unionall starting from the Coroutine CORO_EVENT_DIVIDE. This opcode also updates various <code>$GROUND_</code> variables to reflect the previously-loaded Level and the new Level being entered. In the base game, using this opcode allows for transitioning between Levels in the Overworld, as the game will eventually run the <code>supervision_ExecuteEnter</code> opcode.


{| class="wikitable"
{| class="wikitable"
Line 1,930: Line 1,938:
|Level
|Level
|level_id
|level_id
|
|An entry in the Level List. Ideally, this opcode would load the specified Level's Enter00 script.
|-
|-
|2
|2
|uint
|uint
|unk1
|duration
|
|The number of frames to fade out the screens.
|}
|}
=== 0x8f - main_EnterGroundMulti ===
=== 0x8f - main_EnterGroundMulti ===