show: transforms don't reset? (renpy 7.3.5)

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
martingerdes
Regular
Posts: 26
Joined: Sun Oct 07, 2018 5:14 am
Contact:

show: transforms don't reset? (renpy 7.3.5)

#1 Post by martingerdes »

Hello, I was just playing around a bit with transforms of characters, and stumbled upon a weird issue.
I am still working in renpy 7.3.5, so apologies if this behavior has changed since then (I'd be glad to know about that fact, then!).

simplified example:
"girl" is an image which is normally intended to by shown at a zoom factor of 0.5, so that we have enough resolution reserve to zoom in.

Code: Select all

transform distance:
    zoom 0.25
transform full:
    zoom 0.5

label test:
  show girl at left, distance
  "You see a girl in the distance."
  show girl at left, full
  "You walk to her."
  show girl at left, full
  "You start talking to her."
This code works precisely as I would expect it to (the second "show girl at left, full" is there to show the problem while keeping the code short).
Now I thought I'd give it a bit of movement for walking towards her:

Code: Select all

transform distance:
    zoom 0.25
transform full:
    zoom 0.5

label test:
  show girl at left, distance
  "You see a girl in the distance."
  show girl at left, distance:
    zoom 1.0
    linear 2.0 zoom 2.0
  show girl at left, full
  "You walk to her."
I'll readily admit I figured out the zoom+linear settings by trying them out, instead of really knowing why they have to be like that. But hey, at least it works, right? The zoom does in fact go from distance to full as intended.
Well actually no, it does not: the last "show girl at left, full" resets the character image to 1/4 of it's intended size of 0.5, the zoom level appears now to be 0.125!

Why don't the transforms applied to the image reset when the last "show girl at left,full" occurs? Can I reset them manually? Is my zoom in effect correct at all? Could I make it more elegant and define a transform for it instead?

Edit:
Damnit, even doing a simple "show girl at left, full with dissolve" uses the wrong zoom level (4 times as big instead)...
Should I not set the zoom level with transforms at all? Other transforms set yanchor and ypos in addition to zoom, so bundling that in a single transform seemed elegant to me. If not in a transform, where to set zoom instead?
I certainly don't want to write

Code: Select all

show girl at left:
  zoom 0.5
every single time, I want to set the image with a single line. using im.Scale when creating the image isn't an option since I lose the information: On zoom in, it will be pixelated. And just creating multiple images isn't an option either: I have many different zoom levels, and the image creation is pretty complicated (using ConditionSwitch), so doing that definition 10 times or whatever would be unmaintainable.
Ideas?

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: show: transforms don't reset? (renpy 7.3.5)

#2 Post by PyTom »

Ren'Py 7.3.5 is quite old at this point. There have been a bunch of Transform relate changes here, and so I'd suggest upgrading to that before asking for support.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Bing [Bot]