Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_credits_ch4_Step_0

(view raw script w/o annotations or w/e)
1
if (!loaded)
2
    exit;
3
if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
4
{
5
    if (sunkus_kb_check_pressed(82))
6
    {
7
        snd_free_all();
8
        room_restart();
9
    }
10
    if (sunkus_kb_check_pressed(81))
11
        audio_sound_set_track_position(song1, audio_sound_get_track_position(song1) + measure_time);
12
    if (sunkus_kb_check_pressed(32))
13
    {
14
        if (!paused)
15
        {
16
            paused = true;
17
            audio_pause_all();
18
        }
19
        else
20
        {
21
            paused = false;
22
            audio_resume_all();
23
        }
24
    }
25
}
26
if (!init)
27
{
28
    init = true;
29
    snd_free_all();
30
    song0 = snd_init("ch4_credits.ogg");
31
    song1 = mus_play(song0);
32
}
33
if (credits_con == 0)
34
{
35
    if (credit_index < (array_length(credits) - 1))
36
    {
37
        if (audio_is_playing(song1))
38
        {
39
            var track_progress = audio_sound_get_track_position(song1);
40
            if (track_progress < measure_timer)
41
                exit;
42
            var measure_progress = track_progress / measure_time;
43
            credit_index = floor(measure_progress) - 1;
44
        }
45
    }
46
    else
47
    {
48
        credits_con = 1;
49
        glowing_active = true;
50
    }
51
}
52
if (credits_con == 1)
53
{
54
    var track_progress = audio_sound_get_track_position(song1);
55
    if (track_progress >= 59.75)
56
    {
57
        creditalpha = 0;
58
        credits_con = -1;
59
    }
60
}
61
if (glowing_active)
62
{
63
    if (con == 0)
64
    {
65
        con = 1;
66
        auto_text = true;
67
    }
68
    if (con == 50 && !i_ex(obj_writer))
69
    {
70
        con = 51;
71
        scr_delay_var("con", 52, 90);
72
    }
73
    if (con == 52 && !i_ex(obj_writer))
74
    {
75
        con = 53;
76
        scr_delay_var("con", 54, 180);
77
        credit_index++;
78
        creditalpha = 1;
79
        
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("year_alpha", -1, 1, 120);
80
    }
81
    if (con == 54 && !i_ex(obj_writer))
82
    {
83
        if (audio_is_playing(song1))
84
        {
85
            var track_progress = audio_sound_get_track_position(song1);
86
            var measure_progress = track_progress / measure_time;
87
            var current_measure = floor(measure_progress);
88
            if (current_measure == 26)
89
            {
90
                con = 59;
91
                scr_delay_var("con", 60, 60);
92
                creditalpha = 0;
93
            }
94
        }
95
        else
96
        {
97
            con = 59;
98
            scr_delay_var("con", 60, 60);
99
            creditalpha = 0;
100
        }
101
    }
102
    if (con == 60)
103
    {
104
        con = -1;
105
        game_restart();
106
    }
107
    if (auto_text)
108
    {
109
        if (audio_is_playing(song1))
110
        {
111
            var track_progress = audio_sound_get_track_position(song1);
112
            if (track_progress >= auto_text_start)
113
            {
114
                if (!i_ex(obj_writer))
115
                {
116
                    if (glowing_index < array_length(glowing_text))
117
                    {
118
                        dequeue_text();
119
                    }
120
                    else
121
                    {
122
                        auto_text = false;
123
                        con = 50;
124
                    }
125
                }
126
            }
127
            if (track_progress >= auto_text_stop)
128
            {
129
                with (obj_writer)
130
                    forcebutton1 = 1;
131
            }
132
            with (obj_writer)
133
                skippable = 0;
134
        }
135
    }
136
}