"expected statement" error

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
Project_Astro
Newbie
Posts: 21
Joined: Wed Jun 13, 2018 1:02 pm
Projects: NeoLythe / Dark Investigations
Contact:

"expected statement" error

#1 Post by Project_Astro »

Well, huh, I might not be the only one with this problem. I searched for an answer but I didn't find anything so far :?

So hello everyone !
I've apparently got a statement error :

Code: Select all

File "game/script.rpy", line 23: expected statement.
    example imagemap hide noshow:
                     ^
Here is my code :

Code: Select all

label imagemap_displayables:

    e "Let's investigate the crime scene !"

    window hide None

    example imagemap hide noshow:
        screen imagemap_displayables:
            imagemap:
                idle "beach"
                hover "beach2"

                hotspot (44, 238, 93, 93) action Jump("couteau") alt "Couteau"
                hotspot (360, 62, 93, 93) action Jump("ciseaux") alt "Ciseaux"
                hotspot (726, 106, 93, 93) action Jump("livre") alt "Livre"
                

        label imagemap_displayables:

            # Call the imagemap_example screen.
            call screen imagemap_displayables

        label couteau:

            e "You chose swimming."

            e "Swimming seems like a lot of fun, but I didn't bring my bathing suit with me."

            jump imagemap_done
(didn't put the entire code)

The fact is that I simply copied the "Tutorial" script to try things on it and understand it. But well, it doesn't work. Do you have any idea ?

Thank you for reading.

User avatar
xavimat
Eileen-Class Veteran
Posts: 1460
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

Re: "expected statement" error

#2 Post by xavimat »

That tutorial code is very strange. The tutorial defines a new statement "example" that does not mean anything in normal renpy.

I'd suggest you to not use the tutorial code. It's too advanced and has a specific use (show code examples inside the tutorial) that has no real use in normal VN (even very advanced ones).
(unless you want the same effect for you, then you need to learn and understand the tutorial file that define the "example": 01example.rpy)
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
Project_Astro
Newbie
Posts: 21
Joined: Wed Jun 13, 2018 1:02 pm
Projects: NeoLythe / Dark Investigations
Contact:

Re: "expected statement" error

#3 Post by Project_Astro »

Oh okay, thank you ! (it's true that I didn't understand this "example" statement)

This code is in renpy itself, like, this is Ren'Py Tutorial, the one with Eileen that explains you a lot of things.
I didn't manage to do imagemap for a long time and I really wanted to try so I thought I could simply use this one !

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: "expected statement" error

#4 Post by kivik »

Yeah the tutorial code is not a good place to look by the looks of it. As xavimat said, it uses some unique stuff that PyTom had written, probably to allow you see the code being executed during the tutorial itself.

You're better off using The Question's code for experimenting with - though I don't think that has imagemaps. If the official docs' example isn't helpful enough: https://www.renpy.org/doc/html/screens. ... statements Give google a search for imagemap tutorials, I'm sure you'll find a good one :)

User avatar
Project_Astro
Newbie
Posts: 21
Joined: Wed Jun 13, 2018 1:02 pm
Projects: NeoLythe / Dark Investigations
Contact:

Re: "expected statement" error

#5 Post by Project_Astro »

The Question's code is a good one to make simple choices, but I'm not looking for this.
However thank you !

(I searched yes, even asked my grand-father who's good in it, but we didn't find what we were looking for or at least we didn't understand at all ^^' But I'll continue, I might find something one day. Thank you !)




edit : Or maybe I should just ask :lol:

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: "expected statement" error

#6 Post by kivik »

Yeah, perhaps you should ask what you're stuck on?

Did you click on the link I mentioned? It's got the entire imagemap sample code there. Perhaps you need to read more of the online document itself to understand the basics of how screens work first if you're stuck at not knowing where to start?

User avatar
Project_Astro
Newbie
Posts: 21
Joined: Wed Jun 13, 2018 1:02 pm
Projects: NeoLythe / Dark Investigations
Contact:

Re: "expected statement" error

#7 Post by Project_Astro »

Yes, I did and well it seems clearer to me I have to say !

edit : Though, looking at it twice, I don't understand how I should call a screen for example, haha. I'll search for it !

edit of the edit ( :?: ): Wow, finally understood aaaall of this, I'm quite happy right now !

Post Reply

Who is online

Users browsing this forum: Ocelot