Getting Undefined Image code for Backgrounds (Solved)

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
KusanagiKyo
Newbie
Posts: 7
Joined: Sun Jan 26, 2014 12:26 am
Projects: Edgy (Non-commercial, flag type dating)
Contact:

Getting Undefined Image code for Backgrounds (Solved)

#1 Post by KusanagiKyo »

I'll be real. I've never worked with coding or anything even remotely close to the Ren'Py system. (Except for Mugen almost a decade ago.) In this regard, I thought I thoroughly looked over at least the basics for inserting images, music, and dialogue for Ren'Py.

I even looked through the scripts for both 'The Question' and the 'Tutorial'. So following probably the most basic instructions for the game, I attempted to insert my own test pictures, dialogue, and music into a new project.

The character sprite works, the music works, and dialogue works. However, the two background pictures I used are being shown as black screens with the 'Undefined Image' message at the top of the screen.

After a frustrating hour of having no clue what to do, I attempted to add one of the images into the script for 'The Question' and it worked with no problem. So now, I'm stuck and highly annoyed. I really hope someone can help me out with this one.
Last edited by KusanagiKyo on Sun Jan 26, 2014 1:20 am, edited 1 time in total.

Unin
Regular
Posts: 54
Joined: Wed Sep 01, 2010 8:08 pm
Location: Florida
Contact:

Re: Getting Undefined Image code for Backgrounds

#2 Post by Unin »

sure, please post your code so we can help.

User avatar
KusanagiKyo
Newbie
Posts: 7
Joined: Sun Jan 26, 2014 12:26 am
Projects: Edgy (Non-commercial, flag type dating)
Contact:

Re: Getting Undefined Image code for Backgrounds

#3 Post by KusanagiKyo »

# Declare images used by this game.
image bg Room 1 = "CleanroomDay.jpg"
image bg Room 2 = "CleanroomEvening.jpg"
image bg Room 3 = "CleanroomNight.jpg"
image bg Room 4 = "ClearnroomDark.jpg"

image Rinahappy = "Rinahappy.png"
image Rinadismay = "Rinadismay.png"
image Rinaangry = "Rinaangry.png"
image Rinasurprised = "Rinasurprised.png"
image Rinasweatdrop = "Rinasweatdrop.png"
image Rinaupset = "Rinaupset.png"

# Declare characters used by this game.
define r = Character('Rina', color="#c8ffc8")
define j = Character('Jin', color="#c8ffc8")


# The game starts here.
label start:

scene Room 4
with fade
I go into dialogue and such after that.

I know that Room 4 is misspelled. I thought that was the problem at first, but when I corrected it, it didn't change anything. Also, I changed the room titles from 'CleanroomDay' and such to 'Room 1' etc, in hopes of fixing the problem as well.

Unin
Regular
Posts: 54
Joined: Wed Sep 01, 2010 8:08 pm
Location: Florida
Contact:

Re: Getting Undefined Image code for Backgrounds

#4 Post by Unin »

and you're not getting an error, just undefined where the bg should be... is the file in your /game directory with your sprites? do you have the name and extension correct?

Unin
Regular
Posts: 54
Joined: Wed Sep 01, 2010 8:08 pm
Location: Florida
Contact:

Re: Getting Undefined Image code for Backgrounds

#5 Post by Unin »

oh, try "scene bg Room 4" instead if just "Room 4".
you defined by as part of the name.

User avatar
KusanagiKyo
Newbie
Posts: 7
Joined: Sun Jan 26, 2014 12:26 am
Projects: Edgy (Non-commercial, flag type dating)
Contact:

Re: Getting Undefined Image code for Backgrounds

#6 Post by KusanagiKyo »

...
I knew it.

I just knew it was going to be some simple thing to solve and I was just being so impatient that I was constantly overlooking it...

Thank you sooo much Unin, you have no idea how much you've just made my day. XD

P.S, It's working perfectly. Now to create the most epic games ever! (Insert evil laugh)

Unin
Regular
Posts: 54
Joined: Wed Sep 01, 2010 8:08 pm
Location: Florida
Contact:

Re: Getting Undefined Image code for Backgrounds (Solved)

#7 Post by Unin »

no prob. bug checking code is a lot like proof-reading a paper; sometimes your eyes get use to your own style, and your brain glosses over mistakes by showing what you meant, instead if what's really there; things that fresh eyes notice right away.

Post Reply

Who is online

Users browsing this forum: Andredron, Google [Bot]