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 use side images in this one game I'm making, but at certain parts of the game I'd rather not have them there (and just have the blank space on the left side of the text box). Can anyone help me with this? I've looked on the wiki and the manual but I haven't been able to find how to do this.
This is the code that I'm using at the moment to create side images:
But I want to be able to hide side images, too. Do I need to use a new code from the start altogether? I'd like to avoid that, as I already have a good portion of the game down.
# Other say screen code
if should_show_side_image:
add SideImage()
Looking at the screens link, I think I understand. Would using the above negate the use of config.side_image_tag = "image"?
Imperf3kt wrote:An even easier way, if you cannot understand the above link, is just define a second character with the same name but no side image defined.
Ah, I actually wanted to keep my MC's face there even when another character was talking, so I used config.side_image_tag = "image"... defining another person won't work, I think.
Hi! I know it's an old topic but I have just the same problem. I warn you in advance that I don't know programming at all and I am just starting with Renpy.
I wanted to bring and hide side image on my command so I typed:
screen say(who, what):
style_prefix "say"
window:
id "window"
if who is not None:
window:
id "namebox"
style "namebox"
text who id "who"
text what id "what"
if not renpy.variant("small"):
add SideImage() xalign 0.0 yalign 1.0
if should_show_side_image:
add SideImage()
But when I launch the game it crashes and in my traceback file i have this error:
File "game/screens.rpy", line 118, in execute
if should_show_side_image:
NameError: name 'should_show_side_image' is not defined
I know it's probably very dumb question but how can I define this should_show_side_image? Or maybe I made a mistake somewhere else?
In addition, I combined the extra flag with the variant check to avoid displaying the side image on non-small variant, when should_show_side_image is False:
# screens.rpy
screen say(who, what):
...
## When you need to show side image, set should_show_side_image to True just the time you need it
## It is defaulted to False in script.rpy
if not renpy.variant("small") and should_show_side_image:
add SideImage() xalign 0.0 yalign 1.0