Deltarune (Chapter 2) script viewer

← back to main script listing

gml_GlobalScript_scr_textsound

(view raw script w/o annotations or w/e)
1
function 
scr_textsound
scr_textsound

function
scr_textsound()
{ playtextsound = 1; if (button2_h() == 1) playtextsound = 0; if (skippable == 0) playtextsound = 1; if (playtextsound == 1) { if (rate <= 2) getchar = string_char_at(mystring, pos); else getchar = string_char_at(mystring, pos - 1); play = 1; playcheck = 0; if (getchar == "&" || getchar == "\n") { if (rate < 3) { playcheck = 1; getchar = string_char_at(mystring, pos + 1); } else { play = 0; } } if (getchar == " ") play = 0; if (getchar == "^") play = 0; if (getchar == "!") play = 0; if (getchar == ".") play = 0; if (getchar == "?") play = 0; if (getchar == ",") play = 0; if (getchar == ":") play = 0; if (getchar == "/") play = 0; if (getchar == "\\") play = 0; if (getchar == "|") play = 0; if (getchar == "*") play = 0; if (play == 1) { if (textsound == snd_txtq) { audio_stop_sound(snd_txtq_2); qv = snd_play(snd_txtq_2); qp = 0.9 + random(0.15); snd_pitch(qv, qp); sound_timer = 2; } else if (textsound == snd_txtspam) { audio_stop_sound(snd_txtspam2); snd_play_x(snd_txtspam2, 0.8, 1.2); sound_timer = 2; } else if (textsound == snd_txtsans) { audio_stop_sound(snd_txtsans); qv = snd_play(snd_txtsans); sound_timer = 2; } else { snd_play(textsound); } with (obj_face_parent) mouthmove = 1; miniface_pos++; } } }
()
2
{
3
    playtextsound = 1;
4
    if (button2_h() == 1)
5
        playtextsound = 0;
6
    if (skippable == 0)
7
        playtextsound = 1;
8
    if (playtextsound == 1)
9
    {
10
        if (rate <= 2)
11
            getchar = string_char_at(mystring, pos);
12
        else
13
            getchar = string_char_at(mystring, pos - 1);
14
        play = 1;
15
        playcheck = 0;
16
        if (getchar == "&" || getchar == "\n")
17
        {
18
            if (rate < 3)
19
            {
20
                playcheck = 1;
21
                getchar = string_char_at(mystring, pos + 1);
22
            }
23
            else
24
            {
25
                play = 0;
26
            }
27
        }
28
        if (getchar == " ")
29
            play = 0;
30
        if (getchar == "^")
31
            play = 0;
32
        if (getchar == "!")
33
            play = 0;
34
        if (getchar == ".")
35
            play = 0;
36
        if (getchar == "?")
37
            play = 0;
38
        if (getchar == ",")
39
            play = 0;
40
        if (getchar == ":")
41
            play = 0;
42
        if (getchar == "/")
43
            play = 0;
44
        if (getchar == "\\")
45
            play = 0;
46
        if (getchar == "|")
47
            play = 0;
48
        if (getchar == "*")
49
            play = 0;
50
        if (play == 1)
51
        {
52
            if (textsound == snd_txtq)
53
            {
54
                audio_stop_sound(snd_txtq_2);
55
                qv = snd_play(snd_txtq_2);
56
                qp = 0.9 + random(0.15);
57
                snd_pitch(qv, qp);
58
                sound_timer = 2;
59
            }
60
            else if (textsound == snd_txtspam)
61
            {
62
                audio_stop_sound(snd_txtspam2);
63
                snd_play_x(snd_txtspam2, 0.8, 1.2);
64
                sound_timer = 2;
65
            }
66
            else if (textsound == snd_txtsans)
67
            {
68
                audio_stop_sound(snd_txtsans);
69
                qv = snd_play(snd_txtsans);
70
                sound_timer = 2;
71
            }
72
            else
73
            {
74
                snd_play(textsound);
75
            }
76
            with (obj_face_parent)
77
                mouthmove = 1;
78
            miniface_pos++;
79
        }
80
    }
81
}