Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dialogue_dark_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 = true
48
if (letter_waiter > 0)
49
    letter_waiter--
50
if (message_advance == true)
51
{
52
    if (draw_alpha > 0)
53
        draw_alpha -= 0.05
54
    else
55
    {
56
        message_advance = false
57
        if ((message_current + 1) < array_length_1d(message))
58
        {
59
            letter_array = -1
60
            message_current += 1
61
            letter_current = 0
62
            draw_alpha = 1
63
        }
64
        else
65
            global.dialogue_open = false
66
    }
67
}