Disable side image for 1 character [solved]

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
User avatar
korova
Veteran
Posts: 217
Joined: Sat Jun 27, 2009 5:15 pm
Completed: Ivy, Chocolate, Time, Clair Obscur
Projects: Writing exercises, The House [Nano18]
Tumblr: korova08
itch: korova
Location: Normandie, France
Contact:

Disable side image for 1 character [solved]

#1 Post by korova »

Hello !

I have a little problem with side image management.

I have two characters linked to the same character sprite with the tag "Laura"
First character is the MC "speaking", so I need the name and the side image.
my character is defined like that

Code: Select all

define l = Character("Laura", image = "laura") # MC "speaking"
and this is how it looks like :
Character speaking with side image
Character speaking with side image
The other one is the MC "thinking".and the character sprite is still on screen
Currently this character is defined like that

Code: Select all

define ln = Character(None, image = "laura", window_background = "gui/textbox_noname.png") #MC thinking mode
and it looks like this
Character thinking, current aspect (with side image)
Character thinking, current aspect (with side image)
I'd like to keep the image link for the character sprite, so that I can change the character sprite expressions with this syntax

Code: Select all

    ln panic "Oh, no! I must rush now, or I will be late..."
    ln "That would be bad for my first day..."
    ln sad "I'm worried about dad. I wish that he wouldn't persist in this crazy idea to live on the asteroid."
    ln "It seems awfully dangerous and I don't want to lose him too..."
    ln "What can I do ?"
Currently, as I have side images with "side laura" tags in my images folder, the side image shows itself. But I'd like to have no side image, only the character sprite, like that (mockup "screenshot")
Mockup => what I want to have
Mockup => what I want to have
Is there a way to do that in the character definition ? (I tried side_image = False, side_image=Null() and side_image=None with no success so far...)
Suggestions ?
Last edited by korova on Mon Apr 10, 2017 11:59 am, edited 1 time in total.

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: Disable side image for 1 character

#2 Post by indoneko »

You might want to modify the say screen to include another conditional before displaying the side image (i.e if the character name is None then don't show the side image)
My avatar is courtesy of Mellanthe

User avatar
korova
Veteran
Posts: 217
Joined: Sat Jun 27, 2009 5:15 pm
Completed: Ivy, Chocolate, Time, Clair Obscur
Projects: Writing exercises, The House [Nano18]
Tumblr: korova08
itch: korova
Location: Normandie, France
Contact:

Re: Disable side image for 1 character

#3 Post by korova »

I used you suggestion (but in my own way) to modify the say screen like that

Code: Select all

screen say(who, what, side_image = True):
    style_prefix "say"

    window:
        id "window"

        if who is not None:

            window:
                style "namebox"
                text who id "who"

        text what id "what"


    ## If there's a side image, display it above the text. Do not display on the
    ## phone variant - there's no room.
    if not renpy.variant("small") and side_image:
        add SideImage() xalign 0.0 yalign 1.0 xoffset -15 yoffset 15
and my new character definition is now

Code: Select all

define ln = Character(None, image = "laura", show_side_image = False, window_background = "gui/textbox_noname.png")
which allows me to manually disable side image.

And it works !

Thanks for your help !

Post Reply

Who is online

Users browsing this forum: No registered users