Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dialogue_flowey_distant_Step_0

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

message_advance = 1
48
if (letter_waiter > 0)
49
    letter_waiter--
50
if (message_advance == 1)
51
{
52
    draw_alpha -= 0.1
53
    if (draw_alpha <= 0)
54
        message_advance += 1
55
}
56
else if (message_advance == 2)
57
{
58
    message_advance = 0
59
    if ((message_current + 1) < array_length_1d(message))
60
    {
61
        letter_array = -1
62
        message_current += 1
63
        letter_current = 0
64
    }
65
    else
66
        global.dialogue_open = false
67
}
68
if (message_advance != 1)
69
{
70
    if (draw_alpha < 1)
71
        draw_alpha += 0.1
72
}