No pictures show up when I export an HTML file

Sorry if this has been answered elsewhere—I couldn’t find a solution here or in the Choicescript documentation on the CoG website.

I’m having trouble with getting .png files to show up in-game when I export and open the game as an HTML file. This doesn’t happen when I test the game through index.html or when I host a server through serve.command (before I export it).

This is what it looks like when I run the game through index.html or serve.command:

And this is what is shown after I open the exported HTML file:

The same goes for every in-game picture. If it helps diagnosing the problem, this is what I get when I export the local server:

HTML message
Loading...
Extracting js data from:
version.js
../persist.js
../alertify.min.js
../util.js
../ui.js
../scene.js
../navigator.js
mygame.js

Extracting css data from:
../style.css
../alertify.css

Searching for scene files...
startup.txt
choicescript_stats.txt
choicescript_upgrade.txt
titleScreen.txt
prologue.txt
chapterNaming.txt
name_generator.txt
codename_generator.txt
surname_generator.txt
picking_powers.txt
checkpoints.txt
theShow.txt
theShow2.txt
detectiveMc.txt
publicOpinion.txt
xpDistribution.txt
levelUp.txt
recurrent_tests.txt
afterParty.txt
theQuestioning.txt
flittingOut.txt
mentorsMessage.txt
tailor.txt
baseHub.txt
ghostling.txt
catacombs.txt
tellingTales.txt
marseille.txt
afterCatacombs.txt
trophyRoom.txt
backBase.txt
veracity.txt
thaumaftermath.txt
mentorsBase.txt
cityHall.txt
teamNames.txt
veraBlair.txt
veraRed.txt
veraBurg.txt
veraDealer.txt
veraBoss.txt
hqParty.txt
truthOrDare.txt
redCast.txt
blackout.txt
lastHurrah.txt
friendFall.txt
villainCodename.txt
ending.txt

Game title set to: Unsupervised

Author set to: Lucas Zaper & Morton Newberry
WARNING: No *ifid. Refreshing the browser tab will erase all progress.
You can use this randomized IFID: *ifid 44845bc8-1924-40b6-898d-0713e307f851

Combining scene files...
Assembling new html file...
Export Complete!
Click here to download your compiled game.

Lastly (and most importantly), does this have any effect on images showing up in the published game (Steam, iOS, etc.)? I guess not, right?

Thanks!

I didn’t take a look at the exporting program but from what you showed there it isn’t handling images.

images in published games are handled by COG or HG, you are requested to send the files when you deliver your finished game so you don’t have to worry about that.

1 Like

The html file does not contain the images with it. You have to keep a copy of the images together with the html file. In CSIDE you can convert an image to a scene, but I don’t re commend it.

1 Like

Why not? While I agree its not a good solution for many images, I’ve got a few games where the images are scene files because it makes them super easy to host anywhere :slight_smile: Apart from the lots of scene files problem if you have a lot of images, are there any other downsides to using it that way?

It converts your image into a base64 string, in other words, you’re missing out on the benefits of PNG/JPEG compression. The image-scene files will be a lot bigger than their PNG/JPEG counterparts (around 40% bigger in file size). I don’t think the benefit of embedding the image in the HTML makes up for this drawback, but to each their own.

1 Like

Does it even preserve the alpha channel then?

I believe it does, but I’m not sure to be honest.

Edit: I just checked and it does indeed preserve the alpha.

If pictures aren’t showing up when you export an HTML file in ChoiceScript, there could be a few reasons:

  1. File Paths: Ensure that the file paths to your images are correct. The HTML file might not be able to find the images if the paths are incorrect or if the images aren’t in the expected location.
  2. Image Formats: Make sure the images are in a supported format (e.g., JPEG, PNG) and that they’re properly formatted for web display.
  3. Image Size: Check the size of your images. Large images can take longer to load and might not display properly, especially in web browsers.
  4. HTML Code: Verify that the HTML code in your ChoiceScript project correctly references the images. Make sure you’re using the correct HTML syntax to display the images.
  5. Browser Settings: Sometimes, browser settings can prevent images from loading. Try opening the exported HTML file in a different browser or check the browser’s settings to ensure images are enabled.
  6. Cache: Clear your browser cache to ensure you’re seeing the most up-to-date version of the HTML file with the images.

Double-checking these aspects should help you troubleshoot why the images aren’t showing up in your exported HTML file. If you’re still having trouble, consider reaching out to the ChoiceScript community or support for further assistance.

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.