Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dialogue_chujin_tapes_Step_0

(view raw script w/o annotations or w/e)
1
if (global.dialogue_open == false)
2
{
3
    if instance_exists(obj_pl)
4
        obj_pl.alarm[0] = 1
5
    instance_destroy()
6
}
7
var MSG_ADVANCE = false
8
var message_length = string_length(message[message_current])
9
if (message_reset == true)
10
{
11
    message_reset = false
12
    message = 0
13
    event_perform(ev_create, 0)
14
    return;
15
}
16
if chujin_tapes_effects
17
{
18
    if (irandom(80) == 1)
19
    {
20
        shaky_text = true
21
        obj_mansion_chujin_tapes.static_flicker = true
22
        obj_mansion_chujin_tapes.overlay_alpha += 0.2
23
        alarm[0] = irandom_range(15, 45)
alarm[0]

shaky_text = false
24
    }
25
}
26
if (keyboard_multicheck_pressed(1) && skippable == true)
27
    cutoff = message_length
28
if (cutoff < message_length)
29
{
30
    if (counter == 0)
31
    {
32
        cutoff += 1
33
        message_length = string_length(message[message_current])
34
        if (cutoff < message_length && (cutoff % 1) == 0)
35
        {
36
            switch string_char_at(message[message_current], cutoff)
37
            {
38
                case " ":
39
                case ".":
40
                    break
41
                default:
42
                    audio_stop_sound(sndfnt)
43
                    audio_play_sound(sndfnt, 1, false)
44
                    break
45
            }
46
47
        }
48
    }
49
}
50
else if (keyboard_multicheck_pressed(0) && skippable == true)
51
{
52
    if (choice == false)
53
        MSG_ADVANCE = true
54
}
55
if (cutoff > message_length)
56
    cutoff = message_length
57
if (message_timer > -1 && cutoff == message_length)
58
{
59
    if (mT == -1)
60
        mT = message_timer
61
    if (mT > 0)
62
        mT -= 1
63
    else if (mT == 0)
64
    {
65
        mT = -1
66
        MSG_ADVANCE = true
67
    }
68
}
69
script_execute(gml_Script_scr_text_counter_overworld)
70
script_execute(gml_Script_scr_text_choices)
71
if MSG_ADVANCE
72
{
73
    if ((message_current + 1) < array_length_1d(message))
74
    {
75
        message_current += 1
76
        cutoff = 0
77
    }
78
    else
79
        global.dialogue_open = false
80
}
81
if instance_exists(obj_mansion_chujin_tapes)
82
{
83
    if ((array_length(prt) - 1) >= message_current)
84
    {
85
        if (prt[message_current] != spr_collisionbox && (!obj_mansion_chujin_tapes.scene_change))
86
            obj_mansion_chujin_tapes.sprite_index = prt[message_current]
87
    }
88
}