Page 1 of 1

My screen script won't work suddenly

Posted: Tue Jun 06, 2017 7:51 am
by Natsu Dragneel
I haven't touched my screen file, but somehow now my game gives me an error:

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/screens.rpy", line 29: indentation mismatch.

Ren'Py Version: Ren'Py 6.99.12.2.2029
the screen lines go like this:

Code: Select all

       # The one window variant.
        window:
            id "window"

            has vbox:
                style "say_vbox"

            if who:
                text who id "who"

            text what id "what"

    else:

        # The two window variant.
        vbox:
            style "say_two_window_vbox"

            if who:
                window:
                    style "say_who_window"

                    text who:
                        id "who"

            window:
                id "window"

                has vbox:
                    style "say_vbox"

                text what id "what"
pls help

Re: My screen script won't work suddenly

Posted: Tue Jun 06, 2017 5:12 pm
by Lutka
So this probably doesn't have anything to do with the screens.rpy file if you didn't change it. Instead, I'd venture to guess whatever you just changed is the issue and renpy is just giving you an unclear error message. Can you remember what you were doing when this issue popped up?

Edit:
It's also probably got something to do with what you wrote in the script since (im no expert but) indentation mismatch seems to imply what you wrote in your script isn't in the same format as how screens.rpy intended it to be.

Say I had a format that went a little like this

Screen lildickies ("user_input1", "user_input2"):
textbutton user_input1 action (Hide("lildickies"), Jump(user_input2)):

What this format is doing here is it's defining "lildickies".

The first line dictates how lildickies will be used in script.rpy.
The second line dictates what lildickies will do after it's used in script.rpy

How this particular format called lildickies would be used in script.rpy is like this

Show screen lildickies("Continue", "secondlabel")

It would then look a little something like this
Image

Pressing that button would then jump to label "secondlabel" in the script.


Why I'm telling you this is, because most things you see in the game are made with these screens.rpy formats that includes the "say" format.

Whenever you write into your script something like

Code: Select all

u "I like bananas"
You may not realise it, but that right there is using the "say" format from the screens.rpy file. It's a specific way of writing something in the script where renpy will automatically realise "oh ok. They're trying to use the 'say' format".

Now what I think you've done wrong here is, you've written in your script.rpy, some bit of code that has too many spaces before it. Like for example,

This wouldn't work

Code: Select all

    u "I like bananas"
But this would

Code: Select all

u "I like bananas"
Holy shit, let it never be said I didn't try to help here.

Re: My screen script won't work suddenly

Posted: Wed Jun 28, 2017 10:03 am
by Natsu Dragneel
Thank you, I somehow solved the problem, but thank you anyways