[Solved] Problem, Side Image stays on the screen

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
Skaiya
Regular
Posts: 95
Joined: Tue Sep 25, 2012 5:42 pm
Projects: My Lovely Pastry, Crystal Diamonds Shatter, IWSTBMTB
Tumblr: skaiya-art
Deviantart: skaiyaart
Location: The Netherlands
Contact:

[Solved] Problem, Side Image stays on the screen

#1 Post by Skaiya »

Hello there^^

Sorry if the question was already asked I tried to find it but maybe I typed in the wrong words..

Ok so here is the problem:

I recently started to use Ren'Py and I added a Side Image when one of the characters was talking.
But when someone else was on the screen the Side Image stays on the screen and I want it to go away when I hide the characters' image..

Code: Select all

# Images
image felenoira_normal = "felenoira ys novel v2.png"
image side felenoira = "felenoira side.png"

# characters
define f = Character("Felenoira", color="#6495ED", image="felenoira", window_left_padding=200) 
init python:
     config.side_image_tag = "felenoira"
     config.side_image_only_not_showing = False
so her side image shows and is on the right place and when her normal image goes off screen her side image goes off screen as well but when a different character is on screen her side image pops up again.. and I want it to be hidden when someone else is talking.

I put the code in just in case.. I don't know if I need to show more.
I hope someone can help me with this.
Last edited by Skaiya on Fri Sep 28, 2012 5:28 am, edited 1 time in total.

apricotorange
Veteran
Posts: 479
Joined: Tue Jun 05, 2012 2:01 am
Contact:

Re: Problem, Side Image stays on the screen

#2 Post by apricotorange »

Code: Select all

     config.side_image_tag = "felenoira"
That basically means "always use a side image with the tag 'felenoria', regardless of who is speaking". It sounds like that isn't what you want; I'm having trouble following your description of how you want it to work.

User avatar
Skaiya
Regular
Posts: 95
Joined: Tue Sep 25, 2012 5:42 pm
Projects: My Lovely Pastry, Crystal Diamonds Shatter, IWSTBMTB
Tumblr: skaiya-art
Deviantart: skaiyaart
Location: The Netherlands
Contact:

Re: Problem, Side Image stays on the screen

#3 Post by Skaiya »

apricotorange wrote:

Code: Select all

     config.side_image_tag = "felenoira"
That basically means "always use a side image with the tag 'felenoria', regardless of who is speaking". It sounds like that isn't what you want; I'm having trouble following your description of how you want it to work.
I had trouble showing a Side Image in the first place it always went in the center at the bottom and also behind the dialogue.. if I use xalign and yalign it always gives me an error.. so that is why I used that code but I didn't know it would always use the side image regardless who is speaking.. I just want a side image only when someone is speaking. So basically I used the wrong code xD but like I said when I use xalign and yalign it gives me errors so I didn't know what to do..

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Problem, Side Image stays on the screen

#4 Post by Alex »

As documentation said "The position of the side image can be changed by customizing the say or nvl screens."
http://www.renpy.org/doc/html/side_imag ... tomization

User avatar
Skaiya
Regular
Posts: 95
Joined: Tue Sep 25, 2012 5:42 pm
Projects: My Lovely Pastry, Crystal Diamonds Shatter, IWSTBMTB
Tumblr: skaiya-art
Deviantart: skaiyaart
Location: The Netherlands
Contact:

Re: Problem, Side Image stays on the screen

#5 Post by Skaiya »

Alex wrote:As documentation said "The position of the side image can be changed by customizing the say or nvl screens."
http://www.renpy.org/doc/html/side_imag ... tomization
I looked there and got the code I have shown above but I get confused with the last 2 codes and I don't know where to put them because it gives me errors with the xalign and yalign again.

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Problem, Side Image stays on the screen

#6 Post by Alex »

Try to completely remove

Code: Select all

init python:
     config.side_image_tag = "felenoira"
     config.side_image_only_not_showing = False
And how do your say screen code looks like?

User avatar
Skaiya
Regular
Posts: 95
Joined: Tue Sep 25, 2012 5:42 pm
Projects: My Lovely Pastry, Crystal Diamonds Shatter, IWSTBMTB
Tumblr: skaiya-art
Deviantart: skaiyaart
Location: The Netherlands
Contact:

Re: Problem, Side Image stays on the screen

#7 Post by Skaiya »

Code: Select all

# Images
image felenoira_normal = "felenoira ys novel v2.png"
image bg_blocks = "blokjes spel.png"
image side felenoira = "felenoira side.png" 
image bunny_normal = "the bunny girl.png"
image bunny_happy = "the bunny girl2.png"

# characters
define f = Character("Felenoira", color="#6495ED", image="felenoira", window_left_padding=200) 
define b = Character("Bunny_girl", color="#8B0000")


init:
    $ dissolve = Dissolve(0.5)

# The game starts here.
label start:
    
    scene bg_blocks
    show felenoira_normal
    with dissolve
    
    f  "....."
    f  ".........."
    f  "Welcome.."
    f  "There are several endings and achievements to get in this game."
    f  "Have fun playing YS Novel"
    
    hide felenoira_normal
    with dissolve

define flash = Fade(0.1, 0.0, 0.5, color="#fff")

label choosing:
    
    show bunny_normal
    b "Hello there!"
    b "This will be a little character select test"
    
    show bunny_normal at left with move
    show felenoira_normal at right with move
    menu:
        "Please choose a character."
        "Character A":
            jump character_a_start
        "Character B":
            jump character_b_start
            
label character_a_start:
    
label character_b_start:
    
    
    
return
this is all I have at the moment..

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Problem, Side Image stays on the screen

#8 Post by Alex »

The code for say and nvl screens is in "screens.rpy". And if you didn't change it everything should work fine. In your code there is no side image for bunny-character.
Sidenote, you have "bunny_normal" and "bunny_happy" images - they will not replace eachother as you could expect them to do 'cause you named them as single words (should be "bunny normal" and "bunny happy" - two words, so "bunny" would be the tag for set of images).

User avatar
Skaiya
Regular
Posts: 95
Joined: Tue Sep 25, 2012 5:42 pm
Projects: My Lovely Pastry, Crystal Diamonds Shatter, IWSTBMTB
Tumblr: skaiya-art
Deviantart: skaiyaart
Location: The Netherlands
Contact:

Re: Problem, Side Image stays on the screen

#9 Post by Skaiya »

Alex wrote:The code for say and nvl screens is in "screens.rpy". And if you didn't change it everything should work fine. In your code there is no side image for bunny-character.
Sidenote, you have "bunny_normal" and "bunny_happy" images - they will not replace eachother as you could expect them to do 'cause you named them as single words (should be "bunny normal" and "bunny happy" - two words, so "bunny" would be the tag for set of images).
I didn't make her a side image yet. and I read in other threads then when a code didn't work the words should have been with the _ between them so I did that too.. also I just wanted to get the side image for the first one to work but then again it never did neither when the bunny girl wasn't in it yet. I just want a code to make it work I tried it with xalign and yalign then I get errors if I say it has to show at left it works but then it is behind the dialogue and how I had it now it worked perfectly, except, when I didn't have the bunny girl in it yet I started to see if a menu worked and then also her side image appeared for no reason. I don't know if I am clear..

do I have to delete the bunny things first so I can try to make it work for felenoira again? then again I have no idea how to make it work without the tag.

Oh and I haven't done anything in the other scripts

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Problem, Side Image stays on the screen

#10 Post by Alex »

If you use the code you have posted befor everything should work fine (sideimage should appear at left above the textbox). And didn't you use an old save - after some changes in code you must start the game from the very beginning?
I don't get where you trying to use xalign, but if you want to change the position of sideimage you need to find say screen in "screens.rpy"

Code: Select all

screen say:

    # Defaults for side_image and two_window
    default side_image = None
    default two_window = False

    # Decide if we want to use the one-window or two-window varaint.
    if not two_window:

        # The one window variant.        
        window:
            id "window"

            has vbox:
                style "say_vbox"
                xfill True
                

            hbox:
                xfill True
                
                if who:
                    text who id "who"
                use my_quick_menu
                
    
            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"
                    xfill True
                use quick_menu

                text what id "what"
              
    # If there's a side image, display it above the text.
    if side_image:
        add side_image
    else:
        add SideImage() xalign 0.0 yalign 1.0                                     ### <==== here you can change position

    # Use the quick menu.
    use quick_menu

User avatar
Skaiya
Regular
Posts: 95
Joined: Tue Sep 25, 2012 5:42 pm
Projects: My Lovely Pastry, Crystal Diamonds Shatter, IWSTBMTB
Tumblr: skaiya-art
Deviantart: skaiyaart
Location: The Netherlands
Contact:

Re: Problem, Side Image stays on the screen

#11 Post by Skaiya »

Alex wrote:If you use the code you have posted befor everything should work fine (sideimage should appear at left above the textbox). And didn't you use an old save - after some changes in code you must start the game from the very beginning?
I don't get where you trying to use xalign, but if you want to change the position of sideimage you need to find say screen in "screens.rpy"

Code: Select all

screen say:

    # Defaults for side_image and two_window
    default side_image = None
    default two_window = False

    # Decide if we want to use the one-window or two-window varaint.
    if not two_window:

        # The one window variant.        
        window:
            id "window"

            has vbox:
                style "say_vbox"
                xfill True
                

            hbox:
                xfill True
                
                if who:
                    text who id "who"
                use my_quick_menu
                
    
            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"
                    xfill True
                use quick_menu

                text what id "what"
              
    # If there's a side image, display it above the text.
    if side_image:
        add side_image
    else:
        add SideImage() xalign 0.0 yalign 1.0                                     ### <==== here you can change position

    # Use the quick menu.
    use quick_menu

well this is odd.. I looked at the code though it didn't had xfill? I added it don't know what it does though xD but everything seems to work perfectly now. Side image shows when the person talks and when bunny girl shows up side image goes away and there is none to be seen as it should be now..

I have no idea what went wrong but thanks for your help^^
My dA
My Tumblr
Currently working on:
My Lovely Pastry, Crystal Diamonds Shatter, IWSTBMTB.

Post Reply

Who is online

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