Ren'Py Chracter Image not showing up even if it exists

DirtyPants

Newbie
Sep 16, 2022
50
9
So my character image is not showing up even if it exists in the image folder. Screenshots are provided below:-
Code-
1666098680839.png
the "mc1" Character is not showing up, output in renpy-
1666098735391.png
1666098974741.png
Everything else before this is working and the code itself is also working, just that this character image is not showing up
 

mickydoo

Fudged it again.
Game Developer
Jan 5, 2018
2,446
3,557
mc1 is not there, just a folder named mc, or am I missing something?

Edit if mc1 is in that folder it needs to be mc/mc1 (I think, its late)
 
  • Like
Reactions: DirtyPants

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,968
16,222
mc1 is not there, just a folder named mc, or am I missing something?
The answer is "yes" to both. There's no image named "mc1", but you are also missing the first line of his code.



DirtyPants what are you trying to do exactly ?

You start by creating a object, therefore the object used to handle the dialogs. But you are providing it an image name in place of the name of the character. Then you are using this object to both display an image and dialog lines ; the first not working because there's no image named "mc1".

My guess is that you are trying to use what is called . If it's the case, your code should looks like this:
Python:
# Define the Character object, change the name by what you want.
define mc = Character( "Joey", image="mc" )

# Manually define the neutral side image.
# This is optional, see comment below.
image side mc neutral = "os_neutral2.jpg"

label chapter1:
    show ap
    # Select the neutral side image to display.
    mc neutral "Do you like this world ?"
    # The previous side image will be displayed until you define another one.
    mc "This shelfish world where people don't care about anyone except themselves."

    "Some narration for the example."
    # The side image stay defined even if another character talked in between.
    mc "Hey, it's me, [mc]."
Alternatively to the manual definition of each side image, you can also rely on Ren'Py .
In the "images" folder, create a sub folder (named whatever you want). In it, put your "os_neutral2.jpg" image, but rename it "side mc neutral.jpg".
With this, Ren'Py will automatically create the side images, avoiding you to have to declare them all manually. But you still need the image property when you create the Character object.
 
  • Like
Reactions: DirtyPants

DirtyPants

Newbie
Sep 16, 2022
50
9
mc1 is not there, just a folder named mc, or am I missing something?

Edit if mc1 is in that folder it needs to be mc/mc1 (I think, its late)
The answer is "yes" to both. There's no image named "mc1", but you are also missing the first line of his code.



DirtyPants what are you trying to do exactly ?

You start by creating a object, therefore the object used to handle the dialogs. But you are providing it an image name in place of the name of the character. Then you are using this object to both display an image and dialog lines ; the first not working because there's no image named "mc1".

My guess is that you are trying to use what is called . If it's the case, your code should looks like this:
Python:
# Define the Character object, change the name by what you want.
define mc = Character( "Joey", image="mc" )

# Manually define the neutral side image.
# This is optional, see comment below.
image side mc neutral = "os_neutral2.jpg"

label chapter1:
    show ap
    # Select the neutral side image to display.
    mc neutral "Do you like this world ?"
    # The previous side image will be displayed until you define another one.
    mc "This shelfish world where people don't care about anyone except themselves."

    "Some narration for the example."
    # The side image stay defined even if another character talked in between.
    mc "Hey, it's me, [mc]."
Alternatively to the manual definition of each side image, you can also rely on Ren'Py .
In the "images" folder, create a sub folder (named whatever you want). In it, put your "os_neutral2.jpg" image, but rename it "side mc neutral.jpg".
With this, Ren'Py will automatically create the side images, avoiding you to have to declare them all manually. But you still need the image property when you create the Character object.
Thank you both, I guess I was just being a dumbass.
Time to read the documentation again :')
 

moose_puck

Active Member
Sep 6, 2021
740
1,677
The answer is "yes" to both. There's no image named "mc1", but you are also missing the first line of his code.



DirtyPants what are you trying to do exactly ?

You start by creating a object, therefore the object used to handle the dialogs. But you are providing it an image name in place of the name of the character. Then you are using this object to both display an image and dialog lines ; the first not working because there's no image named "mc1".

My guess is that you are trying to use what is called . If it's the case, your code should looks like this:
Python:
# Define the Character object, change the name by what you want.
define mc = Character( "Joey", image="mc" )

# Manually define the neutral side image.
# This is optional, see comment below.
image side mc neutral = "os_neutral2.jpg"

label chapter1:
    show ap
    # Select the neutral side image to display.
    mc neutral "Do you like this world ?"
    # The previous side image will be displayed until you define another one.
    mc "This shelfish world where people don't care about anyone except themselves."

    "Some narration for the example."
    # The side image stay defined even if another character talked in between.
    mc "Hey, it's me, [mc]."
Alternatively to the manual definition of each side image, you can also rely on Ren'Py .
In the "images" folder, create a sub folder (named whatever you want). In it, put your "os_neutral2.jpg" image, but rename it "side mc neutral.jpg".
With this, Ren'Py will automatically create the side images, avoiding you to have to declare them all manually. But you still need the image property when you create the Character object.
Personally, I don't declare a "neutral" side image. Instead, I just use the character's declared image name (in this example "mc")

I do this for two reasons - first, because I am lazy and don't want to have to type "mc neutral" a hundred times when writing the dialogue script. :ROFLMAO:

The second reason is in case I fuck up and let a typo slip through. That way, the default (in my case "neutral") side image will be used instead of some other one that might look out of place, since - as I understand the - the only image in the pool that renpy created that comes close is the neutral "side mc.jpg" so it gets used by default.

One thing I have noticed though, is that the official documentation tends to use underscores, which I assume is because of a legacy from UNIX. And TBH, I tend to use underscores a lot - but only because I have been using computers a long time and try to avoid file naming convention do-overs. But with these side images and Ren'py, I do now make them with clear spaces and so far everything still functions OK. (including my no "neutral" lazyness, lol)
 
  • Like
Reactions: DirtyPants

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,968
16,222
Personally, I don't declare a "neutral" side image.
I agree with your reason, but I prefered to keep his example. It lead to less confusion when it come to understand the code.


One thing I have noticed though, is that the official documentation tends to use underscores, which I assume is because of a legacy from UNIX. And TBH, I tend to use underscores a lot - but only because I have been using computers a long time and try to avoid file naming convention do-overs. But with these side images and Ren'py, I do now make them with clear spaces and so far everything still functions OK. (including my no "neutral" lazyness, lol)
There's a backward compatibility issue with underscores, and the documentation isn't always up to date regarding images due to this.
Historically, the method used to generate automatically the image objects was stripping underscores, replacing them by spaces. At some point the method used changed, not stripping the underscores anymore, then it changed again with the 7.x branch, but still not stripping the underscores.

Side note:
The code for the historical method is still present, as well as its configuration value, but I do not recommend to use it. Images with stripped letters would be declared twice, what mean that both show stripped image and show stripped_images would works. This can be really confusing and don't help to stay attentive to what you write in your code.


And this close tonight episode of "Uncle AON is telling you how life was so different in the past".