Ren'Py Problem with Ren'Py side images.

UncommonRole

Newbie
Jan 4, 2021
44
21
Although it’s one of the first things I learned and have used over 70 times already, now, for some reason, I’m having trouble with side images. What’s happening is that this new character, named "Jack", never shows the side image, and it also doesn’t apply the change in name text size to fit the textbox and the color.

Code:
define arisa = Character("{size=-10}Arisa \"No jokes\"{/size}", image="arisa", color ="#8b0a1c")
define cyntx = Character("Cynthyatrix", image="cynthyatrix", color="#cbb439")
define jack = Character("{size=-10}Awesome Jack{/size}", image="awesome_jack", color ="#bb8be2")
I’ve already checked the avatar, format, name, and size are correct, and I have no idea what the heck else to do.

I’ve also noticed that, for some reason, the colors or sizes of other characters aren’t updating when I make changes. I have a feeling I must’ve messed with something I shouldn’t have, but I have no idea what it could be.


1743944694498.png


1743944741399.png

Thanks in advance, everyone!
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
11,578
17,789
Code:
define arisa = Character("{size=-10}Arisa \"No jokes\"{/size}", image="arisa", color ="#8b0a1c")
define cyntx = Character("Cynthyatrix", image="cynthyatrix", color="#cbb439")
define jack = Character("{size=-10}Awesome Jack{/size}", image="awesome_jack", color ="#bb8be2")
While technically not wrong, the size (and in fact any styling elements) shouldn't be part of the name of the character. This being due to the fact that it will be stored in the name attribute of the character object, and mess with everything is you use something like:
Python:
label whatever:
    mc "And then, [girlA.name] said that I'm too dumb for her. Can you imagine that?"
You should pass the values as argument when creating the character object, using the who_ prefix for that; passing an absolute value:
define jack = Character( "Awesome Jack", who_size=40, [...] )
Alternatively you can use the who_prefix and who_suffix arguments for that if really you need a relative value:
define jack = Character( "Awesome Jack", who_prefix="{size=-10}", who_suffix="{/size}", [...] )


I’ve already checked the avatar, format, name, and size are correct, and I have no idea what the heck else to do.
Haven't you forgot to define the side image?
image side awesome_jack = "whatever image that is the default one"
 

Turning Tricks

Rendering Fantasies
Game Developer
Apr 9, 2022
1,593
3,002
Although it’s one of the first things I learned and have used over 70 times already, now, for some reason, I’m having trouble with side images. What’s happening is that this new character, named "Jack", never shows the side image, and it also doesn’t apply the change in name text size to fit the textbox and the color.

Code:
define arisa = Character("{size=-10}Arisa \"No jokes\"{/size}", image="arisa", color ="#8b0a1c")
define cyntx = Character("Cynthyatrix", image="cynthyatrix", color="#cbb439")
define jack = Character("{size=-10}Awesome Jack{/size}", image="awesome_jack", color ="#bb8be2")
I’ve already checked the avatar, format, name, and size are correct, and I have no idea what the heck else to do.

I’ve also noticed that, for some reason, the colors or sizes of other characters aren’t updating when I make changes. I have a feeling I must’ve messed with something I shouldn’t have, but I have no idea what it could be.


View attachment 4719341


View attachment 4719344

Thanks in advance, everyone!
Can you show what the code is for that dialogue example you are showing?

At first glance, the basic character define seems okay, but side images won't work unless they are properly named in your images directory. For example, for that screencap above, you might have this...

jack "Me cago en dios, porque no dunciona????!!!!"

so the side image should be a PNG or Webp image (with Alpha) and it should be small enough to fit (mine are 300 x 300 pixels, for example) and saved as that and not saved full screen, and the file name should be something like ...

"images/side awesome_jack.png"

The space between "side" and the character name is required.

and for other sides (to convey emotions, for example) , you just add the descripter after the character name (with a space), like so ...

"images/side awesome_jack.png" is called by jack "blah, blah ..." - Neutral side image

"images/side awesome_jack angry.png" is called by jack angry "blah, blah ..."

"images/side awesome_jack sad.png" is called by jack sad "blah, blah ..."

Haven't you forgot to define the side image?
image side awesome_jack = "whatever image that is the default one"
That's actually something that is kind of confusing, because I have never had to declare any side images in my VN's. And I have never had an error because of that. AFAIK, Ren'py scans your game directory and automatically creates a pool of image attributes from any image with a 'side' tag.

So, for example, if you declare jack with an image tag like ...

jack = Character("Awesome Jack", image="awesome_jack")

... and you only have one side image for them, then the pool will only have one entry - "awesome_jack" and will use any image named that with a corresponding side tag. ("images/side awesome_jack.png")

When you have multiple tags for that same character, then Ren'py tries to find the best match and if it can't find an exact image that matches that, then it uses the top one from the pool. So if you did this ...

jack frustrated "blah, blah ..."

... but you didn't include a "images/side awesome_jack frustrated.png" image, then Ren'py would default to the "images/side awesome_jack.png"


In the Ren'py DOCS on the subject, they do show examples of declaring side images, but I believe that's just to give example to how it resolves conflicts. In any case, I doubt it would hurt to decalre side images, but I've never ran into an error not declaring them - YET - and I'm on Ren'py 8.3.1 right now. I have had regular game images go from working fine one release, to not being found in an updated version and then I had to declare them. So I basically declare all images now, except the main scene ones, because that would be just silly having to declare a few thousand more images.

In any case, to the OP's original problem, I suspect it's probably an improperly saved image (like it is saved full screen, but it needs to be small) or there might not be a space between 'side' and the image file name. Another possibility I have seen is that the dev put the side images in the GUI folder, which definitely would require them to be declared, because Ren'py will look in the IMAGES folder for them by default, not the GUI.

EDIT: Just thought of one other possible thing that could cause this... When making major changes to the code, such as adding defines and new variables, it's always a good idea to Force a Recompile via the SDK menu.
 
Last edited:

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
11,578
17,789
That's actually something that is kind of confusing, because I have never had to declare any side images in my VN's. And I have never had an error because of that. AFAIK, Ren'py scans your game directory and automatically creates a pool of image attributes from any image with a 'side' tag.
What only works if the images (as on the hard drive) are named "side [WHATEVER]", because Ren'Py will then automatically declare then correctly. But one can perfectly have name just "[WHATEVER]", and still want to use them as side image. In which case you'll have to declare them explicitly.
And it's more frequent than it seem since something like "images/side/girlA/side girlA smilling.jpg" would be a bit redundant. This while having them all mixed with the other image is a bit messy.

Personally I'm tempted to advice for an explicit declaration, especially when you works only punctually on your game, because it's really easy to forget that the image name need the said "side" prefix.


When you have multiple tags for that same character, then Ren'py tries to find the best match and if it can't find an exact image that matches that, then it uses the top one from the pool. So if you did this ...
What is Ren'Py's behavior for absolutely all images.


In any case, to the OP's original problem, I suspect it's probably an improperly saved image (like it is saved as full screen, but it needs to be small)
Ren'Py do not care about this. Give it a side image three time bigger than the screen, and he will still display it as side image, and at its actual resolution.


or there might no be a space between side and the image file name. Another possibility I have seen done is that the devs put the side images in the GUI folder, which definitely would require them to be declared, because Ren'py will look in the IMAGES folder for them by default, not the GUI.
Or... he just named it "awesome_jack.ext", forgetting that all the other are named "side [whatever].ext"... Something that would be far to be new.
 

UncommonRole

Newbie
Jan 4, 2021
44
21
Hi again anne O'nymous and Turning Tricks . Sorry for taking so long to reply, but I’ve had two horrible days at work. Anyway, I’ve tried several of the things you suggested and nothing seems to work.

I'm interested in the part about changing the size like you said, but I don't know how to do it properly—I used the same code, but it doesn't work.

And here's the folder with the rest of the side images: they all follow the same pattern—"side" first, space, then the name, in .webp format, small sizes...

1744123739022.png

I've done this with at least 40 characters and it's the first time it fails. Also, the weird thing, as I mentioned, is that when I try to change anything else for other characters, those changes aren't applied either. I tried changing the color, for example, and nothing happens. I also did the "force recompile" thing—I already tried that before opening the thread, and it doesn’t work.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
11,578
17,789
I've done this with at least 40 characters and it's the first time it fails. Also, the weird thing, as I mentioned, is that when I try to change anything else for other characters, those changes aren't applied either.
Hmm... what happen if you do:
Python:
label start:
    show side awesome_jack
Does the image is shown?