Page 1 of 1

[SOLVED] Sprite keeps dissapearing after another show

Posted: Tue Jul 18, 2017 7:01 am
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!

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

Posted: Tue Jul 18, 2017 8:07 am
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

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

Posted: Tue Jul 18, 2017 8:11 am
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

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

Posted: Tue Jul 18, 2017 8:18 am
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!

Re: [SOLVED] Sprite keeps dissapearing after another show

Posted: Tue Jul 18, 2017 8:43 am
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).