List of Opcodes: Difference between revisions

Adex (talk | contribs)
m oops not markdown
Happylappy (talk | contribs)
m World Map Mode documentation
 
(25 intermediate revisions by 7 users not shown)
Line 9: Line 9:
* uint: An unsigned integer (a number without decimals). It cannot be negative. It is possible that in the game's code, there are only signed integers and no unsigned integers, but not enough research has been done on the matter. For the most part, it shouldn't matter.
* uint: An unsigned integer (a number without decimals). It cannot be negative. It is possible that in the game's code, there are only signed integers and no unsigned integers, but not enough research has been done on the matter. For the most part, it shouldn't matter.
* sint: A signed integer (a number without decimals). It can be either positive or negative.
* sint: A signed integer (a number without decimals). It can be either positive or negative.
* bitfield: A bitfield is uint where each bits (0 or 1) are treated independantly. They are used to store multiple binary (boolean) values efficiently. Opcodes that use it usually come in the <code>Set</code> and <code>Reset</code> variant. The <code>Set</code> variant define to true the values which are 1 in the input bitfield (while leaving the others untouched), and <code>Reset</code> define to false the values which are 1 in the input bitfield (while also leaving the others untouched).
* String: Text (i.e dialogue). There should always be a quotation mark (") at the beginning and end.
* String: Text (i.e dialogue). There should always be a quotation mark (") at the beginning and end.
* ConstString: Same as String.
* ConstString: Same as String.
Line 381: 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 396: 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 926: Line 928:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 945: Line 947:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 964: Line 966:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,003: Line 1,005:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 1,120: Line 1,122:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,139: Line 1,141:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,158: Line 1,160:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,197: Line 1,199:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 1,280: Line 1,282:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,297: Line 1,299:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,314: Line 1,316:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,353: Line 1,355:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 1,466: Line 1,468:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,483: Line 1,485:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,500: Line 1,502:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|}
|}
Line 1,539: Line 1,541:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 1,760: Line 1,762:
|}
|}
=== 0x81 - Flash ===
=== 0x81 - Flash ===
Currently unknown; it does not seem to affect much. This opcode is not used in the base game.
Zeroes-out the return address used by the <code>Return</code> opcode. This opcode is not used in the base game.


No parameters.
No parameters.
Line 1,782: Line 1,784:
|GameVar
|GameVar
|var
|var
|One of the 115 possible script variables.
|One of the indexed variables. Non-indexed values causes the IndexError.
|}
|}
=== 0x84 - item_Set ===
=== 0x84 - item_Set ===
Line 1,788: Line 1,790:


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.
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.
Item slots 0-3 are safe to use, but item slots 4 and beyond will begin to overwrite other memory!


{| class="wikitable"
{| class="wikitable"
Line 1,805: Line 1,809:
|uint
|uint
|item_id
|item_id
|The ID of the item, where all are listed in the Items tab of SkyTemple.
|The ID of the item, where all are listed in the Items tab of SkyTemple.  
|-
|-
|3
|3
Line 1,832: 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 2,500: Line 2,552:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,529: Line 2,581:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,578: Line 2,630:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,626: Line 2,678:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,655: Line 2,707:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,684: Line 2,736:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,713: Line 2,765:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,761: Line 2,813:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,809: Line 2,861:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,838: Line 2,890:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,867: Line 2,919:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
|-
|-
|2
|2
Line 2,895: Line 2,947:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
|-
|-
|2
|2
Line 2,918: Line 2,970:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,947: Line 2,999:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 2,971: Line 3,023:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 3,024: Line 3,076:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 3,048: Line 3,100:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 3,101: Line 3,153:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 3,169: Line 3,221:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.


Line 3,335: Line 3,387:
|-
|-
|1
|1
|uint
|bitfield
|function_bitfield
|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.
|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.
Line 3,351: Line 3,403:
|-
|-
|1
|1
|uint
|bitfield
|hit_bitfield
|hit_bitfield
|Most bits' purposes are unknown.
|Most bits' purposes are unknown.
Line 3,371: Line 3,423:
|-
|-
|1
|1
|uint
|bitfield
|output_bitfield
|output_bitfield
|
|
Line 3,395: Line 3,447:
|-
|-
|1
|1
|uint
|bitfield
|reply_bitfield
|reply_bitfield
|Most bits' purposes are unknown.
|Most bits' purposes are unknown.
Line 4,692: 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,705: 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:
0: Head<br>1: Right Hand<br>2: Left Hand<br>3: Center<br>4: No offset (bottom of sprite)
|}
|}
=== 0x103 - SetFunctionAttribute ===
=== 0x103 - SetFunctionAttribute ===
<TO DO: Opcode description>
<TO DO: Opcode description>
Line 4,724: Line 4,778:
|-
|-
|1
|1
|uint
|bitfield
|unk0
|unk0
|
|
|}
|}
=== 0x104 - SetHeight ===
=== 0x104 - SetHeight ===
<TO DO: Opcode description>
Moves an actor "vertically" by distancing it from its shadow.


{| class="wikitable"
{| class="wikitable"
Line 4,742: Line 4,796:
|uint
|uint
|unk0
|unk0
|
|number of pixels to move up or down by.
|}
|}
=== 0x105 - SetHitAttribute ===
=== 0x105 - SetHitAttribute ===
Line 4,756: Line 4,810:
|-
|-
|1
|1
|uint
|bitfield
|unk0
|unk0
|
|
Line 4,787: Line 4,841:
|}
|}
=== 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,798: Line 4,851:
|-
|-
|1
|1
|uint
|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 4,913: Line 4,974:
|-
|-
|1
|1
|uint
|bitfield
|unk0
|unk0
|
|
Line 4,957: Line 5,018:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.Values starting at 32770 and above will be slower than a value of 1.
|Movement speed. Higher values result in a faster speed. Values starting at 32770 and above will be slower than a value of 1.
|-
|-
|2
|2
Line 4,984: Line 5,045:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.Values starting at 32770 and above will be slower than a value of 1.
|Movement speed. Higher values result in a faster speed. Values starting at 32770 and above will be slower than a value of 1.
|-
|-
|2
|2
Line 5,033: Line 5,094:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement. Values starting at 32770 and above will be slower than a value of 1.
|Movement speed. Higher values result in a faster speed. Values starting at 32770 and above will be slower than a value of 1.
|-
|-
|2
|2
Line 5,419: Line 5,480:
|uint
|uint
|speed
|speed
|Movement speed. Higher values result in a faster speed. 0 will result in an instant movement.
|Movement speed. Higher values result in a faster speed.  
Values starting at 32770 and above will be slower than a value of 1.
Values starting at 32770 and above will be slower than a value of 1.
|-
|-
Line 5,573: Line 5,634:
|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.
|}
|}


=== 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,600: Line 5,661:
|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.
|}
|}


Line 5,891: Line 5,952:
=== 0x13c - supervision_StationCommon ===
=== 0x13c - supervision_StationCommon ===
Loads a sector of the Enter scene.
Loads a sector of the Enter scene.
Can be used to call sectors of an enter scene within acting scenes!


{| class="wikitable"
{| class="wikitable"
Line 6,486: Line 6,549:


=== 0x16c - WaitScreenFade ===
=== 0x16c - WaitScreenFade ===
<TO DO: Opcode description>
Waits until screen_FadeIn finishes executing.


No parameters.
No parameters.
=== 0x16d - WaitScreenFadeAll ===
=== 0x16d - WaitScreenFadeAll ===
<TO DO: Opcode description>
Waits until screen_FadeInAll finishes executing.


No parameters.
No parameters.
=== 0x16e - WaitScreen2Fade ===
=== 0x16e - WaitScreen2Fade ===
<TO DO: Opcode description>
Waits until screen2_FadeIn finishes executing.


No parameters.
No parameters.
Line 6,544: Line 6,607:


=== 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,556: Line 6,619:
|1
|1
|uint
|uint
|unk0
|world_map_level
|
|Level to transition the world map state to.
|}
|}
=== 0x175 - worldmap_DeleteArrow ===
=== 0x175 - worldmap_DeleteArrow ===
Line 6,578: Line 6,641:
|uint
|uint
|world_map_marker_id
|world_map_marker_id
|
|The world map id to move the camera to.
|}
|}


Line 6,604: Line 6,667:


=== 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,616: Line 6,679:
|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,632: Line 6,695:
|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,648: Line 6,711:
|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,685: Line 6,750:


=== 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,697: Line 6,772:
|1
|1
|uint
|uint
|unk0
|world_map_mode
|
|
|}
|}
Line 7,094: Line 7,169:
|}
|}
=== 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,107: Line 7,184:
|uint
|uint
|param
|param
|
|Unknown. Always 3.
|-
|-
|2
|2
|uint
|uint
|jump_address
|jump_address
|
|Address to jump to.
|}
|}
=== 0x37 - Call ===
=== 0x37 - Call ===
Jumps to the specified address, runs code, and returns to the line of code in which this opcode was used (only if <code>return;</code> was used in the routine this opcode calls).
Jumps to the specified address, runs code, and returns to the line of code in which this opcode was used (only if <code>return;</code> was used in the routine this opcode calls). Only one call can be stored at a time!
 
Use within macros is ill-advised, as using <code>return;</code> within a macro will just end the macro!


{| class="wikitable"
{| class="wikitable"
Line 7,569: Line 7,648:
|}
|}
=== 0x82 - Hold ===
=== 0x82 - Hold ===
<TO DO: Opcode description>
Will stall a script forever.


No parameters.
No parameters.
Line 7,605: Line 7,684:
|}
|}
=== 0xaa - message_SwitchMenu ===
=== 0xaa - message_SwitchMenu ===
<TO DO: Opcode description>
Enclose within a switch case, and generates a dialogue prompt with the options present in subsequent "case menu("text"):"


{| class="wikitable"
{| class="wikitable"
Line 7,617: Line 7,696:
|1
|1
|uint
|uint
|unk0
|cancel
|
|If player can use the B button to back out of a menu. 0 for false, 1 for true.
|-
|-
|2
|2
|uint
|uint
|unk1
|init
|
|Entry number to start the cursor at, starting at 1
|}
|}
=== 0xab - message_SwitchMenu2 ===
=== 0xab - message_SwitchMenu2 ===
<TO DO: Opcode description>
Same as message_SwitchMenu, but it also takes an argument for a bitfield, and will only display dialogue options for which the corresponding bit is enabled (set to 1).


{| class="wikitable"
{| class="wikitable"
Line 7,638: Line 7,717:
|1
|1
|uint
|uint
|unk0
|cancel
|
|If player can use the B button to back out of a menu. 0 for false, 1 for true.
|-
|-
|2
|2
|uint
|uint
|unk1
|init
|
|Entry number to start the cursor at, starting at 1
|-
|-
|3
|3
|uint
|uint
|unk2
|unk2
|
|Bitfield $VAR
|}
|}
=== 0xac - message_SwitchMonologue ===
=== 0xac - message_SwitchMonologue ===
<TO DO: Opcode description>
Structured similarly to a switch statement. Typically uses <code>$HERO_TALK_KIND</code> as an argument, and uses multiple cases to display certain dialogue strings.
 
<code>case 4:</code> used when the player is male or genderless
 
<code>case 5:</code> used when the player is female
 
<code>default:</code> used when <code>$HERO_TALK_KIND</code>'s Talk Group has a value other than 4 or 5
 
This opcode supports displaying a portrait. No sound effect is used when text is scrolling.


{| class="wikitable"
{| class="wikitable"
Line 7,665: Line 7,752:
|GameVar
|GameVar
|var
|var
|
|<code>$x_TALK_KIND</code>, contains Talk Group number
|}
|}
=== 0xad - message_SwitchTalk ===
=== 0xad - message_SwitchTalk ===
<TO DO: Opcode description>
Same as _SwitchMonologue, but typically uses <code>$PARTNER_TALK_KIND</code> as an argument, and the cases used vary.
 
Of the vanilla game partner options:
 
<code>case 1:</code> used if Squirtle, Tododile, Chimchar, Meowth, or Munchlax
 
<code>case 2:</code> used for all other male partners
 
<code>case 3:</code> used for all female partners
 
<code>default:</code> used when <code>$PARTNER_TALK_KIND</code>'s Talk Group has a value other than 1, 2, or 3
 
This opcode supports displaying a portrait. The [[sound effect]] 16133 will emit from the each character scrolling in the text.


{| class="wikitable"
{| class="wikitable"
Line 7,681: Line 7,780:
|GameVar
|GameVar
|var
|var
|
|<code>$x_TALK_KIND</code>, contains Talk Group number
|}
|}
=== 0xc9 - object ===
=== 0xc9 - object ===
Line 7,716: Line 7,815:
|}
|}
=== 0xd5 - Return ===
=== 0xd5 - Return ===
<TO DO: Opcode description>
If run from within a macro, ends the macro.
 
If run after the "call" opcode was used, will return to the address of the call opcode.
 
If used within a script, ends the script.


No parameters.
No parameters.
Line 7,816: Line 7,919:
|}
|}
=== 0x145 - SwitchLives ===
=== 0x145 - SwitchLives ===
<TO DO: Opcode description>
If inside a Switch Case, take the case equal to the species ID of the specified Actor!


{| class="wikitable"
{| class="wikitable"
Line 7,827: Line 7,930:
|-
|-
|1
|1
|uint
|Entity
|unk0
|actor_id
|
|An entry in the Actor List.
|}
|}
=== 0x146 - SwitchRandom ===
=== 0x146 - SwitchRandom ===
<TO DO: Opcode description>
To be used in a switch statement. Will switch to a case of a random number below the specified integer.


{| class="wikitable"
{| class="wikitable"
Line 7,845: Line 7,948:
|uint
|uint
|max_value
|max_value
|
|Largest random output, plus 1
|}
|}
=== 0x147 - SwitchScenario ===
=== 0x147 - SwitchScenario ===
Line 7,936: Line 8,039:
|}
|}
{{NavScriptTerms}}
{{NavScriptTerms}}
[[Category:Documentation]]