Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dialogue_pacifist_ending_flashbacks_Step_0

related scripts: Alarm_0Alarm_1Alarm_2Create_0Draw_73Step_0

(view raw script w/o annotations or w/e)
1
if (live_call())
2
    return global.live_result;
3
if (local_dialogue_open == false)
4
{
5
    draw_alpha = 0;
6
    if (!alarm[1])
7
        instance_destroy();
8
    exit;
9
}
10
if (letter_array == -1)
11
{
12
    for (var i = 1; i <= string_length(message[message_current]); i++)
13
    {
14
        text_alpha[i] = 0;
15
        letter_array[i] = string_char_at(message[message_current], i);
16
        if (i > 1)
17
            text_x[i] = text_x[clamp(i - 1, 1, 9999)] + str_width;
18
        text_y[i] = text_y[clamp(i - 1, 1, 9999)];
19
        if (letter_array[i] == "#")
20
        {
21
            text_y[i] += 20;
22
            text_x[i] = text_x[1] - str_width;
23
        }
24
    }
25
}
26
if (letter_current < (array_length(letter_array) - 1))
27
{
28
    if (letter_waiter == 0)
29
    {
30
        letter_current += letter_speed;
31
        show_debug_message("letter_current: " + string(letter_current) + "#string_length = " + string(string_length(message[message_current])));
32
        if (floor(letter_current) == letter_current)
33
        {
34
            switch (letter_array[letter_current])
35
            {
36
                case " ":
37
                case ".":
38
                case "#":
39
                    break;
40
                default:
41
                    audio_stop_sound(sndfnt);
42
                    audio_play_sound_on(emitter1, sndfnt, 0, false);
43
                    break;
44
            }
45
        }
46
    }
47
}
48
else if (!alarm[0] && !message_advance)
49
{
50
    alarm[0]
 = fade_timer;
gml_Object_obj_dialogue_pacifist_ending_flashbacks_Alarm_0.gml

message_advance = 1;
51
}
52
if (letter_waiter > 0)
53
    letter_waiter--;
54
if (message_advance == 1)
55
{
56
    draw_alpha -= 0.05;
57
    if (draw_alpha <= 0)
58
    {
59
        for (var i = 0; i <= letter_current; i++)
60
            text_alpha[i] = 0;
61
        draw_alpha = 0;
62
        message_advance += 1;
63
        exit;
64
    }
65
    else
66
    {
67
        exit;
68
    }
69
}
70
else if (message_advance == 2)
71
{
72
    message_advance = 0;
73
    if ((message_current + 1) < array_length_1d(message))
74
    {
75
        letter_array = -1;
76
        message_current += 1;
77
        letter_current = 0;
78
    }
79
    else
80
    {
81
        alarm[1]
 = 90;
gml_Object_obj_dialogue_pacifist_ending_flashbacks_Alarm_1.gml

if (live_call()) return global.live_result; audio_emitter_free(emitter1); instance_destroy();
82
        local_dialogue_open = false;
83
    }
84
}
85
if (message_advance != 1)
86
{
87
    if (draw_alpha < 1)
88
        draw_alpha += 0.1;
89
}
90
for (var i = 0; i <= letter_current; i++)
91
{
92
    if (text_alpha[i] < 1)
93
        text_alpha[i] += 0.1;
94
}