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.
# characters are defined as jack and jill
image jack_sprite = "jack.png"
image jill_sprite = "jill.png"
image side jack_face = "jack_face.png"
image jill = "jill_face.png"
label start:
show jack_sprite at left
jack jack_face "Hi Jill"
show jill_sprite at right
jill jill_face "Hi Jack"
jack jack_face "Great weather we are having today."
jill jill_face "Indeed."
It can be seen for side image usage, the side image has to be declared each time (from what I know). I want to know if it is possible for Ren'Py to automatically use the last used side image without defining it over and over. For example:
# characters are defined as jack and jill
image jack_sprite = "jack.png"
image jill_sprite = "jill.png"
image side jack_face = "jack_face.png"
image jill = "jill_face.png"
label start:
show jack_sprite at left
jack jack_face "Hi Jill"
show jill_sprite at right
jill jill_face "Hi Jack"
jack "Great weather we are having today." #jack side image not declared but I wish for it to autoshow
jill "Indeed." #same here. I wish to used the last declared side image without typing it in
So in this case, once jack_face and jill_face have been used, I want them to be show in every dialogue for Jack/Jill till I change it. Furthermore, if this is possible, I would like to know how to prevent side images to be shown in places where I don't wish to automatically populate with a side image (such as in novel mode).
Last edited by famakki1 on Thu Mar 23, 2017 1:51 am, edited 1 time in total.
image jack sprite = "jack.png"
image jill sprite = "jill.png"
image side jack = "jack_face.png"
image side jill = "jill_face.png"
label start:
show jack_sprite at left
jack "Hi Jill"
show jill_sprite at right
jill "Hi Jack"
jack "Great weather we are having today."
jill "Indeed."
I would like to know how to prevent side images to be shown in places where I don't wish to automatically populate with a side image (such as in novel mode).
Default NVL screen does not show side images. If you create your own screen, it is easy to not show side images: just do not add them to your screen. (And if you want to show side images, you need to add displayable SideImage() to thst screen somewhere)
First of all check if you linked image tag with a character. Like this define jack = Character("jack", image='jack')
And yes, underscores do matter. RenPy treats space separated names as series of tags. It then tries to show image with most matching tags as side image.
For example, in code you posted, first image has tags 'jack' and 'happy_big', side image has tags 'jack' and 'happy_face'. Only common tag is 'jack'. On the other hand, if you separate word with spaces, tags would be 'jack', 'happy', 'big' and 'jack', 'happy', 'face' respectively. Two tags in common.
Notice that if there are two images with the same amount of matching tags, then there is an ambiguity and no image is shown.
Thanks for your feedback and help so far ! I managed to get the auto-side image working. I followed your instructions and removed the underscores as a first step. It wasn't still working. Then I realized I had declared image tags as image = "Tony " instead of image = 'Tony'.
I think that extra space in the image tags prevented correct functionality, I was forced to do it previously due to underscores (eg. tony happy_big). But now I have defined all images as, eg. tony happy big , format. I am not sure if double quotes or apostrophe difference matters but for now I'll stick with the apostrophes to define image tag.
" is the same as ', but they can both be used for the same thing.
Sometimes, if you want to use " in a sentence, you need to use escapes in your script or you can just use the other quote.
For example, you have a line of dialogue, both of the following will display "Tony" saying Hi, I'm "Tony."