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.
Weird problem, I know. Here's the deal: I have a background .png image at 992x600 being shown with the "scene" command. One character is talking to the protag. I hide her sprite. Then I want hers and a second character's sprite to appear, but for some reason the background disappears when the second character appears. Here's part of the code:
"As if he could hear my thoughts, Lukas' silhouette appears at the end of the road, running toward his house."
"...He looks worried.{w} He doesn't have a security camera streaming to his phone, does he...?"
show lukas smile coat at left with dissolvesprite
show rin waah coat at right with dissolvesprite
lu "Hey!{w} Sorry I'm late, I had to run out and grab some stuff for lunch. Did I keep you guys waiting long?"
The background vanishes at the "show lukas... etc" command. Don't worry about dissolvesprite, that's just dissolve with a different timing which I've used elsewhere in the game.
Any ideas as to what might cause this? I don't know where to start because it really doesn't make sense. Similar situations arise everywhere in the game and I've never seen this problem.
Yeah see that's why Alex asked, because you have a BG and a sprite both with "lukas" as the first keyword. So the game just interprets both of them as two parts of the same set. (like "lukas smile" vs "lukas frown" or something) Whenever you do "show lukas smile" it'll automatically clear "lukas house", too, so they won't both be on the screen at the same time. To avoid this, just rename your BG to something else.
It can be troublesome in situations like the one you were having, but it's generally a really neat feature of ren'py, because it makes it possible to easily and quickly switch between different facial expressions of a same sprite without having to each time type hide it and show the new one.
Just showing the new one makes ren'py automatically replace the old sprite with the new one.
(I drew my avatar especially to express the scary feeling I get from the code as I type it... XD)