Background image is disappearing

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
ETERNAL
Regular
Posts: 47
Joined: Sun Aug 10, 2008 4:13 pm
Projects: Sepia Tears
Location: Toronto, Canada
Contact:

Background image is disappearing

#1 Post by ETERNAL »

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:

Code: Select all

      "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.

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

Re: Background image is disappearing

#2 Post by Alex »

And what is the name for bg image - isn't it "lukas bg"?

User avatar
ETERNAL
Regular
Posts: 47
Joined: Sun Aug 10, 2008 4:13 pm
Projects: Sepia Tears
Location: Toronto, Canada
Contact:

Re: Background image is disappearing

#3 Post by ETERNAL »

no, it's "lukas house" and it's shown waaaay before that so I didn't want to copy/paste the whole thing. The line just says...

Code: Select all

      scene lukas house with dissolve

User avatar
Camille
Eileen-Class Veteran
Posts: 1227
Joined: Sat Apr 23, 2011 2:43 pm
Completed: Please see http://trash.moe
Projects: the head well lost
Organization: L3
Tumblr: narihira
Deviantart: crownwaltz
itch: lore
Contact:

Re: Background image is disappearing

#4 Post by Camille »

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.

User avatar
ETERNAL
Regular
Posts: 47
Joined: Sun Aug 10, 2008 4:13 pm
Projects: Sepia Tears
Location: Toronto, Canada
Contact:

Re: Background image is disappearing

#5 Post by ETERNAL »

Oh, thanks! You're right. I had no idea Ren'py worked like that.

Soraminako
Veteran
Posts: 277
Joined: Sun Sep 04, 2011 1:36 am
Projects: A thingie without a title. With messy code.
Contact:

Re: Background image is disappearing

#6 Post by Soraminako »

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)

Post Reply

Who is online

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