Testing game does not show images, but no error message?


#1

So I’m having an issue with getting images to load in my game. I’m not getting any error messages, but when I test the game in Firefox I’m getting the broken image icon instead of the image. I have the file in my “mygame” folder like I’m supposed to, it’s a .png file but I’ve been having the same issue with .jpg files and any other images I try to upload.

My code for it is: *image filename.type alignment

That’s what it says on the tutorial section of the site: is there something else I need to be doing to get it to load right? Do I need to list it like the scenes on the startup page or something? Everything else on my game seems to be working fine, I just can’t seem to get images to show up; it’s my first time making a game on this software, and I thought I was doing alright before I tried adding images.


#2

Can you post the exact code you are using?
Also, can you verify that the image is not corrupt by opening it regularly through Firefox?


#3

Right now I am literally just trying to get images on. The entirety of the code for my startup page right now is:

*title Conduit
*author Jay M Profio
*scene_list
startup

Image Test

*image SpriteRayne.png center

That’s all that’s on there right now, because I’m just using it to test the appearance of the image once I add it to my final game. The file name is exactly the same as in the code, capital letters and all. I opened the file in Firefox and it looks fine, it just doesn’t open with the code when I test it.


#4

This is a screenshot of what I get. I don’t get any errors


#5

Ok, try it with a .jpg
Does it give you the same message?

I just tested:
*image myimage.jpg center

For me, this works on mine.
Maybe ChoiceScript can’t process .png


#6

I just saved the image as a .jpg, ran a test and got the same image result as before. I even changed the file type in the code. Running the quick test lists it as successful; everything is running fine but the image just doesn’t show up in the test.


#7

Do you get the same result with a .jpg downloaded from the internet?


#8

I just tried this, and yes. It’s exactly the same.


#9

Ok, so the image is your “mygame” folder, correct?
And your code is in your “scenes” folder?
And both of these things are in the same dfabulich-choicescript folder?


#10

Yes. Everything is in the right folders, I’ve checked and double checked. The automatic tests say everything is running properly with no errors, but when I compile and test the images are broken links.


#11

Ok that might be something there… when you compile?
You don’t need to compile to test.
If on a PC, you just double click the index in your “mygame” folder.


#12

Ah I see that was it. The tutorial pages say to test via the “compile” command.


#13

Silly tutorials :wink:
Does it work now?


#14

Yes, it’s working now. Thanks very much, I didn’t realize “compile” was messing with the images


#15

Which tutorial pages? Compilation should work fine, but you’ll need to copy the images to the folder (location) of the compiled “game.html” file :slight_smile: