I’m programming a gaming using Inform 6.35 compiling to Glulx. Is there a comprehensive guide somewhere explaining how to add graphics to a game? I’d like to have two windows, one on top to display a picture and one at the bottom to display all text. It’d be great if the instructions did not expect me to have a degree in computer sciences.
Note that the graphics routines assume a fixed-size image of 320x240, so adjust the numbers accordingly. I never worked out how to scale the images properly. I know it’s possible, but my experiments were less than successful.
My notes also explain how to play music or sound effects. You can omit that code if you’re not using sound.
It’s a pity that PunyInform doesn’t support Glulx or z6, otherwise we’d be able to use that.
so Filename.res contains the line “CODE Filename.ulx”. Then “bres.exe Filename.res” does indeed create the .blc and the .bli file, but they’re both empty (0 bytes large). What am I doing wrong?
I have no idea. Are you using the command line, batch file or running the command from within an editor?
I’m guessing that it created the empty .bli and .blc files in preparation for reading the .res file, but it couldn’t find the .res file. Check your paths and file names. If the .res file is not in the same folder as the bres.exe file, make sure you specify the path to the .res file. If the file name contains spaces, make sure you surround the file name (and path) by double quotes.
So bres.exe does compile now. The resulting .bli file looks like this:
! Blorb Resource Definitions File
! Generated automatically by c:\SugarSync\Inform 6\Games\Wanderlust\bres.
! Do not edit!
! Include this file in your inform source with “Include “Wanderlust.bli”;”
Message “Including c:\SugarSync\Inform 6\Games\Wanderlust\bres resource declarations generated on 11-13-2025”;
Unfortunately, compiling my game now results in this:
The .bli file should contain valid Inform 6 code only. In Inform 6, the character “\” can only be used at the end of a line within a string (it’s an obsolete notation, meaning that the string continues on the next line).
If you replace all instances in “\” in strings for Message-commands with “/”, this should go away.
If you also have Include-commands that have \ in path names, you may need to replace those with / as well - Not sure.
Quite possibly, if you just put all the files you need in the same directory, and don’t use full paths to point to the files, you won’t have a problem at all.
BTW: Are you using some ancient library version that doesn’t work with the modern compiler versions? If not, switch to Infom 6.44.
So I have exchanged the Inform6.exe to v6.44 and manually changed the backslashes to slashes in the .bli file, which now looks like this:
! Blorb Resource Definitions File
! Generated automatically by c:\SugarSync\Inform 6\Games\Wanderlust\bres.
! Do not edit!
! Include this file in your inform source with “Include “Wanderlust.bli”;”
Message “Including c:/SugarSync/Inform 6/Games/Wanderlust/bres resource declarations generated on 11-13-2025”;
This took away some errors when compiling my game. Still - shouldn’t there be more content in that .bli file?
Hmmm… Zarf’s code comments might be the right track. Those are sound variables and I don’t need sound and didn’t include some code provided in the guide. Let me check…
Okay it compiles! Thanks Fredrik! Gonna follow Garrys documentation again now, no idea where that takes me, but for now - cool, I’m on the track again!
Now I have included the code from chapter 1-7 (“Add the following entry-point routines”). That results in the following compiler error:
“IdentifyGlkObject” is a name already in use and may not be used as a routine name (Routine “IdentifyGlkObject” was defined at “....\Lib\Base\Grammar.h”, line 659)
Well, the compiler is right, but what’s my mistake? Wrong grammar.h? Something wrong with the code from the PDF? I’m clueless, again…
The latest version of the Inform 6 library is 6.12.7. In this version, the stub for IdentifyGlkObject is defined at line 569, not line 659 (or was that a typo?) If you aren’t using the latest version, then it’s time for an update.
The error tells you that the entry point routine name is already in use. This implies that you’ve defined it after including grammar.h, but you need to define it before including grammar.h. The same applies for the HandleGlkEvent entry point routine.
created a suspiciously small .gblorb file, running which resultet in a “This Blorb file does not contain an executable Glulx chunk.” error message. Any idea what I might have done wrong?
Nope, no idea. Did you follow my instructions? I suspect that you have left the CODE chunk out of your filename.res file prior to running bres.exe. Check the two files that it created. If filename.blc is missing your ulx file, then that’s the problem.
I suspect not. Do you have a copy of the blorb spec? If not, track it down.
The IFTF maintains a bunch of specs here. The one you want is Blorb-Spec.md
Alternatively, @zarf maintains a bunch of blorb-related stuff here. I use the pdf version of the spec.
Your Exec line is a mess. You’re using the code ZCOD, which is for a Z-code file, but your executable is a z5 file with “|ulx” after it. How did that get in there? Remember that the blc file is generated automatically and you shouldn’t edit it, so check the CODE line in your res file. It should be one of the following: CODE test.z5
OR CODE test.ulx
Now re-run res.exe to regenerate the bli and blc files and check that the Exec line in the generated blc file is either: Exec 0 ZCOD test.z5
OR Exec 0 GLUL test.ulx
It worked! My mistake was simlpy that my test.res file contained the line “CODE test.z5|ulx”. WIth the OR pipe in it. Now it works, and I got a picture in an Inform 6 file for the first time in my life. Hallelujah! Thanks a lot!
Now I only have to find out how to use pictures bigger than 320x240…