Page 1 of 1

"expected statement" error

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

Re: "expected statement" error

Posted: Wed Jun 13, 2018 1:28 pm
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)

Re: "expected statement" error

Posted: Wed Jun 13, 2018 4:21 pm
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 !

Re: "expected statement" error

Posted: Wed Jun 13, 2018 4:27 pm
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 :)

Re: "expected statement" error

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

Re: "expected statement" error

Posted: Wed Jun 13, 2018 5:42 pm
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?

Re: "expected statement" error

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