My screen script won't work suddenly

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Natsu Dragneel
Regular
Posts: 55
Joined: Wed Aug 19, 2015 11:48 am
Contact:

My screen script won't work suddenly

#1 Post by Natsu Dragneel » Tue Jun 06, 2017 7:51 am

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

Lutka
Newbie
Posts: 23
Joined: Mon Apr 24, 2017 11:13 am
Contact:

Re: My screen script won't work suddenly

#2 Post by Lutka » Tue Jun 06, 2017 5:12 pm

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.

Natsu Dragneel
Regular
Posts: 55
Joined: Wed Aug 19, 2015 11:48 am
Contact:

Re: My screen script won't work suddenly

#3 Post by Natsu Dragneel » Wed Jun 28, 2017 10:03 am

Thank you, I somehow solved the problem, but thank you anyways

Post Reply

Who is online

Users browsing this forum: No registered users