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.
I was wondering if it would be possible to change a side image (expression) even though this particular character isn't speaking at the moment. I looked at https://www.renpy.org/doc/html/side_image.html and managed to make it work to a certain degree. But I keep getting an error saying the image can't be found even though the expression clearly changed. 🠚 Image 'maincharacter happy' not found
It's maybe also good to mention that our side image will stay on screen all the time. I really want to make his work. I think it adds a lot to the story
screen say(who, what, side_image=None, two_window=False):
# Decide if we want to use the one-window or two-window variant.
if not two_window:
# The one window variant.
window:
id "window"
has vbox:
style "say_vbox"
if who:
text who id "who"
text what id "what"
else:
# The two window variant.
vbox:
style "say_two_window_vbox"
if who:
window:
style "say_who_window"
text who:
id "who"
window:
id "window"
has vbox:
style "say_vbox"
text what id "what"
# If there's a side image, display it above the text at given position.
add SideImage() xpos 47 ypos 573
Thanks for reading this thread!
Last edited by Smaymay on Sun Aug 26, 2018 3:05 pm, edited 1 time in total.
"Since I used to use LiveComposite and ConditionSwitch for sprites including the side sprite, I could change the side image's expressions with a $ variable any time I want, even if the character isn't talking. "
Skyeworks
Thank you for leaving a reply and linking these threads. They were quite useful. But in the end, I found the solution here: viewtopic.php?t=35598
Now I'm able to change the expression of my mc even if she's not speaking. Here's the updated code for anyone who's interested or wants to achieve the same thing:
window show
MC neutral "I'm so bored."
show john neutral at center
J happy "Hey!" #John is speaking but the MC's expression changes to happy.
N "He hands you a present."