"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 » Wed Jun 13, 2018 1:14 pm

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: 1333
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: xavimat
Location: Italy
Contact:

Re: "expected statement" error

#2 Post by xavimat » Wed Jun 13, 2018 1:28 pm

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)
Cops&Robbers A two-player experiment
Fear&Love Why can’t we simply express our feelings? Why am I afraid to say ‘I love you’?
unknown [Sci-Fi - mystery - computer]
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 » Wed Jun 13, 2018 4:21 pm

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: 784
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: "expected statement" error

#4 Post by kivik » Wed Jun 13, 2018 4:27 pm

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 » Wed Jun 13, 2018 5:10 pm

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: 784
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: "expected statement" error

#6 Post by kivik » Wed Jun 13, 2018 5:42 pm

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 » Thu Jun 14, 2018 4:21 am

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: No registered users