I can't seem to get images to display properly.

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
Tsundere Lightning
Miko-Class Veteran
Posts: 910
Joined: Sun Jul 06, 2008 4:30 pm
Projects: And plenty of them!
Location: Creche Alpha, Treasure Island
Contact:

I can't seem to get images to display properly.

#1 Post by Tsundere Lightning »

Code: Select all

I'm sorry, but an exception occured while executing your Ren'Py
script.

Exception: Couldn't find file 'thinking'.

While executing game script on line 38 of C:\Documents and Settings\All Users\Desktop\Games\renpy-5.6.3-full\renpy-5.6.3\First, Second, Third/game/script.rpy.

Ren'Py Version: Ren'Py 5.6.3a
Just as a test, I made a demo file with the Tsuina character set.

I renamed them to match Tsuina's emotions. That is, I changed the filenames to 'embarrased' or 'smug' and so forth.

Had a script a little like this...

Code: Select all

init:

    # Declare images used by this game.
    image black = "#000000"
    # Backgrounds.
    image bg_arcade = "arcade"
    
    # Characters.
    image lucy surprised = "surprise"
    image lucy thinking = "thinking"

    # Declare characters used by this game.
    $ l = Character('Lucy', color="#660099")

# The game starts here.
label start:

    scene black
    show lucy thinking

    l "Testing, testing, 1-2-3..."

    l "Did it work?"

    show lucy surprised
...and it choked on the file named 'thinking' for some reason.

Any idea why? I thought it was the lack of a '.png' extension on the characters, but the backgrounds have no extensions in thier names either.

Thanks in advance.
She's sun and rain: She's fire and ice. A little crazy, but it's nice.
Bliss Stage: Love is your weapon! A sci-fi visual novel about child soldiers coming of age. Kickstarter prerelease here. WIP thread here. Original tabletop game by Ben Lehman here. Tumblr here.

EvilDragon
Veteran
Posts: 284
Joined: Fri Dec 28, 2007 5:47 am
Location: Where the Dragons rule!
Contact:

Re: I can't seem to get images to display properly.

#2 Post by EvilDragon »

Is the file in the correct place? Perhaps it's better for all image files to have a proper extension, and that they are put in the separate "img" directory, right in the game directory. Then, when making image statements, you should define them like this:

Code: Select all

image background = "img/bg1.png"
...if your images directory is set in %renpydir%/%yourgamedir%/game/img.

I also prefer sorting various stuff into more directories, it feels more organized. So for my project I have:

Code: Select all

ProjectDir
    ├ bgm       #background music
    ├ chars     #character sprites
    ├ fonts     #duh, self-explanatory :D
    ├ sfx       #sound effects
    ├ img
    │  ├ bg     #backgrounds
    │  ├ misc   #various images (menu backgrounds, cursors, ctc indicators, etc.)
    │  └ trans  #images for ImageDissolve transition
    └ saves
Angels of paradise, angels of sacrifice
Please let me be under your wings...

mozillauser
Newbie
Posts: 16
Joined: Mon Jun 30, 2008 4:00 pm
Contact:

Re: I can't seem to get images to display properly.

#3 Post by mozillauser »

Hi Tsundere Lightning,

I examined your script and ... there is nothing wrong with it.

Ok, I
  1. put it in the editor,
  2. prepared some images and
  3. let it run.
It works fine except.... the last statement (show lucy surprised). This show statement ist useless because the scripts ends, before the user can interact (click) with Ren'Py. A concluding "" (2 Double-Quotes) should help.

Oh, yes I forgot: You told us, the script didn't run. Hmm, that's why I subscribe to EvilDragons view.
Tell us: Does the problem still exist?

yummy
Miko-Class Veteran
Posts: 733
Joined: Fri Jul 07, 2006 9:58 pm
Projects: Suna to Majo
Location: France
Contact:

Re: I can't seem to get images to display properly.

#4 Post by yummy »

I think you simply might have forgotten to put the image file extensions.

Assuming your image are in png format:

Code: Select all

init:

    # Declare images used by this game.
    image black = "#000000"
    # Backgrounds.
    image bg_arcade = "arcade.png"
   
    # Characters.
    image lucy surprised = "surprise.png"
    image lucy thinking = "thinking.png"
Ah and don't forget to put your images in your game folder (thus ..\Yourgamefolder\game\yourimages.png)

Hope this helps.

mozillauser
Newbie
Posts: 16
Joined: Mon Jun 30, 2008 4:00 pm
Contact:

Re: I can't seem to get images to display properly.

#5 Post by mozillauser »

yummy wrote:I think you simply might have forgotten to put the image file extensions.
I don't think, that this is a must! (at least under windows)
:arrow: I testet the unmodified script from Tsundere Lightning, and I only prepared some images (jpg's and png's without extension)

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: I can't seem to get images to display properly.

#6 Post by PyTom »

Extensions are required for image files. (Unless you did something insane and saved the image file without an extension, which is possible but unlikely.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

mozillauser
Newbie
Posts: 16
Joined: Mon Jun 30, 2008 4:00 pm
Contact:

Re: I can't seem to get images to display properly.

#7 Post by mozillauser »

PyTom wrote:Extensions are required for image files. (Unless you did something insane and saved the image file without an extension, which is possible but unlikely.)
unlikely? Of Course :!:
But it seems, that the missing extensions don't affect anything (in this script :) )

EvilDragon
Veteran
Posts: 284
Joined: Fri Dec 28, 2007 5:47 am
Location: Where the Dragons rule!
Contact:

Re: I can't seem to get images to display properly.

#8 Post by EvilDragon »

Probably because Ren'py recognizes the file header and sees it's an image file. But, nonetheless, extensions should be there!
Angels of paradise, angels of sacrifice
Please let me be under your wings...

Tsundere Lightning
Miko-Class Veteran
Posts: 910
Joined: Sun Jul 06, 2008 4:30 pm
Projects: And plenty of them!
Location: Creche Alpha, Treasure Island
Contact:

Re: I can't seem to get images to display properly.

#9 Post by Tsundere Lightning »

Actually, putting in the extensions solved the problem. Oops...

What was tripping me up was that the filename of that .png displayed while browsing windows was "Surprised" but Ren'Py only found it when I listed it as "Surprised.png" - weird.

Thank you all very much.
She's sun and rain: She's fire and ice. A little crazy, but it's nice.
Bliss Stage: Love is your weapon! A sci-fi visual novel about child soldiers coming of age. Kickstarter prerelease here. WIP thread here. Original tabletop game by Ben Lehman here. Tumblr here.

Mikan
Veteran
Posts: 364
Joined: Sun Dec 23, 2007 12:20 am
Contact:

Re: I can't seem to get images to display properly.

#10 Post by Mikan »

Tsundere Lightning wrote:Actually, putting in the extensions solved the problem. Oops...

What was tripping me up was that the filename of that .png displayed while browsing windows was "Surprised" but Ren'Py only found it when I listed it as "Surprised.png" - weird.

Thank you all very much.
For future reference, http://www.fileinfo.net/help/windows-sh ... sions.html
Vista: http://www.simplehelp.net/windows/how-t ... ows-vista/

Post Reply

Who is online

Users browsing this forum: Google [Bot]