Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

I sometimes get a related issue, even with the continue hack.

Invalid get index ‘11’ (on base: ‘String’) for a string of exactly 11 chars: “Hm, okay…” The dots are important, they make us enter the block below:

Message.gd:148 (line count includes the continue hack):

if v-1 < text_node.cleaner_text.length():
    if punctuation_marks_pauses.has(text_node.cleaner_text[v-1]):
        if text_node.cleaner_text[v-1] == ".":
            # invalid index here
            if text_node.cleaner_text[v] == ".":
                _pause_t += punctuation_marks_pauses["..."]
            else:
                _pause_t += punctuation_marks_pauses[text_node.cleaner_text[v-1]]
        else:
            _pause_t += punctuation_marks_pauses[text_node.cleaner_text[v-1]]

It doesn’t surprise me that much since we check for v - 1 < length but not v. What surprises me then is that it doesn’t systematically fail, since I’m always testing with the same string. Again, it must be because that v variable suddenly goes up by 1 at the end of the iteration.