end line expected error made me crazy

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
giuelz
Newbie
Posts: 5
Joined: Tue Jun 11, 2019 1:10 pm
Contact:

end line expected error made me crazy

#1 Post by giuelz » Tue Jun 11, 2019 1:15 pm

I'm pretty new in Ren'py.
I'm starting create a game: sometimes when I call a screen I get "end line expected error".
Sometimes not.

For Example;

Code: Select all

label mystudios:
    scene mystudiosoption
    u "done"
    call screen studiooption


screen studiooption():
    imagemap:
        ground "mystudiosoption"
        hotspot (34, 70, 297, 53) action Hide ("andreasitescreen"), Call ("andncc")
        
     

Here he give me error

here:

Code: Select all

    call screen andreasitescreen


screen andreasitescreen():
    imagemap:
        ground "001site"
        hotspot (34, 70, 297, 53) action Hide ("andreasitescreen"), Call ("andncc")
         

no error

User avatar
Alex
Lemma-Class Veteran
Posts: 2251
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: end line expected error made me crazy

#2 Post by Alex » Tue Jun 11, 2019 1:25 pm

If you need to set several actions, put them in square brackets, like

Code: Select all

hotspot (34, 70, 297, 53) action [Hide ("andreasitescreen"), Call ("andncc")]

If that doesn't solve the issue, provide the exact error message you'll get.

giuelz
Newbie
Posts: 5
Joined: Tue Jun 11, 2019 1:10 pm
Contact:

Re: end line expected error made me crazy

#3 Post by giuelz » Tue Jun 11, 2019 1:32 pm

it doesn't works

this is the 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/000 Studios.rpy", line 12: end of line expected.
    call screen studiooption
                ^

Ren'Py Version: Ren'Py 7.2.2.491
Tue Jun 11 19:31:27 2019

User avatar
Alex
Lemma-Class Veteran
Posts: 2251
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: end line expected error made me crazy

#4 Post by Alex » Tue Jun 11, 2019 1:39 pm

Check for any unseen characters at the end of this line (this might happen if you've copy/pasted the code line).

giuelz
Newbie
Posts: 5
Joined: Tue Jun 11, 2019 1:10 pm
Contact:

Re: end line expected error made me crazy

#5 Post by giuelz » Tue Jun 11, 2019 3:00 pm

I don't know. I tried everything. That's crazy

Crazy Li
Regular
Posts: 108
Joined: Fri Jan 03, 2014 3:35 pm
Contact:

Re: end line expected error made me crazy

#6 Post by Crazy Li » Tue Jun 11, 2019 3:10 pm

Hmm... never called a screen before, so I can't help much with explaining this, but I can at least provide alternate ideas that may at least allow this to function? I've only ever used a "show screen" statement in my projects, never "call screen". Not sure what the difference is or if one has clear benefits over the other, but that's one way to try it. If you require the ability to return from the screen, you could also stick it under a label and call that label. That's the way I personally handle all calls. I do:

call [label_name]

and then for the setup, I would have

label [label_name]
show screen [screen_name]

and of course the screen itself defined after that.

giuelz
Newbie
Posts: 5
Joined: Tue Jun 11, 2019 1:10 pm
Contact:

Re: end line expected error made me crazy

#7 Post by giuelz » Tue Jun 11, 2019 3:12 pm

The problem when I use "Show" is that the script continue in the background. I don't know how to stop it.
I told I'm a newbie in renpy

Crazy Li
Regular
Posts: 108
Joined: Fri Jan 03, 2014 3:35 pm
Contact:

Re: end line expected error made me crazy

#8 Post by Crazy Li » Tue Jun 11, 2019 3:15 pm

giuelz wrote:
Tue Jun 11, 2019 3:12 pm
The problem when I use "Show" is that the script continue in the background. I don't know how to stop it.
I told I'm a newbie in renpy
Use "pause" to stop the script from continuing. I should have noted that.

giuelz
Newbie
Posts: 5
Joined: Tue Jun 11, 2019 1:10 pm
Contact:

Re: end line expected error made me crazy

#9 Post by giuelz » Tue Jun 11, 2019 3:30 pm

I know but...
if I do as you said:

Code: Select all


label ufficio:
    scene ufficio01
    u "done!"
    show screen ufficioscreen
    pause
    

Code: Select all

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


File "game/000 Studios.rpy", line 29: expected statement.
    pause
         ^

Ren'Py Version: Ren'Py 7.2.2.491
Tue Jun 11 21:30:29 2019

Crazy Li
Regular
Posts: 108
Joined: Fri Jan 03, 2014 3:35 pm
Contact:

Re: end line expected error made me crazy

#10 Post by Crazy Li » Tue Jun 11, 2019 8:26 pm

This leads me to suspect there's something wrong in the code for the screen itself. Can you show the code of screen ufficioscreen?

Crazy Li
Regular
Posts: 108
Joined: Fri Jan 03, 2014 3:35 pm
Contact:

Re: end line expected error made me crazy

#11 Post by Crazy Li » Tue Jun 11, 2019 8:29 pm

As an example, this is some code from one of my games setting up a shopping screen...

Code: Select all

label shopBuy:
    window hide
    show screen buy
    pause
    screen buy:
        #rest of the code for the screen itself
and then when I want to send the player to the store, I use "call shopBuy" and it works fine for me.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot]