[SOLVED] Sprite keeps dissapearing after another show

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
Hollace
Newbie
Posts: 13
Joined: Sat Jul 01, 2017 7:27 am
Deviantart: HollaceDay
Contact:

[SOLVED] Sprite keeps dissapearing after another show

#1 Post by Hollace »

I've been busy on my new visual novel and for some reason ever since I started using Jedit, this strange glitch keeps occurring. I want two characters to be shown on the screen at once! I've been trying all kinds of ways to get it to work, but every code that I try keeps making the first character disappear. I've tried to change the image directories, change the order, change the transitions, the positions, but for some reason, it doesn't change. I had this problem before and thought it had to do with that specific code. Thank God for that part of the game, having to show two characters weren't specifically necessary. Yet it has returned to me again where it is really necessary. I'm frustrated that it doesn't seem to wanna change and I wish you could help me with this problem!

the code where the second character comes in goes like this;

Code: Select all

            show sp caroline surprised aws at right with move
            show sp hollace angry aws1 at left with moveinleft
            
            "Everyone looks on over to the voice"
            
            hide sp caroline surprise aws
            show sp caroline annoyed aws at right
This code currently only shows the "sp caroline surprised aws" for a split second until "sp hollace angry aws1" comes in and appears from caroline's position. Then moves back to the left.

I know there must be a very simple way of perhaps defining the images or something like that. Currently, I don't have my images defined, I did before but I thought maybe that it was the problem. So these images are currently loose in the images folder. I really need help with this as I am planning to do more of this kind of way of showing my characters at the same time. I really want to keep the move and position as well!
Last edited by Hollace on Tue Jul 18, 2017 8:17 am, edited 1 time in total.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Sprite keeps dissapearing when new sprite is shown, help

#2 Post by Donmai »

That's because both sprites have the same name tag ("sp" in this case). You should give them different tags or they will overwrite each other when they are shown.
See here: https://www.renpy.org/doc/html/displayi ... html#image
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Sprite keeps dissapearing when new sprite is shown, help

#3 Post by Remix »

You could also possibly use the as keyword if you wanted the same base named sprite twice

show sp caroline surprised aws as sprite_one at right with move

then reference sprite_one or whatever in further changes
Frameworks & Scriptlets:

User avatar
Hollace
Newbie
Posts: 13
Joined: Sat Jul 01, 2017 7:27 am
Deviantart: HollaceDay
Contact:

Re: Sprite keeps dissapearing when new sprite is shown, help

#4 Post by Hollace »

Donmai wrote:That's because both sprites have the same name tag ("sp" in this case). You should give them different tags or they will overwrite each other when they are shown.
See here: https://www.renpy.org/doc/html/displayi ... html#image
ah! I see it now, thank you very much, I've changed it and it all seems to work now. Thank you!

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: [SOLVED] Sprite keeps dissapearing after another show

#5 Post by Donmai »

Remix suggestion will also work, but it's better to use different tags for different characters. Tags are practical because using them we don't need to use the hide command all the time. A good use for the "show as" clause is when we really need to show the same sprite twice, as it's demonstrated in the Ren'Py Tutorial game (the Eileen twins).
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Post Reply

Who is online

Users browsing this forum: Bing [Bot]