DivaScript: Difference between revisions
| (2 intermediate revisions by 2 users not shown) | |||
| Line 39: | Line 39: | ||
|bool | |bool | ||
|- | |- | ||
| | |rot_speed | ||
|Effect speed | |Effect speed | ||
|int | |int | ||
| Line 95: | Line 95: | ||
|size | |size | ||
|Character scale | |Character scale | ||
|int | |||
|- | |||
| rowspan="2" | | |||
====== DATA_CAMERA ====== | |||
| rowspan="2" |<code>DATA_CAMERA(restart, id);</code> | |||
|restart | |||
|<code>0</code>: Accumulated time (Keeps advancing even while inactive) | |||
<code>1</code>: Restart | |||
|bool | |||
|- | |||
|id | |||
|Camera id | |||
|int | |int | ||
|- | |- | ||
| Line 109: | Line 121: | ||
|Ends reading of the script. | |Ends reading of the script. | ||
<code>END();</code> | <code>END();</code> | ||
| colspan="3" | | | colspan="3" |No params | ||
|- | |- | ||
| rowspan="4" | | | rowspan="4" | | ||
| Line 127: | Line 139: | ||
|int | |int | ||
|- | |- | ||
| | | amount | ||
| | |Final pose amount. Defines how much of the animation's end pose is applied. | ||
1000 = the full end pose. | |||
|int | |int | ||
|- | |- | ||
| Line 153: | Line 166: | ||
====== HAND_ANIM ====== | ====== HAND_ANIM ====== | ||
| rowspan="5" |Sets the animation of a character's hand | | rowspan="5" |Sets the animation of a character's hand | ||
<code>HAND_ANIM(chara, | <code>HAND_ANIM(chara, hand_side, anim_id, interpolation, amount);</code> | ||
|chara | |chara | ||
|Character slot | |Character slot | ||
|int | |int | ||
|- | |- | ||
| | |hand_side | ||
|Which hand to apply the animation to: | |Which hand to apply the animation to: | ||
<code>0</code>: left | <code>0</code>: left | ||
| Line 165: | Line 178: | ||
|enum | |enum | ||
|- | |- | ||
| | |anim_id | ||
|HAND_ANIM IDs from 0-14 | |HAND_ANIM IDs from 0-14 | ||
|int | |int | ||
| Line 173: | Line 186: | ||
|int | |int | ||
|- | |- | ||
| | | amount | ||
| | |Final pose amount. Defines how much of the animation's end pose is applied. | ||
1000 = the full end pose. | |||
|int | |int | ||
|- | |- | ||
| Line 196: | Line 210: | ||
|- | |- | ||
|color | |color | ||
|<code>#AARRGGBB</code> hex color code converted to decimal | |<code>#AARRGGBB</code> hex color code converted to decimal (from [[wikipedia:Two's_complement|signed 2's complement]]) | ||
eg. | eg. for a red lyric the command would be <code>LYRIC(id, -65536);</code> | ||
because Red: <code>FFFF0000</code> → <code>-65536</code> | |||
Breakdown of the value: | |||
Alpha = FF → fully opaque | |||
Red = FF → fully red | |||
Green= 00 → absence of green | |||
Blue= 00 → absence of blue | |||
Default: <code>-1</code> | Default: <code>-1</code> | ||
| Line 336: | Line 360: | ||
|Starts playing the song file defined in <code>pv_db</code>. | |Starts playing the song file defined in <code>pv_db</code>. | ||
<code>MUSIC_PLAY();</code> | <code>MUSIC_PLAY();</code> | ||
| colspan="3" | | | colspan="3" |No params | ||
|- | |- | ||
| | | | ||
| Line 353: | Line 377: | ||
|Ends PV playback. | |Ends PV playback. | ||
<code>PV_END();</code> | <code>PV_END();</code> | ||
| colspan="3" | | | colspan="3" |No params | ||
|- | |- | ||
| | | | ||
| Line 418: | Line 442: | ||
FT: <code>TARGET(type, pos_x, pos_y, angle, dist, amp, freq);</code> | FT: <code>TARGET(type, pos_x, pos_y, angle, dist, amp, freq);</code> | ||
F: <code>TARGET(type, duration, is_end, pos_x, pos_y, angle, freq, dist, amp, | F: <code>TARGET(type, duration, is_end, pos_x, pos_y, angle, freq, dist, amp, flight_time, sig);</code> | ||
F2, X: <code>TARGET(type, duration, is_end, pos_x, pos_y, angle, freq, dist, amp, | F2, X: <code>TARGET(type, duration, is_end, pos_x, pos_y, angle, freq, dist, amp, flight_time, sig, hit_eff);</code> | ||
|type | |type | ||
|ID corresponding to a note type. | |ID corresponding to a note type. | ||
| Line 463: | Line 487: | ||
|bool | |bool | ||
|- | |- | ||
| | |flight_time | ||
|(for F/F2/X formats) | |(for F/F2/X formats) | ||
Target Flying Time value (same format as the TARGET_FLYING_TIME command) | Target Flying Time value (same format as the TARGET_FLYING_TIME command) | ||
| Line 485: | Line 509: | ||
<h6>TARGET_FLYING_TIME</h6> | <h6>TARGET_FLYING_TIME</h6> | ||
|Sets the time it takes for the rhythm game notes to hit their targets. | |Sets the time it takes for the rhythm game notes to hit their targets. | ||
<code>TARGET_FLYING_TIME( | <code>TARGET_FLYING_TIME(flight_time);</code> | ||
| | |flight_time | ||
|time value in milliseconds | |time value in milliseconds | ||
|int | |int | ||
| Line 495: | Line 519: | ||
<code>TIME(t);</code> | <code>TIME(t);</code> | ||
|t | |t | ||
|time value in DivaTime | |time value in DivaTime: 100000 × second. | ||
|DivaTime | |DivaTime | ||
|}<!-- Please keep all the commands in alphabetical order!! --> | |}<!-- Please keep all the commands in alphabetical order!! --> | ||
| Line 501: | Line 525: | ||
= References = | = References = | ||
somewhatlurker's [https://github.com/somewhatlurker/pydiva/blob/dsc/pydiva/pydsc_op_db.py pyDIVA/pyDSC] | somewhatlurker's [https://github.com/somewhatlurker/pydiva/blob/dsc/pydiva/pydsc_op_db.py pyDIVA/pyDSC] | ||
__INDEX__ | |||
__NEWSECTIONLINK__ | |||
Latest revision as of 17:43, 2 June 2026
DivaScript (commonly referred to as DSC) is the file format used by all the Project DIVA games for storing various commands related to Music Videos/PVs and Rhythm Game Charts.
The data inside .dsc files is stored in a binary format. This means that they can not be edited with a text editor and instead require specialized programs that can decode them such as DSC Studio or ScriptEditor. Additionally, .dsc files from Project DIVA F2nd and Project DIVA X are encrypted using DIVAFILE encryption. They need to be decrypted before editing.
DSC Formats
[edit | edit source]Every Project DIVA game uses a specific DivaScript format. The exact format of a .dsc file is determined by the first 4 bytes of the file.
List of DSC Commands (Incomplete)
[edit | edit source]List of commands that can be used in FT, F, F2/X DSC formats. Format-exclusive commands are marked individually.
| Command Name | Definition | Parameter | Description | Type |
|---|---|---|---|---|
AGEAGE_CTRL |
Controls the effect for the hair of the module "AgeAge Again".
FT: |
chara | Character slot | int |
| parts | Hair parts to control:
|
enum | ||
| npr | sets NPR material | bool | ||
| rot_speed | Effect speed | int | ||
| skip | Skips 200 frames of animation. | bool | ||
| disp | Whether to display the effect or not. | bool | ||
BAR_TIME_SET |
Sets the length of a measure.
|
bpm | Beats per minute | int |
| beats | Number of quarter note beats minus 1. eg: 3 for 4/4.
|
int | ||
BLOOM |
Sets data from bloom pv_param.
FT, F2, X: |
id | ID matching the data in pv_param. | int |
| unk | Unknown | int | ||
CHANGE_FIELD |
Changes the field defined in pv_field/pv_db.
F2, X: |
id | ID matching the field number in pv_field or pv_db.
|
int |
CHARA_SIZE |
Sets a character's scale/size.
|
chara | Character slot | int |
| size | Character scale | int | ||
DATA_CAMERA[edit | edit source] |
DATA_CAMERA(restart, id);
|
restart | 0: Accumulated time (Keeps advancing even while inactive)
|
bool |
| id | Camera id | int | ||
EDIT_BLUSH[edit | edit source] |
Sets a character's facial effect
|
id | Character facial effect | int |
END |
Ends reading of the script.
|
No params | ||
EXPRESSION[edit | edit source] |
Sets a character's face expression
|
chara | Character slot | int |
| expression id | Expression ids from 0-77 | int | ||
| interpolation | Transition time between face expressions | int | ||
| amount | Final pose amount. Defines how much of the animation's end pose is applied.
1000 = the full end pose. |
int | ||
HAND_SCALE |
Sets the size of a character's hand.
FT: |
chara | Character slot | int |
| hand | Which hand to scale:
|
enum | ||
| scale | Hand scale in percentage times 10; eg. for 105% use 1050
|
int | ||
HAND_ANIM[edit | edit source] |
Sets the animation of a character's hand
|
chara | Character slot | int |
| hand_side | Which hand to apply the animation to:
|
enum | ||
| anim_id | HAND_ANIM IDs from 0-14 | int | ||
| interpolation | Transition time between animations | int | ||
| amount | Final pose amount. Defines how much of the animation's end pose is applied.
1000 = the full end pose. |
int | ||
HAND_ITEM[edit | edit source] |
Shows or hides a hand item defined in pv_db
|
id | ID matching the hand item number in pv_db
|
int |
LYRIC |
Displays a lyric from pv_db.
|
id | ID matching the number of a lyric in pv_db.
Use |
int |
| color | #AARRGGBB hex color code converted to decimal (from signed 2's complement)
eg. for a red lyric the command would be because Red: Breakdown of the value: Alpha = FF → fully opaque Red = FF → fully red Green= 00 → absence of green Blue= 00 → absence of blue Default: |
int | ||
MIKU_DISP |
Shows or hides a character in a PV.
|
chara | Character slot | int |
| disp | Whether to display the character or not. | bool | ||
MIKU_MOVE |
Moves a character in 3D space in a PV.
|
chara | Character slot | int |
| x | X coordinate | int | ||
| y | Y coordinate | int | ||
| z | Z coordinate | int | ||
MIKU_ROT |
Rotates a character in a PV.
|
chara | Character slot | int |
| angle | Angle value | int | ||
MIKU_SHADOW |
Shows or hides a character's shadow in a PV.
|
chara | Character slot | int |
| disp | Whether to display the character's shadow or not. | bool | ||
MODE_SELECT |
Starts or ends a special chart segment, such as Chance Time.
|
difficulty | Indicates under what difficulties the command will trigger in this exact script.
This value is a bit flag corresponding to a group of difficulties:
Adding the values up to each other results in a group: Use |
bitfield enum |
| mode | What segment to start/end:
Only used by the New Classics mod:
|
enum | ||
MOVIE_CUT_CHG |
Plays, shows or hides the movie defined in pv_db or a movie from movie_list in pv_db. It can be used as a fancier version of both MOVIE_DISP and MOVIE_PLAY that allows more control.
FT: |
id | The number in movie_list of the movie to be played.
Playback starts at the moment the command is called for a newly called |
int |
| disp | 1 - display the movie layer
Any other value - hide the movie layer (playback keeps going) |
bool | ||
MOVIE_DISP |
Shows or hides the movie layer in a PV.
|
disp | 1 - display the movie layer
Any other value - hide the movie layer (playback keeps going) |
bool |
MOVIE_PLAY |
Starts playing the movie defined in pv_db or the first movie in movie_list in pv_db.
|
play | 1 - plays the movie
Any other value doesn't do anything. |
bool |
MUSIC_PLAY |
Starts playing the song file defined in pv_db.
|
No params | ||
PV_BRANCH_MODE |
Make future DSC commands only be executed on either the Global, Fail or Success branch.
FT, F, F2, X: |
branch | 0 - Global (commands are executed regardless of success state)
|
enum |
PV_END |
Ends PV playback.
|
No params | ||
SATURATE |
Changes color saturation in a PV.
|
amount | Saturation strength on a scale from 0 to 1000:
|
int |
SCENE_FADE |
Plays a screen fade effect during PVs.
|
duration | Fade duration in milliseconds
eg:
|
int |
| start | The opacity the fade will start with
|
int | ||
| end | The opacity the fade will end with
|
int | ||
| r | Red color component scale, from 0 to 1000 | int | ||
| g | Green color component scale, from 0 to 1000 | int | ||
| b | Blue color component scale, from 0 to 1000 | int | ||
SE_EFFECT |
Plays a sound effect in a PV defined in pv_db. Normally used for success scenes but not restricted to them.
FT, F, F2, X: |
id | number of a effect_se_name_list item defined in pv_db.
|
int |
TARGET |
Spawns a rhythm game note.
FT: F: F2, X: |
type | ID corresponding to a note type.
Full ID list for each game on the dedicated Target page. |
enum |
| pos_x | X position of the note's target. | int | ||
| pos_y | Y position of the note's target. | int | ||
| angle | Angle of the note's path. | int | ||
| distance | Distance between the note's spawn position and the target's position.
Default: |
int | ||
| amp | Amplitude of the note's path wave.
Default: |
int | ||
| freq | Frequency of the note's path wave. | int | ||
| duration | (for F/F2/X formats)
Sustain and Rush Note duration.
Default (for notes other than Sustain and Rush): |
DivaTime | ||
| is_end | (for F/F2/X formats)
set to |
bool | ||
| flight_time | (for F/F2/X formats)
Target Flying Time value (same format as the TARGET_FLYING_TIME command) |
DivaTime | ||
| sig | (for F/F2/X formats)
Time Signature The same value that would otherwise go in Number of quarter note beats minus 1. eg: |
int | ||
| hit_eff | (for F2/X formats)
Assigns a hit effect to the note based on a local ID defined in a previous TARGET_EFFECT command. |
int | ||
TARGET_FLYING_TIME |
Sets the time it takes for the rhythm game notes to hit their targets.
|
flight_time | time value in milliseconds | int |
TIME |
Waits until a specified game time.
|
t | time value in DivaTime: 100000 × second. | DivaTime |
References
[edit | edit source]somewhatlurker's pyDIVA/pyDSC
