Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_text_counter

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

function scr_text_counter() { if (characters > 0 && characters < message_length) { current_char = string_char_at(message_draw, characters); switch (current_char) { case ".": case ",": case "?": case "!": counter_max = global.text_counter_max; break; default: counter_max = 1; } if (hold > 1) counter_max = 1; counter += 1; if (counter >= counter_max) counter = 0; } else { counter = 0; } }
()
2
{
3
    if (characters > 0 && characters < message_length)
4
    {
5
        current_char = string_char_at(message_draw, characters);
6
        switch (current_char)
7
        {
8
            case ".":
9
            case ",":
10
            case "?":
11
            case "!":
12
                counter_max = global.text_counter_max;
13
                break;
14
            default:
15
                counter_max = 1;
16
        }
17
        if (hold > 1)
18
            counter_max = 1;
19
        counter += 1;
20
        if (counter >= counter_max)
21
            counter = 0;
22
    }
23
    else
24
    {
25
        counter = 0;
26
    }
27
}