Issue with loading images

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
bleep
Newbie
Posts: 3
Joined: Tue Dec 31, 2013 4:05 pm
Contact:

Issue with loading images

#1 Post by bleep » Tue Dec 31, 2013 4:19 pm

Hello, I just started with Ren'py yesterday and an really enjoying it. I'm just about done with the demo I'm working on, however I've encountered a small issue. And do forgive me if this is painfully obvious stuff.

I'm having issues loading the same images twice. All of my images are static and I'm using the "load imgx" function to bring them up followed by the text for the respective section.

However it seems to only let me be using an image once. Also, for some reason it's just completely ignoring one of my images.

Here's an example of an image not loading more than once

First place:

Code: Select all

    show img1
    
    m "Hi!"
    
    show img2
    
    m "I'm Millie."
etc. That loads just fine. But later,

Second, trouble area:

Code: Select all

    show img49
    
    s "H-hey!  Wait up!"
    
    show img1
    
    m "And with that, we were off on an adventure!"
It keeps img49 on the screen and continues the dialogue. And it also refuses to bring up any additional images such as the final screen which is right after the dialogue

Code: Select all

    show img50demo
    
    stop music fadeout 5.0
    
    nar "Thanks for playing our demo!  I hope you enjoyed it and are looking forward to the full version!"
It still stick with img49.

So any help would be appreciated. I need img1 loaded several times, as it's just a blank image. I tried making copies and renaming them and that seemed to work, but I would like to keep it to as few images as possible to save o space.

Thanks.

User avatar
FrozenApple66
Regular
Posts: 147
Joined: Fri Sep 20, 2013 1:41 am
Projects: Lunescara (Hiatus) The Cottage (NaNo16)
Organization: Pink Squirrel Games
Contact:

Re: Issue with loading images

#2 Post by FrozenApple66 » Tue Dec 31, 2013 6:06 pm

What may help is if you put hide img49 before show img1 (this is just a guess I don't know what load imgx means)

bleep
Newbie
Posts: 3
Joined: Tue Dec 31, 2013 4:05 pm
Contact:

Re: Issue with loading images

#3 Post by bleep » Tue Dec 31, 2013 6:41 pm

FrozenApple66 wrote:What may help is if you put hide img49 before show img1 (this is just a guess I don't know what load imgx means)
Yes, this worked perfectly. Except I had to go back and do it for every image. Turns out by the end I had a good 45 images loaded on top of each other lol.

Thanks for the suggestion. It helped out.

User avatar
Showsni
Miko-Class Veteran
Posts: 563
Joined: Tue Jul 24, 2007 12:58 pm
Contact:

Re: Issue with loading images

#4 Post by Showsni » Tue Dec 31, 2013 6:52 pm

For future reference, if your images have the same tag then they'll replace each other when you show them - for example, if you have

image girl happy = "girlh.jpg"
image girl sad = "girls.jpg"

Then when you do

show girl happy
g "I'm happy!"
show girl sad
g "Now I'm sad."

Then the second sad image will automatically replace the happy one because they're both tagged girl.


Edit:

And if your images are of the fullscreen variety that are only showing one at a time, you probably want to use "scene" intead of show.

scene beach
"We're at the beach!"
scene shop
"We're in a shop!"

and so on. Scene, unlike show, removes all the displayables currently on the layer. So if you want to quickly fix your current project instead of going back over everything manually, you can try doing a find and replace and changing every instance of show to scene.

bleep
Newbie
Posts: 3
Joined: Tue Dec 31, 2013 4:05 pm
Contact:

Re: Issue with loading images

#5 Post by bleep » Tue Dec 31, 2013 7:38 pm

Wow, that last part will be a huge help for my next project. Thanks a bunch.

Post Reply

Who is online

Users browsing this forum: Bing [Bot]