Ren'Py Vertical Pan Problem

Daisuke Kanbe

Newbie
Game Developer
Nov 8, 2020
98
582
Hi, I am doing a vertical camera pan for "Peek" choice. Where the camera pans from feet to head. My game resolution is 1920x1080, So I am using a 1920x3413 image.

I searched the pan codes from both here and lemmasoft forums but when I launch the game it is giving me this error.

You don't have permission to view the spoiler content. Log in or register now.

I will appreciate if you guys can help me with this. Thankyou!
 

Penfold Mole

Engaged Member
Respected User
May 22, 2017
3,116
7,613
Could you please paste the code to the forum instead of images with code in your future posts? That way it would be better to copy it and suggest changes.
Select from the forum toolbar Insert -> Code; Select Python as Language; copy and paste code text into the "Insert Code" box.

As for the image panning try scene instead of show for full screen images and I'm not sure how beneficial the subpixel statement is there. The show statement is meant for partial images, but panning will still work the same way.
Also, you are missing the initial alignment of the image. If you want to pan vertically moving from bottom to top (guessing by the final alignment of yalign), then the initial alignment of the image is yalign 1.0 and the final one yalign 0.0 (from the top to bottom the other way around).
And the pause statement comes after the scene statement, it's not a part of it.

When you get it working, I suggest ease instead of linear for panning. Try it and you will like it better.

Based on your example:

Python:
label valeriepeek1:
    scene dbedconvo03 with dissolve:
        yalign 1.0 # initial vertical alignment
        xalign 0.0 # horizontal alignment
        linear 4.0 yalign 0.0 # linear pan to final vertical alignment
    pause 4.0 # wait for the scene warp effect to end
_________________________
code corrected
 
Last edited:

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,256
Firstly, I would use scene rather than show. But if you have a good reason to use show, then I understand I may be wrong.

Secondly, anything before a linear or similar warper effect is the starting position for the image. So you specified the image should be aligned to the left edge (xalign 0.0) but haven't said anything about the y-axis (yalign).

Additionally, most images would be centralized (xalign 0.5). But if the image is the same width as the screen - it really doesn't matter.

pause as far as ATL will always require a time. It's likely you meant the pause to appear after image - so the indentation is wrong. It's probably also the pause that's triggering the error.

Aaaannnndddddd... Penfold Mole beat me to to all of that by a minute or so.

In addition, pause on it's own is fine for players who don't switch on [AUTO]. But for those of us that do, that animation will disappear about 0.5 second after it's initially shown. Better to use a pause with the same time (as or just below) your linear timer.

I'd code this...

Python:
label valeriepeek1:

    scene dbeconvo03 with dissolve:
        xalign 0.5 yalign 1.0
        linear 4.0 yalign 0.0

    pause 3.5

Which would cause the next dialogue to start to appear just before the animation ends.

For a more complex example and a longer explanation...
https://f95zone.to/threads/panning-an-image-up.45285/#post-3000651
 

Penfold Mole

Engaged Member
Respected User
May 22, 2017
3,116
7,613
Right, xalign 0.5 (centering the image horizontally) is generally better for vertical panning, but it it doesn't matter for zoom 0 full screen images.
pause without a parameter will just wait for a click indefinitely.
____________________________
corrected
Thanks to 79flavors
 
Last edited:

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,256
pause without a parameter will just wait for a click indefinitely.

Not with [AUTO] advance switched on. It will wait for the calculated time based on the length of the displayed string (0 bytes) + a minimum timer (about half a second).

I see it mainly with devs who use show screen:. They think of pause or even $ renpy.pause(hard=True) as waiting an infinite amount of time until the player triggers the game to advance. But with auto-advance switched on, even a hard pause will only wait a bare minimum amount of time without some accompanying dialogue to increase the advance timer.
Then suddenly, their game that is supposed to wait for player to click an arrow or a light switch or something from their inventory - instead briefly shows the intended screen and continues to the next line of code with barely a glance in the rear view mirror. It gets particularly nasty if you're holding down [CTRL] to quickly advance through a game while testing.
 

Daisuke Kanbe

Newbie
Game Developer
Nov 8, 2020
98
582
Thank you all for replying. I have tried all the codes but for some reason the problem is still there. Here is an extended version of the code and screenshot of the error

Code:
    menu:
        "peek":
            $ Valerie_interest = True
            $ ValerieLike += 1
            jump valeriepeek1
        "No":
            jump contconvo1

label valeriepeek1:
    scene bedconvo03 with dissolve:
        xalign 0.54 yalign 1.0 zoom 1.5
        easein 4.0 yalign 0.0 zoom 3.0
        easeout 1.0 xalign 0.53 yalign 0.16 zoom 4.0
        pause 0.5
        linear 1.0 xalign 0.54 yalign 0.0 zoom 3.0
        pause 0.5
        linear 0.25 xalign 0.5 yalign 0.5 zoom 1.0
        pause 4.0

    m o "{i}Oh boy, She's looking hot as always."

label contconvo1:

    m o "You know I am usually free."
    m o "What happened?"
    v "I need a favour. I need you to become my boyfriend."
Even if I remove expressions or type them in separate lines, it shows error in time like 4.0, 3.0

You don't have permission to view the spoiler content. Log in or register now.
 

Penfold Mole

Engaged Member
Respected User
May 22, 2017
3,116
7,613
It would make more sense to try with an easier warp first and make sure it works, then move to more complicated warps.
Try to make a simple vertical pan work first, the kind we were talking about initially.
 
Last edited:
  • Like
Reactions: Daisuke Kanbe

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,192
Even if I remove expressions or type them in separate lines, it shows error in time like 4.0, 3.0
It works fine on the 7.4.4 I actually use for testing. Therefore it's possible that you're just encountering a temporary bug. Update the version of Ren'py, and it should solve the problem.
 
  • Like
Reactions: Daisuke Kanbe

Penfold Mole

Engaged Member
Respected User
May 22, 2017
3,116
7,613
Yes, your ATL code works just fine in Ren'Py 7.4.6.1693, too.

BTW, just one thing to check is the rpy file format itself - it should be UTF-8 Unix format (LF line endings), not Windows text with CR LF line endings. Mixing the two up by using sometimes Windows Notepad on files originally created in correct format by some more advanced text editor may create all kinds of unfortunate parsing errors after being saved in Notepad.

I've scratched my head for hours at a time in the past on this kind of "hybrid" text files, trying to figure out an invisible formatting problem in them. Now it's one of the first things to check when I encounter this type of "mystical" errors while parsing various text files.
 
Last edited:
  • Like
Reactions: Daisuke Kanbe

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,256
Thank you all for replying. I have tried all the codes but for some reason the problem is still there. Here is an extended version of the code and screenshot of the error

Really not sure.
You've copied my ATL from the other thread... and that worked fine at the time.
I've just retested it now with RenPy 7.3.5 and 7.4.5 - and both versions show it exactly how I would expect it to.

Do you perhaps have a custom image statement for bedconvo03? Or are you just letting RenPy do it's automatic allocation for a file called bedconvo03.jpg or similar?

Again, the indentation of that final pause is incorrect for that animation. But that isn't causing your error.

Python:
label valeriepeek1:

    scene bedconvo03 with dissolve:
        xalign 0.54 yalign 1.0 zoom 1.5
        easein 4.0 yalign 0.0 zoom 3.0
        easeout 1.0 xalign 0.53 yalign 0.16 zoom 4.0
        pause 0.5
        linear 1.0 xalign 0.54 yalign 0.0 zoom 3.0
        pause 0.5
        linear 0.25 xalign 0.5 yalign 0.5 zoom 1.0

    pause 4.0

    m o "{i}Oh boy, She's looking hot as always."
 
  • Like
Reactions: Daisuke Kanbe

Daisuke Kanbe

Newbie
Game Developer
Nov 8, 2020
98
582
So, I wrote the code into the default script.rpy and it worked perfectly fine and smooth.

Since, I am a total noob and just created simple intro.rpy and 0.1.rpy files to separate codes by different updates. It must be an error about file encoding like Penfold said here.

BTW, just one thing to check is the rpy file format itself - it should be UTF-8 Unix format (LF line endings), not Windows text with CR LF line endings. Mixing the two up by using sometimes Windows Notepad on files originally created in correct format by some more advanced text editor may create all kinds of unfortunate parsing errors after being saved in Notepad.
Thank you all for helping me out.
 

Penfold Mole

Engaged Member
Respected User
May 22, 2017
3,116
7,613
I'm not sure about the Atom text editor that Ren'Py recommends, since I haven't used it, but in Notepad++ there are line ending conversion commands under the Edit -> EOL Conversion menu item. Usually the current line ending option is greyed out, leaving 2 conversion options active. In case UTF-8 option is active, then it's likely a good idea to use it.
You could also convert it to Windows format and then back to Unix in case the first attempt doesn't seem to work and parsing of the file still fails.

It's also worth to check from the Encoding menu, which encoding is selected and use "Convert to UTF-8" command below the menu separator line when needed.
 
  • Like
Reactions: Daisuke Kanbe