Simple Graphical Window by Emily Short

You quoted your source text, is it tabbed correctly?

Do you have “the illustration of the location” defined? That line seems like it comes from the example text, specifically for use with the “Location Images” extension. There are some other steps to include illustrations in Inform which might be explained by that other extension.

http://inform7.com/extensions/Emily%20Short/Location%20Images/doc_0.html

Isn’t the issue just that the documentation still said to use “change”, a word I thought was now deprecated?

Indeed. The “change X to Y” syntax had been deprecated for quite a while and was finally removed in 6L02. Using “now X is/are Y” is the ‘right way’ to do it.

Found that out as well. Just took me quite some time to find out that this was causing the problem. So if the person who can change this reads this could change this - it might save someone else a bit of time :slight_smile:

I have rewritten SGW to use Flexible windows: github.com/i7/extensions/blob/m … Window.i7x

The main reason for this is to make the extension GGRecoverObjects aware - previously if you reloaded on another interpreter, or used Startup Precomputation it would cause major errors because it didn’t know when to recreate the window. But building off FW also allows you to use the general functions of that extension, and it substantial reduces the code in this one. So you will need to change to FW’s way of specifying the size and position of the graphics window.

The extension has been cut back to creating the window and specifying the different options for the current graphics drawing rule. You can also now use the image drawing phrases directly on other windows if you wish.

This update won’t be going in the Public Library for some time because the state of Glulx/Glk extensions which I’m currently overhauling is still very much in flux. But you’re free to download and use the update if you like.

I can’t ever seem to get Flexible Windows to work. I tried the steps but it may be user ineptitude.

HanonO, what are you trying to do, and what’s happening? And what version of FW are you using? (On second thought, maybe this would be better in a new thread?) I ask because I’d added in some of the documentation from the old version of FW and if something is wrong or unclear, I should probably fix it.

I was hoping to make FW work with Hybrid Choices, and I’ve tried several versions of the extension and the one in the GitHub that requires two more of (I think?) Dannii’s extensions. I may have gotten it confused but if you can point me to a standalone working version of FW I’d be much obliged.

Yeah it’s a little tricky at the moment because the dependency structure is changing, and they’re not yet in the Public Library yet to make installing them all easy. I promise that eventually this reworking of the dependencies will be worth it! (The main reason is to make alternative extensions like Zarf’s Unified Glulx Input play nicely together - currently they’re just incompatible.)

You’ll need these:

github.com/i7/extensions/blob/m … 0Rules.i7x
github.com/i7/extensions/blob/m … Events.i7x
github.com/i7/extensions/blob/m … covery.i7x
github.com/i7/extensions/blob/m … itions.i7x
github.com/i7/extensions/blob/m … Points.i7x
github.com/i7/extensions/blob/m … ffects.i7x
github.com/i7/extensions/blob/m … indows.i7x

Hi

I’m trying to use the Location Images extension. I’ve downloaded it from the extension site and also the Simple Graphical Window extension and Glulx Entry Points extensions.

I get this error when running the game;


In Section 4 - Inform 7 Wrappers for Defining Window and Colors in the extension Simple Graphical Window by Emily Short:

Problem. The sentence ‘Graphics background color is a glulx color value that varies’ appears to say two things are the same - I am reading ‘Graphics background color’ and ‘glulx color value that varies’ as two different things, and therefore it makes no sense to say that one is the other: it would be like saying that ‘Clark Kent is Lex Luthor’. It would be all right if the second thing were the name of a kind, perhaps with properties: for instance ‘Metropolis is a lighted room’ says that something called Metropolis exists and that it is a ‘room’, which is a kind I know about, combined with a property called ‘lighted’ which I also know about.


My extension list is attached.

Any ideas?
2018-03-17 10_47_58-Microsoft Edge.png

It looks like you are running version 8 of Simple Graphical Window. The latest version I see in the Public Library is version 9. Are you downloading extensions through the IDE?

If by extension site you mean inform7.com, that is not the first place I would recommend going to find an updated extension.

Thanks.

I’ve upgraded to 10/161003 from i7el.herokuapp.com/extensions/

Now I get this error.

Problem. You wrote ‘change currently shown picture to the room illustration of the location’ : but this is a phrase which I don’t recognise, possibly because it is one you meant to define but never got round to, or because the wording is wrong (see the Phrasebook section of the Index to check). Alternatively, it may be that the text immediately previous to this was a definition whose ending, normally a full stop, is missing?

2018-03-17 15_55_27-Test.inform - Inform.png

oliverm, are you still running into problems with this, or did they get resolved when you deleted all your extensions and re-installed them from the Public Library via the IDE?

“change” is no longer a valid phrase in I7 - it’s been like that for a few versions. Use “now the currently shown picture is the room illustration of the location”.

Does anyone know if one can change the measurement of the graphics window during the game, as in:

The measurement of the graphics window is 10.

When play begins:
    say "Hello.";
    now the measurement of the graphics window is 40;
    follow the current graphics drawing rule.

It doesn’t seem to work–it gets stuck to the initially set value.

On the other hand, one can change the colour (as in the example Mondrian on the extension’s page).

You would have to close and reopen the window for it to take effect.

I tried out the Friends of Inform version of this extension (Version 10/161003), and used:

The measurement of the graphics window is 40. 
The position of the graphics window is g-placeleft.

The equivalents in the Inform 7 built-in version (9/160121) seem to to be:

The graphics window proportion is 40. 
Graphics window position is g-left.

However, I can’t find any equivalents for:

[Don't automatically open the graphic window]

When play begins (this is the new graphics window construction rule):
	do nothing.
	
The new graphics window construction rule substitutes for the graphics window construction rule.

or

open the graphics window

or

close the graphics window

What would I need to do to achive the same result using the built-in extensions? Thanks.

Edit: I no longer need to use the older, built-in extensions, so if there is no easy answer then don’t worry :slight_smile: I think the answer is probably that the missing features of the old version are from Flexible Windows rather than Simple Graphical Window.

I have been experimenting with the Simple Graphical Window extension in a small test project. Because the extension automatically creates a single graphics g-window at startup, I used this command to close that window since I wasn’t using it.

When play begins:
    Close the graphics window;

After some additional experimentation I transferred my graphics window code over to an existing game with a much larger code base. When I run that code I issue the same command to close the graphics window in the When Play Begins block.

But a graphics window still appears above the main window. This is strange since the command to close the graphics g-window is called in the When Play Begin block (I added “say” statements to each of the window creation commands in that block to see when they are being called).

I find this strange and assume there must be something in this larger 40,000+ word code base that is causing this graphics window to be drawn even though I have closed it (when I try and draw an image into this unwanted graphics window I get a Glk Error - “glk_image_draw_scaled called with an invalid winid”).

While I debug the code to find the root cause I thought I would post here in case anyone else has ever encountered an issue like this or has some debugging suggestions.

Two questions:

  1. Has anyone every encountered an issue like this?

  2. Aside from reviewing code, putting in “say” statements, is there a better way to debug this in the Inform IDE (I am using 6M62 v1.68.1)?

1 Like

Okay, I figured it out and the solution was simpler than I thought.

In my 40,000+ word game I had the When Play Begins code before the section where I included the extensions.

Volume - Beginning The Story

When play begins:
    close the graphics window;
    open the right-sidebar window;
    ...

Volume - Setup

Part - Extensions

Include Flexible Windows by Jon Ingold.
Include Simple Graphical Window by Emily Short.

I had been reading the documentation about how extensions are compiled into the story source code and that made me look at my prototype example. In that example, the two Volume sections were switched, with the Extensions section coming before the Beginning The Story section.

Volume - Setup

Part - Extensions

Include Flexible Windows by Jon Ingold.
Include Simple Graphical Window by Emily Short.

Volume - Beginning The Story

When play begins:
    close the graphics window;
    ...

On a hunch I cut and pasted the Beginning The Story section in the 40,000+ word game so it appeared after the Extensions section. When I compiled the code the spurious graphics window does not appear.

I assume it has something to do with the way extension code is compiled into the main code. I don’t understand 100% why my solution works so if anyone has a more “formal” explanation please let me know (errors like this have happened to me before and the fix, while simple, is frustrating to figure out sometimes).

Note: I also figured out that I could have made my own personal copy of the Simple Graphical Window extension, modifying it so it didn’t create a graphics window, but I didn’t want to do that for a variety of reasons (see §27.3. Built-in, installed and project-specific extensions in the Inform documentation for details).

My guess is that the window is getting opened in a When Play Begins rule in the extension, and since neither of those rules is more specific than the other, they get run in source code order. Which means you were closing the window before it opened!

If you don’t want this code to depend on the order of inclusion, put your window-closing code in a last when play begins rule, which ensures it’ll be run after all the rest.

1 Like