Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_rhythmgame_editor_Create_0

(view raw script w/o annotations or w/e)
1
for (i = 0; i < 5; i++)
2
    remtrackpos[i] = 0;
3
global.interact = 1;
4
song_initialized = 0;
5
loadsong = 1;
6
image_speed = 0;
7
missnotetimer = 0;
8
missnotecon = 0;
9
minnote = 0;
10
trackpos = 0;
11
scenecon = 0;
12
maxnote = 0;
13
buffer[0] = 0;
14
buffer[1] = 0;
15
buffer[2] = 0;
16
pressedtimer[0] = 10;
17
pressedtimer[1] = 10;
18
pressedtimer[2] = 10;
19
bpm = 230;
20
notespacing = 60 / bpm;
21
meter = notespacing * 4;
22
startoffset = 0;
23
oneAtATime = true;
24
hold_start[0] = 0;
25
hold_end[0] = 0;
26
hold_start[1] = 0;
27
hold_end[1] = 0;
28
hold_start[2] = 0;
29
hold_end[2] = 0;
30
heldnote[0] = 0;
31
heldnote[1] = 0;
32
heldnote[2] = 0;
33
hold_score = 0;
34
total_score = 0;
35
score_scale = 2;
36
combo = 5000;
37
max_score = 25000;
38
auto_play = true;
39
invc = 0;
40
hurt_flash = 0;
41
goodScore = 0;
42
maxScore = 0;
43
track1 = -1;
44
track2 = -1;
45
track1_instance = -1;
46
track2_instance = -1;
47
instrument = 0;
48
note_color[0] = c_teal;
49
note_color[1] = #00A2E8;
50
note_color[2] = c_orange;
51
note_hit_timer[0] = 0;
52
note_hit_timer[1] = 0;
53
note_hit_timer[2] = 0;
54
note_hit_score[0] = 40;
55
note_hit_score[1] = 40;
56
song_loaded = false;
57
song_id = 0;
58
savestring = "music_timing";
59
brightness = 1;
60
trackstart = 0;
61
chart_end = 0;
62
camx = camerax();
63
camy = cameray();
64
song_menu = true;
65
start_buffer = true;
66
selection = 0;
67
tracklist = scr_rhythmgame_songlist();
68
for (var _i = 0; _i < array_length(tracklist); _i++)
69
    tracklist[_i] = string_format_zero(_i, 2, 0) + " - " + tracklist[_i];
70
savecon = 0;
71
track_length = 135.652;
72
notespeed = 150;
73
has_file = false;
74
load_source = 0;
75
rec_time[0] = 0;
76
rec_endtime[0] = 0;
77
rec_type[0] = 0;
78
rec_hold = 0;
79
rec_count = 0;
80
rec_max = 25;
81
recording_mode = false;
82
paused = false;
83
mousecon = 0;
84
loop = false;
85
tooltips = true;
86
changesmade = false;
87
erase_min = 0;
88
erase_max = 1;
89
do_refresh = false;
90
undo_action[0] = 0;
91
undo_index[0] = -1;
92
undo_time[0] = -1;
93
undo_type[0] = -1;
94
undo_end[0] = -1;
95
undo_anim[0] = -1;
96
undo_queue = 0;
97
undo_cap = 0;
98
clip_size = 0;
99
clip_time[0] = 0;
100
clip_type[0] = 0;
101
clip_end[0] = 0;
102
clip_anim[0] = 0;
103
marker = [];
104
marker_count = 0;
105
notemod_index = -1;
106
scrollcon = 0;
107
rem_mode = false;
108
rem_pos = -1;
109
last_pause = 0;
110
scroll_init = 0;
111
noteeditmode = 0;
112
quickscroll_timer = 0;
113
arrow_scroll = 0;
114
ralsei = instance_create(420, 300, obj_rhythmgame_performer);
115
ralsei.sprite_index = spr_ralsei_sing_clap;
116
ralsei.image_xscale = 2;
117
ralsei.image_yscale = 2;
118
ralsei.image_speed = 0;
119
ralsei.depth = depth - 10;
120
ralsei.loop = true;
121
ralsei.animspeed = 0.5;
122
ralsei.rhythmer = id;
123
susie = instance_create(120, 300, obj_rhythmgame_performer);
124
susie.sprite_index = spr_susie_drum_play;
125
susie.image_xscale = 2;
126
susie.image_yscale = 2;
127
susie.image_speed = 0.16666666666666666;
128
susie.depth = depth - 10;
129
susie.loop = true;
130
susie.animspeed = 3;
131
susie.rhythmer = id;
132
kris = instance_create(220, 300, obj_rhythmgame_performer);
133
kris.sprite_index = spr_kris_rock_1;
134
kris.image_xscale = 2;
135
kris.image_yscale = 2;
136
kris.image_speed = 0.16666666666666666;
137
kris.depth = depth - 10;
138
kris.loop = false;
139
kris.rhythmer = id;
140
last_note = 0;
141
current_note = 1;
142
cooldown = 0;
143
note_streak = 0;
144
original_notespeed = notespeed;
145
146
function load_chart()
147
{
148
    debug_print("track loading...");
149
    savestring = "music_timing";
150
    if (song_id == 1)
151
    {
152
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { scr_debug_clear_persistent(); }
("loading practice song");
153
        savestring += "_practice";
154
    }
155
    else if (song_id == 2)
156
    {
157
        song_id = 2;
158
        savestring += "_tenna";
159
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { scr_debug_clear_persistent(); }
("loading tenna_battle");
160
        bpm = 148;
161
    }
162
    else if (song_id == 3)
163
    {
164
        song_id = 3;
165
        savestring += "_tutorial";
166
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { scr_debug_clear_persistent(); }
("loading tutorial song");
167
        bpm = 190;
168
    }
169
    else if (song_id == 4)
170
    {
171
        song_id = 4;
172
        savestring += "_board4";
173
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { scr_debug_clear_persistent(); }
("loading board4_rhythm");
174
        bpm = 120;
175
    }
176
    else if (song_id == 5)
177
    {
178
        song_id = 5;
179
        savestring += "_rudebuster_boss";
180
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { scr_debug_clear_persistent(); }
("loading rudebuster_boss");
181
        bpm = 140;
182
    }
183
    else if (song_id == 6)
184
    {
185
        song_id = 6;
186
        savestring += "_vapor";
187
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { scr_debug_clear_persistent(); }
("loading battle_vapor");
188
        bpm = 200;
189
    }
190
    else if (song_id == 8)
191
    {
192
        savestring += "_rudebuster";
193
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { scr_debug_clear_persistent(); }
("loading rudebuster");
194
    }
195
    else if (song_id == 9)
196
    {
197
        savestring += "_fieldofhopes";
198
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { scr_debug_clear_persistent(); }
("loading field of hopes and dreams");
199
    }
200
    else if (song_id == 10)
201
    {
202
        savestring += "_knockyoudown";
203
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { scr_debug_clear_persistent(); }
("loading Knock You Down!!");
204
    }
205
    else
206
    {
207
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { scr_debug_clear_persistent(); }
("loading rock video");
208
    }
209
    if (instrument == 1)
210
    {
211
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { scr_debug_clear_persistent(); }
("loaded drums");
212
        note_color[0] = #D1176A;
213
        note_color[1] = #EA79C8;
214
        savestring += "_drums";
215
    }
216
    else if (instrument == 2)
217
    {
218
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { scr_debug_clear_persistent(); }
("loaded vocals");
219
        note_color[0] = c_green;
220
        note_color[1] = #B5E61D;
221
        note_color[2] = c_lime;
222
        savestring += "_vocals";
223
    }
224
    else
225
    {
226
        
scr_debug_print
scr_debug_print

function
scr_debug_print(arg0)
{ } function print_message(arg0) { } function debug_print(arg0) { } function scr_debug_clear_all() { scr_debug_clear_persistent(); }
("loaded lead");
227
    }
228
    scr_rhythmgame_load_song(song_id, false, false, true);
229
    if (file_exists(savestring + ".txt"))
230
    {
231
        scr_rhythmgame_editor_load(savestring + ".txt");
232
        has_file = true;
233
        load_source = 1;
234
    }
235
    else
236
    {
237
        if (instrument == 0)
238
        {
239
            scr_rhythmgame_notechart_lead(song_id);
240
            if (song_id == 0)
241
            {
242
                scr_rhythmgame_notechart_lead_solo(0);
243
                scr_rhythmgame_notechart_lead_solo(1);
244
                scr_rhythmgame_notechart_lead_solo(2);
245
                scr_rhythmgame_notechart_lead_finale();
246
            }
247
        }
248
        else if (instrument == 1)
249
        {
250
            scr_rhythmgame_notechart_drums(song_id);
251
        }
252
        else if (instrument == 2)
253
        {
254
            scr_rhythmgame_notechart_vocals(song_id);
255
        }
256
        load_source = 2;
257
    }
258
}
259
260
function jump_to_marker(arg0 = false)
261
{
262
    var _meter = scr_round_to_beat(track_pos, bpm);
263
    if (marker_count == 0)
264
    {
265
        if (_meter != 0 && _meter != track_length)
266
            return 0.5;
267
    }
268
    else
269
    {
270
        for (var _i = 0; _i < marker_count; _i++)
271
        {
272
            var _time = marker[_i];
273
            if (!arg0 && _i == 0 && _i > _meter)
274
                return 0;
275
            if (arg0 && _i > _meter)
276
                return _i;
277
            if (!arg0 && _i < _meter)
278
                return _i;
279
        }
280
    }
281
    if (arg0)
282
        return track_length;
283
    else
284
        return 0;
285
}