I7 - Glimmr sizing and alignment standards?

Are you typing “LOOK” after getting into the car when you’re testing this? Remember that the compass only updates during the looking action, and that entering a vehicle does not auto-trigger the looking action.

If that’s the problem you’re seeing, you’ll want to either trigger the looking action or the compass updating rule when the player enters a vehicle. Which you choose depends on the textual effect you’re going for.

–Erik

Oh yeah, I assumed that it wouldn’t “refresh” until I looked. I’ve been doing that on every test. It just refuses to display.

This is a real head-scratcher. I figured it would be an easy feature :laughing:

It works fine for me. Here’s the full code:

[spoiler][code]Include Glimmr Canvas-Based Drawing by Erik Temple.
Include Glimmr Graphic Hyperlinks by Erik Temple.

Figure of North is the file “North.png”. Figure of Northwest is the file “Northwest.png”. Figure of West is the file “West.png”. Figure of South is the file “South.png”. Figure of Southwest is the file “Southwest.png”. Figure of Southeast is the file “Southeast.png”. Figure of East is the file “East.png”. Figure of Northeast is the file “Northeast.png”. Figure of Up is the file “Up.png”. Figure of Down is the file “Down.png”. Figure of Inside is the file “Inside.png”. Figure of Outside is the file “Outside.png”. Figure of North Unvisited is the file “North Unvisited.png”. Figure of Northwest Unvisited is the file “Northwest Unvisited.png”. Figure of West Unvisited is the file “West Unvisited.png”. Figure of South Unvisited is the file “South Unvisited.png”. Figure of Southwest Unvisited is the file “Southwest Unvisited.png”. Figure of Southeast Unvisited is the file “Southeast Unvisited.png”. Figure of East Unvisited is the file “East Unvisited.png”. Figure of Northeast Unvisited is the file “Northeast Unvisited.png”. Figure of Up Unvisited is the file “Up Unvisited.png”. Figure of Down Unvisited is the file “Down Unvisited.png”. Figure of Inside Unvisited is the file “Inside Unvisited.png”. Figure of Outside Unvisited is the file “Outside Unvisited.png”. Figure of Compass Rose is the file “Compass.png”.

Table of Common Color Values (continued)
glulx color value assigned number
g-SubtleBlue 13755114
g-Creme 16249576

The inventory-window is a text-buffer g-window spawned by the main-window. The measurement of the inventory-window is 40. The back-colour is g-Creme.

The graphics-window is a graphics g-window spawned by the inventory-window. The position is g-placeabove. The measurement is 60. The graphics-window is g-graphlinked.

The graphics-canvas is a g-canvas.
The associated canvas of the graphics-window is the graphics-canvas.
The associated canvas of a g-element is usually the graphics-canvas.

The back-colour of the graphics-window is g-SubtleBlue. The background image of the graphics-canvas is the Figure of Compass Rose.

Window-drawing rule for the inventory-window (this is the construct inventory rule):
move focus to inventory-window, clearing the window;
try taking inventory;
return to main screen.

Every turn when the inventory-window is g-present: follow the window-drawing rules for the inventory-window.

A direction-sprite is a kind of sprite.

A direction-sprite has a figure name called the visited image. A direction-sprite has a figure name called the unvisited image.

The graphlink status of a direction-sprite is g-active.

Some direction-sprites are defined by the Table of Direction Sprites.

Table of Direction Sprites
direction-sprite visited image unvisited image origin linked replacement-command
north-sprite Figure of North Figure of North Unvisited {448, 103} “go north”
northeast-sprite Figure of Northeast Figure of Northeast Unvisited {688, 193} “go northeast”
northwest-sprite Figure of Northwest Figure of Northwest Unvisited {146, 196} “go northwest”
south-sprite Figure of South Figure of South Unvisited {466, 836} “go south”
southeast-sprite Figure of Southeast Figure of Southeast Unvisited {702, 723} “go southeast”
southwest-sprite Figure of Southwest Figure of Southwest Unvisited {150, 719} “go southwest”
east-sprite Figure of East Figure of East Unvisited {827, 465} “go east”
west-sprite Figure of West Figure of West Unvisited {76, 469} “go west”
up-sprite Figure of Up Figure of Up Unvisited {472, 1052} “go up”
down-sprite Figure of Down Figure of Down Unvisited {456, 1221} “go down”
in-sprite Figure of Inside Figure of Inside Unvisited {388, 1126} “go inside”
out-sprite Figure of Outside Figure of Outside Unvisited {558, 1138} “go outside”

A direction has a direction-sprite called the dir-sprite.

When play begins:
link sprites with directions;
if glulx graphics is supported:
open up the graphics-window.

To link sprites with directions:
let count be 1;
repeat with heading running through directions:
choose row (count) in the Table of Direction Sprites;
now the dir-sprite of the heading is the direction-sprite entry;
now the image-ID of the direction-sprite entry is the visited image entry;
increment count.

Carry out looking (this is the compass rose updating rule):
repeat with heading running through directions:
let place be the room heading from the location;
if place is a room and place is compass-ready:
if place is unvisited:
now the image-ID of the dir-sprite of the heading is the unvisited image of the dir-sprite of the heading;
otherwise:
now the image-ID of the dir-sprite of the heading is the visited image of the dir-sprite of the heading;
activate the dir-sprite of the heading;
otherwise:
deactivate the dir-sprite of the heading;
if the player is in the sports car:
now the image-ID of the dir-sprite of outside is the visited image of the dir-sprite of the outside;
activate the dir-sprite of outside;
follow the window-drawing rules for the graphics-window.

Definition: A room is compass-ready:
if it is lit, yes;
if in darkness, no;
[otherwise] yes.

The Garage is a room. The sports car is a vehicle in the garage.

The Kitchen is east of the garage. Outdoors is south of the garage.[/code][/spoiler]

–Erik

…and the head scratching continues.

I didn’t actually try the code you posted above. But thanks for posting it, it helped me confirm and will serve as a good reference to forum users who tinker with your compass. Instead, I took the same project that I was working with earlier in my free time at work (the version that had the last bit of code with the sprite included) and saved in my Dropbox, and loaded it onto my gaming machine at home. My work machine runs Inform7 for Gnome. My gaming machine runs Inform7 for Windows. Guess what? It works! Woo-hoo!

In conclusion, I think there was a combination of two things going on here: me still understanding code itself and the fact that I suspect some glitch with the Inform7 for Gnome game pane for now. I never did get a chance to try a story-file released version from work. I will try to confirm the bug soon.

I apologize again for this dragging along for such a long time and thank you for all your help.

Hm, a bug in the Gnome IDE terp. So was it the case that the entire compass wasn’t working? I understood you to be saying that the compass worked fine but that this specific thing we were doing wasn’t working…

Anyway, I’m glad you got it sorted–and uncovered what sounds like an important bug in the process!

–Erik

Upon further inspection this morning at work, I see that it was a matter of the monitor I have to use here being so crappy that I didn’t see the small sprite :unamused: