change side image when character doesen't speak

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
zxcvbnm
Newbie
Posts: 3
Joined: Wed Nov 13, 2019 2:02 pm
Contact:

change side image when character doesen't speak

#1 Post by zxcvbnm »

Hi! I decided that in my game the main character will have a side image. I also want my mc to react to what other characters say and I don't know how to do this because I can only change side image before mc statments. For example:

Code: Select all

mc happy "I am happy."
mc sad "Now I am sad."
How can I change side image when someone else speaks or even when nobody speaks?

Code: Select all

mc happy "I am happy."
oc "Hello Happy. I am Other Character" #How to change mc side image here?
mc "I should be sad now."
I hope I wrote everything understandable, english is not my first language :oops: Please help

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: change side image when character doesen't speak

#2 Post by isobellesophia »

I guess you need to define another side image, as it seen here.

https://www.renpy.org/doc/html/side_ima ... characters
I am a friendly user, please respect and have a good day.


Image

Image


User avatar
arty
Regular
Posts: 120
Joined: Sat Jan 06, 2018 11:55 am
Completed: White Monday
Projects: HATE is a 4 Letter Word
Organization: KATHARSIS ART
itch: artys-games
Contact:

Re: change side image when character doesen't speak

#3 Post by arty »

I got around this in a somewhat hacky (?) way.

I added the MC's side image to the other characters as well.

Example, my main character looks like this:

Code: Select all

define r = Character("ROSWELL", image="roswell", window_left_padding=240)
Now, for every other character where I want the side image of the MC to show as well, I define them like this:

Code: Select all

define ts = Character("TAYLOR", image="roswell", window_left_padding=240)
You see, it's basically the same definition.

Now, you can use the modifiers on both characters and when both speak, the side image will show. You need to remember though that since they're still different characters technically, you need to add the modifiers "twice". Like this:

Code: Select all

    ts "Boss! What are you doing here?!"
    r frown "I could ask you the same."
    ts frown "We, uh... live here?"
    r "In this cafe?"
    ts "Uhh."
As for showing the side image when no one speaks, I haven't tried this solution since I don't need it for my own project, but you should be able to do it like this:

Code: Select all

define narrator = Character (None, image="yourmcsimage", window_left_padding=240)
Where you replace "yourmcsimage" with the side image for your character and the 240 under window_left_padding with any number of pixels suitable for your side image.

zxcvbnm
Newbie
Posts: 3
Joined: Wed Nov 13, 2019 2:02 pm
Contact:

Re: change side image when character doesen't speak

#4 Post by zxcvbnm »

arty wrote: Sun Nov 24, 2019 5:07 am I got around this in a somewhat hacky (?) way.

I added the MC's side image to the other characters as well.

Example, my main character looks like this:

Code: Select all

define r = Character("ROSWELL", image="roswell", window_left_padding=240)
Now, for every other character where I want the side image of the MC to show as well, I define them like this:

Code: Select all

define ts = Character("TAYLOR", image="roswell", window_left_padding=240)
You see, it's basically the same definition.

Now, you can use the modifiers on both characters and when both speak, the side image will show. You need to remember though that since they're still different characters technically, you need to add the modifiers "twice". Like this:

Code: Select all

    ts "Boss! What are you doing here?!"
    r frown "I could ask you the same."
    ts frown "We, uh... live here?"
    r "In this cafe?"
    ts "Uhh."
As for showing the side image when no one speaks, I haven't tried this solution since I don't need it for my own project, but you should be able to do it like this:

Code: Select all

define narrator = Character (None, image="yourmcsimage", window_left_padding=240)
Where you replace "yourmcsimage" with the side image for your character and the 240 under window_left_padding with any number of pixels suitable for your side image.
That worked! :D Thank you so much, I really appreciate that <3

User avatar
arty
Regular
Posts: 120
Joined: Sat Jan 06, 2018 11:55 am
Completed: White Monday
Projects: HATE is a 4 Letter Word
Organization: KATHARSIS ART
itch: artys-games
Contact:

Re: change side image when character doesen't speak

#5 Post by arty »

No problem, I'm glad you could get it to work! :)

Post Reply

Who is online

Users browsing this forum: Google [Bot]