Have a Consistently Present Side Image?

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
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Have a Consistently Present Side Image?

#1 Post by ArizaLuca »

So, I would like to have my protagonist consistently displayed alongside the text, regardless of if she is the one speaking. Is there any way that I can do this? (An example of this would be 'The Blind Griffin' by Asphodel Quartet and 'Valentine's Otome' by Synokoria.

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Have a Consistently Present Side Image?

#2 Post by kivik »

Do you want the image to fade to black when you change scenes? Or will it be ok for the image to show even when everything else fades out?

If you don't mind it constantly being there even across scenes - create a new layer in config.layers: https://www.renpy.org/doc/html/config.h ... fig.layers
Here's a bit more about how the layers are used: https://www.renpy.org/doc/html/displayi ... html#layer

Depending on whether the image should be on top of everything else, you may want to create one right at the top (last in the list) and show the image on that layer.


If you want the image to fade with scenes, you'd need to show it with each scene statement you use, e.g.:

Code: Select all

scene bg room
show player at side_panel #you need to create the side_panel transform, something like xalign 1.0 for far right.
with dissolve
You could also create a label / function that takes the scene and transition and automatically show the image at the same time, so you can do it in one line of code.

ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Have a Consistently Present Side Image?

#3 Post by ArizaLuca »

Hmm, I don't think that's quite right...

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Have a Consistently Present Side Image?

#4 Post by kivik »

ArizaLuca wrote: Fri May 18, 2018 11:31 am Hmm, I don't think that's quite right...
Care to elaborate? That statement doesn't offer anything to allow further help...

ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Have a Consistently Present Side Image?

#5 Post by ArizaLuca »

Have you played Valentine's Otome or The Blind Griffin? Those two games give a better idea of what I'm looking for...

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Have a Consistently Present Side Image?

#6 Post by kivik »

I've not played those games, so perhaps you can post a screenshot? The more you share, the easier it is to help...

ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Have a Consistently Present Side Image?

#7 Post by ArizaLuca »

https://img.itch.zone/aW1hZ2UvMTkxNjE0L ... qlpkkg.png

https://img.itch.zone/aW1hZ2UvMTk4OTIvO ... PJQVb8.png

Those two are fairly good examples; if you need to you can head to their various websites (just look it up on itch.io) and they'll have some more.

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Have a Consistently Present Side Image?

#8 Post by kivik »

So just to be clear: you want there to be side images for the dialogues, but for it to be the player's image instead of whoever's speaking?

This config variable seems to be what you need:

https://www.renpy.org/doc/html/side_ima ... _image_tag

ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Have a Consistently Present Side Image?

#9 Post by ArizaLuca »

That seems to have worked; thank you! What if you want to switch perspectives, thereby switching the player image to a different character? Do you know how this would work then?

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Have a Consistently Present Side Image?

#10 Post by kivik »

The easiest thing to do is probably creating a specific image for the portraits, and use text interpolation:

Code: Select all

define config.side_image_tag = "portrait"
image portrait = "portraits/[portrait_image].png"
default portrait_image = "player"

...

$ portrait_image = "eileen"

ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Have a Consistently Present Side Image?

#11 Post by ArizaLuca »

Ah... that's helpful, but I'm not entirely sure I understand how that's supposed to work? Can you please explain a little further? (I'm so sorry about bugging you by the way; thank you so much for dealing with my being a total newb xD)

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Have a Consistently Present Side Image?

#12 Post by kivik »

No problems.

So if I understand correctly (I haven't tried it myself), the config variable takes an image tag name, and will always display that image tag as side image for dialogues. So in my code, I've put in "portrait" so it should always use my portrait image. In practice you should be able create a series of images like portrait happy, portrait sad etc. but it doesn't make sense in this case.

So our image portrait is "portraits/[portrait_image].png" - well I'd suggest you put all these specific portraits in the same folder if you have dedicated portraits. Then portraits/player.png is the player portrait, portraits/eileen.png is the eileen portrait. You just need to have the ones that you want.

Alternatively if you want to use normal character portraits, you can do that too, so long as you can create an image path convention that you can substitute the portrait name - e.g. player, eileen, martha, etc.

The [portrait_image] part of the string gets interpolated by the Renpy engine when it displays the image, it knows that anything between [] brackets are variables, so it looks for the portrait_image variable and put whatever is in it as part of the image filename. So:

if portrait_image == "player" then image portrait = "portraits/player.png"
if portrait_image == "eileen" then image portrait = "portraits/eileen.png"

You just need to change the portrait_image variable, and it'll change the portrait image for you. So in the example above, portrait_image starts off with "player" so the game will always display portraits/player.png to start with, until it hits the line $ portrait_image = "eileen", then it'll start displaying portraits/eileen.png instead.


Hope I've explained that ok, if not, point out what bit doesn't and I'll try another way.

ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Have a Consistently Present Side Image?

#13 Post by ArizaLuca »

Ahhh, thank you so much. This really helped!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot]