Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_musicer_town_Create_0

(view raw script w/o annotations or w/e)
1
if (global.chapter == 1)
2
{
3
    if (global.plot >= 250)
4
    {
5
        if (!snd_is_playing(global.currentsong[1]))
6
        {
7
            global.currentsong[0] = snd_init("town.ogg");
8
            global.currentsong[1] = mus_loop_ext(global.currentsong[0], 0.8, 0.97);
9
        }
10
    }
11
}
12
if (global.chapter == 2)
13
{
14
    if (global.plot >= 10 && global.plot != 200)
15
    {
16
        if (!snd_is_playing(global.currentsong[1]))
17
        {
18
            if (global.plot >= 17 && global.plot <= 25)
19
                global.currentsong[0] = snd_init("honksong.ogg");
20
            else
21
                global.currentsong[0] = snd_init("town.ogg");
22
            global.currentsong[1] = mus_loop_ext(global.currentsong[0], 1, 0.97);
23
        }
24
    }
25
}
26
if (global.chapter > 2)
27
{
28
    var play_song = true;
29
    var song_file = "town.ogg";
30
    var pitch = 0.97;
31
    if (global.chapter == 4)
32
    {
33
        song_file = "town_day.ogg";
34
        if (global.plot < 35 || global.plot >= 95)
35
            play_song = false;
36
        if (global.plot >= 290)
37
        {
38
            play_song = true;
39
            song_file = "rain.ogg";
40
            pitch = 1;
41
        }
42
    }
43
    if (play_song)
44
    {
45
        if (!snd_is_playing(global.currentsong[1]))
46
        {
47
            global.currentsong[0] = snd_init(song_file);
48
            global.currentsong[1] = mus_loop_ext(global.currentsong[0], 1, pitch);
49
        }
50
    }
51
}