image not displaying

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
SomeDude
Newbie
Posts: 10
Joined: Fri Feb 15, 2019 8:52 pm
Contact:

image not displaying

#1 Post by SomeDude »

I have a little problem with this one scene.
For some reason, my image won't display and just stays with the previous image. It doesn't say "image not found" and this doesn't happen anywhere else, just here for some reason.

Code: Select all

	show image "intro/int_13.png"
	R "Dialogue 1"
	show image "intro/int_15.png"
	Y "Dialogue 2?"
	show image "intro/int_14.png"
	M "Question 1?"
	show image "intro/int_15.png"
	Y "(Inner thought 1)"
	Y "(Inner question 1?)"
	show image "intro/int_16.png" with hpunch
	Y "Exclamation 1!?"
	show image "intro/int_17.png"
	Y "Exclamation 2!?"
The image that doesn't display is the second "int_15" and instead just continues to display "int_14", but "int_16" displays afterwards. Again, I tried the exact same order of images before and after this scene and it works there. For whatever reason it just doesn't work here. This is in between the lines 150 - 162

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: image not displaying

#2 Post by Per K Grok »

SomeDude wrote: Tue Feb 19, 2019 6:29 pm I have a little problem with this one scene.
For some reason, my image won't display and just stays with the previous image. It doesn't say "image not found" and this doesn't happen anywhere else, just here for some reason.

Code: Select all

	show image "intro/int_13.png"
	R "Dialogue 1"
	show image "intro/int_15.png"
	Y "Dialogue 2?"
	show image "intro/int_14.png"
	M "Question 1?"
	show image "intro/int_15.png"
	Y "(Inner thought 1)"
	Y "(Inner question 1?)"
	show image "intro/int_16.png" with hpunch
	Y "Exclamation 1!?"
	show image "intro/int_17.png"
	Y "Exclamation 2!?"
The image that doesn't display is the second "int_15" and instead just continues to display "int_14", but "int_16" displays afterwards. Again, I tried the exact same order of images before and after this scene and it works there. For whatever reason it just doesn't work here. This is in between the lines 150 - 162
try this

Code: Select all

	show image "intro/int_13.png"
	R "Dialogue 1"
	hide image "intro/int_13.png"
	show image "intro/int_15.png"
	Y "Dialogue 2?"
	hide image "intro/int_15.png"
	show image "intro/int_14.png"
	M "Question 1?"
	hide image "intro/int_14.png"
	show image "intro/int_15.png"
	Y "(Inner thought 1)"
	Y "(Inner question 1?)"
	hide image "intro/int_15.png
	show image "intro/int_16.png" with hpunch
	Y "Exclamation 1!?"
	hide image "intro/int_16.png"
	show image "intro/int_17.png"
	Y "Exclamation 2!?"
	hide image "intro/int_17.png"

I think int_15 is shown the second time as well, but behind int_14, so you do not see it.

SomeDude
Newbie
Posts: 10
Joined: Fri Feb 15, 2019 8:52 pm
Contact:

Re: image not displaying

#3 Post by SomeDude »

This worked perfectly! I don't know why this only happens in this specific part of the script but thanks for the help!

strayerror
Regular
Posts: 159
Joined: Fri Jan 04, 2019 3:44 pm
Contact:

Re: image not displaying

#4 Post by strayerror »

Per K Grok is correct. It's also possible to use the as keyword to associate a tag with the shown images which lets renpy know it should replace them, rather than layer them, so this would also work and avoids the need to manage the hides manually, think of it as all the images belonging to a group, from which one one image can be used at a time.

In this example I'm using the tag bg but this can be any string of your choosing (so long as it's not a keyword).

Code: Select all

    show image "intro/int_13.png" as bg
    R "Dialogue 1"
    show image "intro/int_15.png" as bg
    Y "Dialogue 2?"
    show image "intro/int_14.png" as bg
    M "Question 1?"
    show image "intro/int_15.png" as bg
    Y "(Inner thought 1)"
    Y "(Inner question 1?)"
    show image "intro/int_16.png" as bg with hpunch
    Y "Exclamation 1!?"
    show image "intro/int_17.png" as bg
    Y "Exclamation 2!?"

Post Reply

Who is online

Users browsing this forum: Alex, Google [Bot], LegsWild