Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_text_counter_custom

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

function scr_text_counter_custom() //gml_Script_scr_text_counter_custom { var current_char = string_char_at(message[message_current], cutoff) var counter_max = 1 var message_length = string_length(message[message_current]) var pause_duration = 5 if (cutoff > 0 && cutoff < message_length) { switch current_char { case ".": case ",": case "?": case "!": counter_max = pause_duration break default: counter_max = 1 } counter += argument[0] if (counter >= counter_max) counter = 0 } else counter = 0 }
() //gml_Script_scr_text_counter_custom
2
{
3
    var current_char = string_char_at(message[message_current], cutoff)
4
    var counter_max = 1
5
    var message_length = string_length(message[message_current])
6
    var pause_duration = 5
7
    if (cutoff > 0 && cutoff < message_length)
8
    {
9
        switch current_char
10
        {
11
            case ".":
12
            case ",":
13
            case "?":
14
            case "!":
15
                counter_max = pause_duration
16
                break
17
            default:
18
                counter_max = 1
19
        }
20
21
        counter += argument[0]
22
        if (counter >= counter_max)
23
            counter = 0
24
    }
25
    else
26
        counter = 0
27
}