onlayer returning end of line expected 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
Evildumdum
Regular
Posts: 191
Joined: Sun Jan 18, 2015 8:49 am
Projects: ApoclypseZ
Contact:

onlayer returning end of line expected error

#1 Post by Evildumdum »

I'm trying to apply a transform to a specific layer then show one of my screens on that layer, however i keep running into an end of line error that i am not expecting.
Here's all the relevant code:

Code: Select all

$ renpy.layer_at_list([ZoomList[MapZoom][0]], layer='mapdisplay')
    if UnitPlaced == True:
        $ ActiveDeployment = []
        $ UnitPlaced = False
        $ PlaceUnit = False
    if AddZoom == 1:
        python:
            MapZoom += 1
            AddZoom = 0
            for y in range(0, len(CurrentOverlay)):
                for x in range(0, len(CurrentOverlay[y])):
                    CurrentOverlay[y][x].XPos = FindPos(x, zoomlist[MapZoom][1])
                    CurrentOverlay[y][x].YPos = FindPos(y, zoomlist[MapZoom][1])
            renpy.layer_at_list([ZoomList[MapZoom][0]], layer='mapdisplay')
    if MinusZoom == 1:
        python:
            MapZoom -= 1
            MinusZoom = 0
            for y in range(0, len(CurrentOverlay)):
                for x in range(0, len(CurrentOverlay[y])):
                    CurrentOverlay[y][x].XPos = FindPos(x, zoomlist[MapZoom][1])
                    CurrentOverlay[y][x].YPos = FindPos(y, zoomlist[MapZoom][1])
            renpy.layer_at_list([ZoomList[MapZoom][0]], layer='mapdisplay')

Code: Select all

    show screen CurrentMap onlayer mapdisplay
    call screen ZoomScreen
and 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/CombatEngine.rpy", line 601: end of line expected.
    show screen CurrentMap onlayer mapdisplay
                           

Ren'Py Version: Ren'Py 6.99.11.1749
Anyone got an idea why it's giving me this error?
"If at first you don't succeed, try hitting it with a shoe."

User avatar
SypherZent
Veteran
Posts: 362
Joined: Fri Sep 02, 2016 3:14 am
Completed: Multiverse Heroes, Space Hamster in Turmoil
Location: Puerto Rico
Contact:

Re: onlayer returning end of line expected error

#2 Post by SypherZent »

Hello,

Have you tried show screen CurrentMap without the 'onlayer mapdisplay'?
Creator of Multiverse Heroes & Space Hamster in Turmoil

Want me to code your game?
Check my services thread!

User avatar
Evildumdum
Regular
Posts: 191
Joined: Sun Jan 18, 2015 8:49 am
Projects: ApoclypseZ
Contact:

Re: onlayer returning end of line expected error

#3 Post by Evildumdum »

yes, it works just fine. I've been doing it that way for the entirety of the games development. But in an effort to cut down on the ATL that is causing lag i am trying to apply the zoom transform to the entire layer instead (every item in the screen had the same "zoom" applied to it independently before this).
"If at first you don't succeed, try hitting it with a shoe."

User avatar
SypherZent
Veteran
Posts: 362
Joined: Fri Sep 02, 2016 3:14 am
Completed: Multiverse Heroes, Space Hamster in Turmoil
Location: Puerto Rico
Contact:

Re: onlayer returning end of line expected error

#4 Post by SypherZent »

Ohh, I understand.

I'm not sure show screen is capable of taking the onlayer in that syntax.
Have you tried statement equivalents to handle the showing of the items via the screens rather than the script?

https://www.renpy.org/doc/html/statemen ... lents.html

Specifically, the renpy.show(name, at_list=, []layer='master', what=None, zorder=0, tag=None, behind=[])

For instance, inside the screen, using it as such:

Code: Select all

screen some_screen:
    renpy.show("other_screen", layer='mapdisplay')
And then using your zoom applied to the layer in the script.rpy file?
Creator of Multiverse Heroes & Space Hamster in Turmoil

Want me to code your game?
Check my services thread!

User avatar
Evildumdum
Regular
Posts: 191
Joined: Sun Jan 18, 2015 8:49 am
Projects: ApoclypseZ
Contact:

Re: onlayer returning end of line expected error

#5 Post by Evildumdum »

I was trying to adapt the show blabla bla onlayer blabla shown here. Granted it is for static defined images, but i was hoping it would apply to screens as well.

https://www.renpy.org/doc/html/displaying_images.html
"If at first you don't succeed, try hitting it with a shoe."

Post Reply

Who is online

Users browsing this forum: Google [Bot]