Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_flowey_world_text_Step_0

(view raw script w/o annotations or w/e)
1
if (global.dialogue_open == false)
2
{
3
    if (draw_alpha > 0.1)
4
        draw_alpha = lerp(draw_alpha, 0, 0.25)
5
    else
6
        instance_destroy()
7
    return;
8
}
9
message_length = string_length(message[message_current])
10
message_end = array_length(message) - 1
11
if (keyboard_multicheck_pressed(1) && skippable == true)
12
{
13
    characters = message_length
14
    message_draw = string_copy(message[message_current], 0, characters)
15
    current_char = string_char_at(message_draw, characters)
16
}
17
if (characters < message_length && counter == 0)
18
{
19
    characters += increase
20
    if (characters > message_length)
21
        characters = message_length
22
    message_draw = string_copy(message[message_current], 0, characters)
23
    current_char = string_char_at(message_draw, characters)
24
    if (current_char != " ")
25
        audio_play_sound(soundfont, 20, false)
26
}
27
else if (characters >= message_length && increase_message_count == false && keep_on_screen == false)
28
{
29
    if (skippable == false && (!alarm[0]))
30
        alarm[0] = auto_advance_timer
alarm[0]

increase_message_count = true
31
    else if (keyboard_multicheck_pressed(0) && skippable == true)
32
        increase_message_count = true
33
}
34
if (increase_message_count == true)
35
{
36
    if (message_current < message_end)
37
    {
38
        message_current += 1
39
        message_length = string_length(message[message_current])
40
        characters = 0
41
        message_draw = ""
42
        counter = 0
43
        increase_message_count = false
44
    }
45
    else
46
        global.dialogue_open = false
47
}
48
if (characters > 0 && characters < message_length)
49
{
50
    current_char = string_char_at(message_draw, characters)
51
    if (current_char == "." || current_char == ",")
52
        counter_max = 5
53
    else
54
        counter_max = 1
55
    counter += 1
56
    if (counter >= counter_max)
57
        counter = 0
58
}