Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_soundtester_Step_0

(view raw script w/o annotations or w/e)
1
if (sunkus_kb_check_pressed(45))
2
    room_goto_next();
3
if (keyboard_check_pressed(ord("R")))
4
    room_restart();
5
var i = 0;
6
mute = 0;
7
if (sunkus_kb_check_pressed(68))
8
{
9
    file = "debug_soundlist.txt";
10
    myfileid = file_text_open_write(file);
11
    for (i = 0; i < soundtotal; i++)
12
    {
13
        file_text_write_string(myfileid, soundName[i]);
14
        file_text_writeln(myfileid);
15
    }
16
    file_text_close(myfileid);
17
}
18
if (sunkus_kb_check(40))
19
    moved++;
20
if (sunkus_kb_check(38))
21
    moved--;
22
if (sunkus_kb_check(39))
23
    moved += 15;
24
if (sunkus_kb_check(37))
25
    moved -= 15;
26
if (sunkus_kb_check_pressed(40))
27
    moved = 5;
28
if (sunkus_kb_check_pressed(38))
29
    moved = -5;
30
if (auto == 1)
31
{
32
    moved += 0.5;
33
    if (moved >= 5)
34
    {
35
        playsound = 1;
36
        mute = 1;
37
    }
38
}
39
while (moved >= 5)
40
{
41
    current++;
42
    moved -= 5;
43
}
44
while (moved <= -5)
45
{
46
    current--;
47
    moved += 5;
48
}
49
if (current < 1)
50
    current = 1;
51
if (current > (soundtotal - 1))
52
    current = soundtotal - 1;
53
if (sunkus_kb_check_pressed(90))
54
    playsound = 1;
55
if (sunkus_kb_check_pressed(77))
56
    mute = 1;
57
if (mute)
58
{
59
    snd_free_all();
60
    snd_stop_all();
61
    mute = 0;
62
}
63
if (playsound)
64
{
65
    snd_stop_all();
66
    playsound = 0;
67
    snd_play_pitch(asset_get_index(soundName[current]), pitch);
68
}
69
if (sunkus_kb_check_pressed(65))
70
{
71
    if (auto == 0)
72
        auto = 1;
73
    else
74
        auto = 0;
75
}
76
if (sunkus_kb_check_pressed(74))
77
{
78
    checkstring = get_string("Enter index of sound to jump to sound. ex. snd_noise", soundName[current]);
79
    var found = false;
80
    for (i = 0; i < array_length(soundName); i++)
81
    {
82
        if (checkstring == soundName[i])
83
        {
84
            current = i;
85
            found = true;
86
        }
87
    }
88
    if (!found)
89
        debug_print("Sound Not Found");
90
}
91
if (sunkus_kb_check_pressed(33))
92
    current = 1;
93
if (sunkus_kb_check_pressed(34))
94
    current = soundtotal - 1;
95
if (sunkus_kb_check_pressed(85))
96
    pitch += 0.1;
97
if (sunkus_kb_check_pressed(89))
98
    pitch -= 0.1;