Opcodes: Difference between revisions

From Spiral Framework
Jump to navigation Jump to search
No edit summary
Line 68: Line 68:
LIN Hex Opcode: <code>0x0F</code>
LIN Hex Opcode: <code>0x0F</code>


This opcode is used in scripts to change the Special Ability of a given character. The opcode itself has three arguments:
This opcode is used in scripts to change the Special Ability entry in the report card of a given character.
{| class="wikitable"
{| class="wikitable"
!Argument
!Argument
Line 82: Line 82:
|Special Ability Variation
|Special Ability Variation
|}
|}
The used arguments are then placed into the equation <code>arg1 + (arg3 * 15)</code>, and the code finds the file in 10_Special.pak with the corresponding number as its title.  
The used arguments are then placed into the equation <code>arg1 + (arg3 * 15)</code>, and the code finds the file in 10_Special.pak with the corresponding number.  


=== Examples ===
=== Examples ===
Line 90: Line 90:
* This opcode should be called for every character at trial preparation screens in order to ensure that all the characters have the correct ability set at the start of trials.
* This opcode should be called for every character at trial preparation screens in order to ensure that all the characters have the correct ability set at the start of trials.
* Near the end of Trial 6 in Danganronpa 1, Makoto (Character 0) is supposed to have their special set to "Ultimate Hope". The game reads from file 15, which mistakenly contains "Ultimate Despair" instead. So, be warned that in DR1 character 15 DOES NOT use the 10_Special PAK as they do not have a report card page and thus their Special should not be included.
* Near the end of Trial 6 in Danganronpa 1, Makoto (Character 0) is supposed to have their special set to "Ultimate Hope". The game reads from file 15, which mistakenly contains "Ultimate Despair" instead. So, be warned that in DR1 character 15 DOES NOT use the 10_Special PAK as they do not have a report card page and thus their Special should not be included.
== SFX A ==
{{todo|Make a list of useful common SFX for DR1 and DR2}}
LIN Hex Opcode: <code>0x0A</code>
This opcode is used in scripts to play sound effects. Sound effect IDs correspond to the sound effect filenames found in <code>/data/all/se/</code>. It takes three arguments.
{| class="wikitable"
!Argument
!Purpose
|-
|1
|Short
|-
|2
|Sound ID
|-
|3
|Volume Percentage
|}
As this opcode uses a short, the final ID is calculated by finding <code>(argument1 * 256) + argument2</code>
=== Notes ===
* Any sound effect with a corresponding [[loop file]] will loop.


[[Category:Danganronpa: Trigger Happy Havoc]] [[Category: Opcodes]]
[[Category:Danganronpa: Trigger Happy Havoc]] [[Category: Opcodes]]

Revision as of 17:24, 30 March 2018

Opcodes are the commands used in LIN scripts to make things happen in the game. In the native LIN format of the game, opcodes are hexadecimal bytes. SPIRAL converts these to a more human readable format.

0x33

See: 0x33

Change UI

See: UI Elements

Restart Script

LIN Hex Opcode: 0x1C

This opcode will restart the current script file from the beginning.

Notes

  • SPIRAL currently does not support this opcode and it must be used via its hexadecimal.

Screen Flash

LIN Hex Opcode: 0x1F

This opcode is used to make the screen flash with a certain colour. It takes seven arguments.

Argument Purpose
1 Red Component (0-255)
2 Green Component (0-255)
3 Blue Component (0-255)
4 Fade in duration
5 Hold duration
6 Fade out duration
7 Opacity

Examples

0x1F|255, 0, 0, 4, 60, 10, 255

This code would make the screen completely fade to red over a period of 4 frames, stay that way for 60 frames, and then fade back to normal over a period of 10 frames.

0x1F|255, 255, 255, 4, 0, 30, 255

This code would cause the screen to very quickly flash white.

SFX A|0, 26, 100
0x1F|255, 255, 255, 4, 0, 30, 255

This code would cause a "realisation" screen flash with a sound effect.

Notes

  • SPIRAL currently does not support this opcode and it must be used via its hexadecimal.

Set Flag

See: Flag IDs

Set Title

LIN Hex Opcode: 0x0F

This opcode is used in scripts to change the Special Ability entry in the report card of a given character.

Argument Purpose
1 Character ID
2 Seemingly unused
3 Special Ability Variation

The used arguments are then placed into the equation arg1 + (arg3 * 15), and the code finds the file in 10_Special.pak with the corresponding number.

Examples

Set Title|10, 0, 1

When this line is read, Toko's special ability would be changed to "Ultimate Writing Prodigy and Murderous Fiend," from file 25 in 10_Special.pak.

Notes

  • This opcode should be called for every character at trial preparation screens in order to ensure that all the characters have the correct ability set at the start of trials.
  • Near the end of Trial 6 in Danganronpa 1, Makoto (Character 0) is supposed to have their special set to "Ultimate Hope". The game reads from file 15, which mistakenly contains "Ultimate Despair" instead. So, be warned that in DR1 character 15 DOES NOT use the 10_Special PAK as they do not have a report card page and thus their Special should not be included.

SFX A

Hmmm...
To do:
Make a list of useful common SFX for DR1 and DR2

LIN Hex Opcode: 0x0A

This opcode is used in scripts to play sound effects. Sound effect IDs correspond to the sound effect filenames found in /data/all/se/. It takes three arguments.

Argument Purpose
1 Short
2 Sound ID
3 Volume Percentage

As this opcode uses a short, the final ID is calculated by finding (argument1 * 256) + argument2

Notes

  • Any sound effect with a corresponding loop file will loop.