Images in the built-in 'interpreter'

So I feel really bad for having to come back to these forums yet again with a question, however after reading around myself I’m not finding any definitive answer.

The problem I am having is that the function to display a figure (I don’t know how else to display images other than with that function) doesn’t seem to work on the built-in interpreter you can release with an inform project.

From what I can read, I’m seeing people say both that its possible to make it do this, but complicated, and also that its impossible full stop. I’ve looked at some of the extensions people have linked such as ‘Simple Graphical Window’, however I can’t seem to figure out how to actually work with them to end up displaying an image on that built-in interpreter.

I don’t like having to ask people to download third party software, so if anything exists that can allow me to use the display image command on the built-in interpreter I would be extremely grateful!

I came across this recently. Points 3-5 here should help you: Display multipage PDF within Inform 7 game - #20 by Jonathan

Though looking at it again - I have downloaded the current version of Quixe and don’t know whether that is also necessary to make the images work!

Hey, I appreciate the response!

I had been looking at Simple Graphic Window, though I couldn’t get it to function - or at least I couldn’t figure out how to get it to work and what or how it even pointed to and then called images (the documentation didn’t really help me in telling me exactly how to make images appear using that window).

I don’t have Quixe at all though as we, just inform7 - I’m not sure, if I’m reading right, I’ve even be able to figure out how to code in Quixe.

1 Like

You are correct, it does not work out of the box.

If you’re using Inform 6M62 (the latest), the version of Quixe it ships with is ready to display graphics, but you still, at this point in time, have to go through an additional (annoying but not-super-annoying) step of running a special Python script on your game to get the graphics files reformatted so they’ll work in the online release.

So you don’t need Simple Graphical Window or anything like that – what you were doing originally in your code is fine. The normal display an image function mentioned in the manual is fine. You don’t need to ‘do’ anything with Quixe other than have the right version, which you already do if you are running 6M62.

What you now need to do is create a release of your game with an interpreter, then run the the Python script on it… Instructions for doing this are kind of all over this thread I’m about to link to, but I’m going to link directly to the post from Angstsmurf that sums up in one message how to do it:

There are more message there from people having trouble, and more trying to explain how to do it :slight_smile:

I hope this can get you over the line.

-Wade

3 Likes

Thanks for the reply, that does indeed seem a lot more simple than what I was trying to do in an attempt to get things to work, though I can’t seem to work it out even still.

I have the latest version of inform, 6M62 - however making a .bat file (I am using windows 10) or using cmd results in either a quick flash of the terminal and then nothing for the former and a message about how I do not have python installed for the latter (despite having python installed, unless with windows 10 I have to install something specifically from microsoft’s store.). I also made sure it wasn’t changing anything, and it doesn’t appear so.

I’ve played around with where the pat file and python files are, putting them in both the Projects folder and the .materials folder for that specific project with no notable difference.

Unfortunately for your situation, I’m a Mac guy, and not very command-liney, so when I get a Python thing to work (like this script), I’m pretty chuffed with myself.

I’m pretty sure one of the command-liney PC folk will show up in this topic soon enough, and be able to ask the right questions and then give you some more specific help.

-Wade

You can add PAUSE in the last line of a batch file.

I only installed Python on my PC for blorbtool.py and remember the suggested command for Python didn’t work, or worked then inexplicably stopped working… I think py did work in the end.

:+1: (+ 5 characters)

You shouldn’t need to install it directly from Microsoft’s store. Probably, your .bat file can’t find the Python executable; it should be somewhere in your system’s PATH variable. You can check this by opening up a command prompt and typing ECHO %PATH%; the command prompt will then spit out a list of directory paths it searches when it looks for programs from the command prompt. You should see something in there that’s obviously a Python directory; on my Windows 10 installation it looks like

… and there are several entries that include Python36 and Python39, because I have Python 3.6 and 3.9 installed in my Windows installation.

If you don’t see any Python directories in your %PATH%, that’s why Windows is complaining that you don’t have Python installed, even though you do: it can’t find it. You can fix your PATH settings by editing the variable value, which Microsoft seems to take joy in making as complex a task as possible.

If that all sounds like gibberish, you can solve the problem by re-installing Python; just make sure to select the option that says “Add Python [version number] to PATH” near the bottom of the installation options:

3 Likes

Thanks for the reply, the PAUSE function let me confirm that its an issue with Windows being unable to find my python installation.

This was it! Thank you so much.

For whatever reason python had installed itself into appdata and so it wasn’t being found. A swift uninstall and reinstall later set things right and now everything works even better than I had hoped! I had feared some quirk about windows 10 was at play, and I’m quite ecstatic for that not to be the case.

Again, thank you so much!

I’m not even sure what post to mark as the solution, as I am very grateful for all your help. Coding isn’t really my main focus as far as what I know - hence why I’ve used inform - so when I hit something a little bit more off the beaten path than this it can get quite frustrating to try to overcome it.

1 Like

I think installing in appdata is “installing just for you” instead of “installing for all users”. Which, these days, you’re usually the only user, so you mostly don’t care, but if you’re looking for which installer option to click on, that’s probably the one.

1 Like

Super-glad to be helpful, and I’m glad that you’re back to working on your project!

1 Like