$ renpy.show and image directory

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.
Message
Author
User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Contact:

Re: $ renpy.show and image directory

#31 Post by hell_oh_world »

numaej wrote: Fri Aug 30, 2019 4:46 pm I'm actually using this command to display images, because it's the only way to show image with the filter which the player will chose.

Code: Select all

$ renpy.show("ch1intro1"+persistent.filter)
I don't use 'image x' or basic 'show' command at all.
I updated all of the names, so now they are all unique to not make renpy confused.
As I also mentioned, all my images are flat renders - which means, that there's no specif actions on them, one replaces the previous one, and it works just fine. The problem occurs when I have a dialog, and I want to jump between two - the same - renders, it simply doesn't jump back to the previous render, feels like renpy is just ignoring the command, cause there's no error message at all.

for example:

Code: Select all

$ renpy.show("ch1intro1"+persistent.filter)
a "Hi!"
$ renpy.show("ch1intro2"+persistent.filter)
b "Hi! How are you?"

### and from this moment renpy choose to ignore my comand to show the ch1intro1 image again. Instead, ch1intro2 is displayed all the time.

$ renpy.show("ch1intro1"+persistent.filter)
a "Good. How about you?"
$ renpy.show("ch1intro2"+persistent.filter)
b "Great!"## action moves on, I'm jumping to the next render, renpy does it without any problems

$ renpy.show("ch1intro3"+persistent.filter)
a "Awesome!"
b "Oh, I wanted to tell you... 

### now I want renpy to display the ch1intro2 again, but as well as with ch1intro1 renpy somehow chooses to ignore my comand and displays ch1intro3 all the time

$ renpy.show("ch1intro2"+persistent.filter)
b "Renpy pisses me off, because it's not listening to me!
Hopefully, this will make my problem more clear for you guys.
Basically, your problem I guess is the hiding of the image. If the image will not be used in the incoming dialogues, you should hide it in order for it to be able to be shown again. Its like your just stacking images on the layer. The image is still there but it is just overlapped. Use renpy.hide() if you think the image will not be used on the incoming dialogues.

Also, just to be clear if these images are not sprites and theyre some sort of wallpaper like images use scene statement everytime you show an image. Scene statement automatically clears the screen so you would be able to show the images all over again.

Code: Select all


$ renpy.show("ch1intro1"+persistent.filter)
a "Hi!"

$ renpy.scene()

$ renpy.show("ch1intro2"+persistent.filter)
b "Hi! How are you?"

### and from this moment renpy choose to ignore my comand to show the ch1intro1 image again. Instead, ch1intro2 is displayed all the time.

$ renpy.scene()

$ renpy.show("ch1intro1"+persistent.filter)
a "Good. How about you?"

 
$ renpy.scene()
 
$ renpy.show("ch1intro2"+persistent.filter)
b "Great!"## action moves on, I'm jumping to the next render, renpy does it without any problems/code]


Either of the two ways would work. You can hide or use scene statement to clear everything, so that the image can be called again.

If that is laborious enough because of repetitive use of the function renpy.scene or hide you can define a function that you will call.

Code: Select all

init python:
    def showImg(name):
        renpy.scene()
        renpy.show(name)
        
label start:
    $ showImg("ch1....") # This will call two functions at the same time without using renpy.scene() all the time just to clear the screen.
Last edited by hell_oh_world on Fri Aug 30, 2019 6:24 pm, edited 2 times in total.

numaej
Newbie
Posts: 22
Joined: Fri Dec 21, 2018 9:24 am
Contact:

Re: $ renpy.show and image directory

#32 Post by numaej »

DUDE THANK YOU SO MUCH! IT WORKS NOW!

Post Reply

Who is online

Users browsing this forum: No registered users