Does not expect a block

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
User avatar
Bum_McFluff
Regular
Posts: 45
Joined: Sat Aug 18, 2018 8:15 pm
Contact:

Does not expect a block

#1 Post by Bum_McFluff »

Code: Select all

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

File "game/script.rpy", line 54: Line is indented, but the preceding statement statement does not expect a block. Please check this line's indentation.
    jump nextscene
    ^

Ren'Py Version: Ren'Py 7.3.5.606
Sun Feb 09 12:22:21 2020

Code: Select all

label layeredimage1:
    hide h
    'Begin Test'
layeredimage her:
    always:
        'h_base'

    group outfit:
        attribute top:
            'h_top_base'
        attribute jeans:
            'h_pants_base'

    group eyes:
        attribute open default:
            'h_eyes_base'

    group mouth:
        pos (100, 100)
        attribute default:
            'h_mouth_base'
        attribute happy:
            'h_mouth_smile'
    'The test should be running'
        jump nextscene
        
label beachscene:
...etc
Line 54 is the onscreen text 'The test should be running'. I try indenting the jumpscene further and further, but that doesn't work, and doesn't make sense anyway. The next scene (beachscene) is one that should be skipped over by a previous choice, and the scene after that is nextscene.

This is my first effort at getting a layered image to work, and before this issue popped up the images didn't appear anyway (although the paths are correct). I got no error for that though, so that's a problem for another day.

I am new to writing games, and this is something that I have already been advised to work up to gradually, and fair enough, but I would like to get it working once before putting it aside.
What, spy on our spy as he searches for their spy? Why not, sounds rather like fun.

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: Does not expect a block

#2 Post by Per K Grok »

Bum_McFluff wrote: Sat Feb 08, 2020 9:33 pm .....
I would like to get it working once before putting it aside.
Indenting is not the problem. The 'jump to different label' should not be in your definition of the layered image at all.
Defining a layered image will not in itself show the image. You need a separate command for that.


try this

Code: Select all


layeredimage her:
    always:
        'h_base'

    group outfit:
        attribute top:
            'h_top_base'
        attribute jeans:
            'h_pants_base'

    group eyes:
        attribute open default:
            'h_eyes_base'

    group mouth:
        pos (100, 100)
        attribute default:
            'h_mouth_base'
        attribute happy:
            'h_mouth_smile'


###################################

label start:
    jump layeredimage1

label layeredimage1:
    'Beginning test'
    show her happy
    'The test should be running.'
    jump nextscene	


Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Ocelot