Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dialogue_special_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
if (!can_draw)
4
    return;
5
if (global.dialogue_open == false)
6
{
7
    if instance_exists(obj_pl)
8
        obj_pl.alarm[0] = 1
9
    instance_destroy()
10
}
11
if (letter_array == -1)
12
{
13
    for (var i = 1; i <= string_length(message[message_current]); i++)
14
    {
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
    can_skip = false
29
    if (letter_waiter == 0)
30
    {
31
        letter_current += letter_speed
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(sndfnt, 1, false)
43
                    break
44
            }
45
46
        }
47
    }
48
}
49
else
50
    can_skip = true
51
if (keyboard_multicheck_pressed(0) && skippable == true && can_skip == true)
52
{
53
    message_advance = true
54
    can_skip = false
55
}
56
if (letter_waiter > 0)
57
    letter_waiter--
58
if (keyboard_multicheck_pressed(1) && skippable == true)
59
    letter_current = array_length(letter_array) - 1
60
if (message_advance == true)
61
{
62
    message_advance = false
63
    if ((message_current + 1) < array_length_1d(message))
64
    {
65
        letter_array = -1
66
        message_current += 1
67
        letter_current = 0
68
    }
69
    else
70
        global.dialogue_open = false
71
}
72
if (mode == "swirl")
73
{
74
    swirl_deg -= 10
75
    if (swirl_deg <= 0)
76
        swirl_deg += 360
77
}