Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hi. Please help. I'm having  same error issue as Dotdidot -  Which file should I paste the fix into?  Which line, which file?  Dumb question probably but we are just learning.  I hope help a student in my class to complete a project and really want to use this tutorial. 

Thank you

This particular section in example_code.renpy

init python hide:

    import os.path

    import re

    # A list of files we will be scanning.

    files = [ ]

    for i in os.listdir(config.gamedir):

        if i.endswith(".rpy"):

            files.append(os.path.join(config.gamedir, i))

    for fn in files:

        fn = fn.replace("\\","/")

       
        f = renpy.open_file(fn)

        open_examples = set()

        for l in f:

            l = l.decode("utf-8")

            l = l.rstrip()

            m = re.match("\s*#begin (\w+)", l)

            if m:

                example = m.group(1)

                if example in examples:

                    raise Exception("Example %r is defined in two places.", example)

                open_examples.add(example)

                examples[example] = [ ]

                continue

            m = re.match("\s*#end (\w+)", l)

            if m:

                example = m.group(1)

                if example not in open_examples:

                    raise Exception("Example %r is not open.", example)

                open_examples.remove(example)

                continue

            for i in open_examples:

                examples[i].append(l)

        if open_examples:

            raise Exception("Examples %r remain open at the end of %r" % (open_examples, fn))

        f.close()

(+1)

Thank you so much ! It's working now and it has really helped me understand the Documentation content on layered images. I didn't want to turn up to class on Monday without knowing how to explain layered images. 

I just changed a few lines from 570. 

for fn in files:

        fn = fn.replace("\\","/")

        f = renpy.open_file(fn)

        open_examples = set()

        for l in f:

#no more changes needed, just the above 

 

You're welcome, glad to hear that. 

This worked for me as well. Thank you so much!

This code snippet is what I needed to get it working on my Windows 10 machine, thanks!