I have a problem with Side Images transitions which I believe might be a bug(?) because I use code directly from the documentation and it results in the problem. Of course user error is always possible (I would love if this were user error and someone could correct me into having this working haha.)
The problem is that when setting up config.side_image_same_transform, suddenly my side images 'forget' about the xoffset I gave them, and move around.
Scroll down to the animated gif image below to see this in action.
I have found very little info about this function in general, other than some obscure reports of similar issues, which I will link below, but first let me explain.
The set-up in question for sprites, side images and transitions.
I am using LayeredImages for sprites, and define my side images as shown in the documentation. Here is the documentation example:
I am then setting up a transition for when the side image of a character (same character) changes for a change of expression, with config.side_image_same_transform. I am doing it exactly as shown in the documentation (as it turns out the 0.2 dissolve is also the transition I use for my full sprites). Here are the relevant bits from the documentation:Code: Select all
image side augustina = LayeredImageProxy("augustina", Transform(crop=(0, 0, 362, 362), xoffset=-80))
The problem in this situation.Transforms and Transitions
The config.side_image_same_transform and config.side_image_change_transform transforms are called with two arguments – old and new side image displayables – each time the side image is displayed. These can be used to move around side images, or use a transition to go between side images.
This causes the side image to slide in and out when the character associated with that image changes:
This is used to dissolve between old and new side images when the character remains the same. (For example, when the character changes emotion.) For the Dissolve to work correctly, both side images must be the same size.Code: Select all
transform change_transform(old, new): contains: old yalign 1.0 xpos 0.0 xanchor 0.0 linear 0.2 xanchor 1.0 contains: new yalign 1.0 xpos 0.0 xanchor 1.0 linear 0.2 xanchor 0.0 define config.side_image_change_transform = change_transform
Code: Select all
transform same_transform(old, new): old new with Dissolve(0.2, alpha=True) define config.side_image_same_transform = same_transform
To sum up - I am using the same code as the documentation and, the result is that my side images move around - whatever xoffset I applied to them when defining them is thrown out the window when config.side_image_same_transform is set to anything other than None. Once they have moved, they transition properly, but in the wrong place, and not the place I gave them through xoffset. The offset is 'seen' by the game, as when 'rolling back' in the conversation by using the scroll wheel, the side image will temporarily show at the right offset; they will also show at the right offset for their first line of dialogue (ie before the side image refreshes, I guess) but then will 'move' again to the wrong spot.
Here's a visual (animated gif image) to show you what it looks like, from the quick test whose code is shown below also.
(Gif image uploaded here in full resolution if low res is hurting your eyes: https://s1.gifyu.com/images/lambdasprite.gif)
How this was tested / issue replication.
To show that it's not anything else in my projects causing this, and to have an easy way to have others replicate the issue in the exact same circumstance, I plopped down this code in "The Question" project that comes with Ren'Py.
If anyone wanted to try to replicate this issue, one could always do the same thing and see if they suddenly observe the same phenomenon.
The below code is exactly the same as the documentation re. those elements mentioned above, except I made the offset different so the problem I am talking about is more visible. I have had this issue in all projects I tried this in.
Here is the code I added to "The Question" for the example visually shown above (I am attaching my lambdasprite images to this as well):
Code: Select all
define ls =Character("Lambda", image="lambdasprite")
layeredimage lambdasprite:
always:
"lambda_base"
group expressions:
attribute smile default:
"lambda_smile"
attribute annoyed:
"lambda_annoyed"
transform same_transform(old, new):
old
new with Dissolve(0.2, alpha=True)
define config.side_image_same_transform = same_transform
# if you comment out the line above, or change = same_transform to = None , the problem does not happen.
# Of course, no transition happens either anymore without this line.
##########--- SPRITES -- ########
image side lambdasprite = LayeredImageProxy("lambdasprite", Transform(crop=(0, 0, 362, 362), xoffset=-160))
# The game starts here.
label start:
# Start by playing some music.
play music "illurock.opus"
scene bg lecturehall
with fade
ls "HELLO"
ls annoyed "Oh, I moved to the wrong spot."
ls "That's not cool."
ls "Why?!"
viewtopic.php?t=48731
viewtopic.php?t=45126
To Conclude: What I actually am trying to do:
1. I would like to know if I'm doing something wrong, in which case, your help would be greatly appreciated, and this could be helping others in the future too - or if this is a bug, in which case, this would be an attempt at reporting it.
2. If anyone is willing to give this a shot - realization of #1 might include getting confirmation through someone else trying it or sharing their experience with this function, so I'd love to hear if it has been working fine for you under the same or similar circumstances to what I have.
3. Most of all, I would like a way to have a dissolve transition between expression changes for same character side images, but one that wouldn't mess with my offsets. My side images each have different offsets, so I can't use the trick of setting a general offset in the say screen (which does 'combat' this transition problem). Any suggestions?
Thank you all very much for your time.
______________________________________________
Here are the lambdasprite test files I used for this example:
Lambda base: Smile: Annoyed: All together in one zip: