Beginner problem: SHOWME not reporting locations

< Windows version v9.3 (build 6M62) >

Very inexperienced with Inform 7, so I’m not allowing myself to shout “Bug!” …the problem MUST be me. (And it must be me being VERY stupid, or googling it would get at least some results.) But I’m at a loss, so please help me understand.

I have a very small bit of game set up so far. Just three locations, one object, and one animal, like this:

the bull is an animal. it is in grassymeadow. the bull can be placid or angry. the bull is angry. the bull is undescribed.

While trying to figure out some game mechanics, I tried using SHOWME to keep tabs on where the animal was. As I understand it, this should report the animal’s location. However, no location name is shown:

>showme bull
bull - animal
location: in
singular-named, improper-named; unlit, inedible, portable; male; angry, far

Suspecting I’d fallen foul of some object/thing/animal convention, I tried it with the actual player, with similar results:

>showme me
yourself - person
**location: in **
singular-named, proper-named; unlit, inedible, portable; male

AFAIK there’s nothing weird about my game locations, etc. It compiles with no errors, and moving about, getting/dropping an object all work perfectly.

FWIW the locations etc look like this:

rusty key is an object. it is in orchardeast.

orchardwest is a room. “[if unvisited]You are at the west end of a small orchard which is surrounded by a high fence. A rickety gate leads west.[otherwise]You are at the west end of the orchard, by the gate.”. The player is in orchardwest.

orchardeast is a room. “You are at the east end of the orchard”.
orchardeast is east of orchardwest.

grassymeadow is a room. “You are in a grassy meadow.”.
grassymeadow is west of orchardwest.

Please tell me the presumably really obvious thing I’m doing wrong. And be gentle! Thanks.

1 Like

Hmm, that is a weird issue, since what you’re doing should be fine - and when I compile your sample code (everything from the rusty key on down) it works as you’d expect. If the printed names of your locations are somehow set to be blank, that would give rise to this behavior - do you manually set those anywhere, or have any rules changing how the names of locations are printed? And are location names showing up properly in the game when you test it?

If none of that is helpful, can you come up with a minimal bit of example code that reproduces the issue? That’d make it easier to track down (FYI the easiest way to post code on the forum is the preformatted text option, which is the button in the toolbar that looks like </>).

1 Like

[quote=“Mike Russo, post:2, topic:61607, full:true, username:DeusIrae”]
…or have any rules changing how the names of locations are printed?[/quote]

Brilliant! Thank you! And D’oh!

My very first line is:
Rule for printing the name of a room: do nothing.
(Thanks for the </> tip BTW.)

It leads me to a supplementary question though: The reason I had that line was to get rid of the default room-name display, which is inelegant to put it mildly. Is there a tweak that would achieve that but leave the showme output unaffected?

1 Like

Aha! I found the solution to the other problem in another thread - also provided by @DeusIrae

I am one happy bunny. :smile:

1 Like

Ha, yeah, that would do it! I’m not aware of any workaround that would blank out the location name in play but allow SHOWME to work as expected - closest I can come up with is to give everything a text property that picks up a manually-set property for your locations:

a room has some text called the location-name. a thing has some text called the current-location.  

every turn:
	repeat with foo running through things:
		now the current-location of the foo is the location-name of the location of the foo.

Then for each of your locations put in

the location-name is “orchardwest”.

(Or whatever)

(There’s probably a better way to do this than an every turn rule - note it won’t work on the first turn as a result, though you could also put the same thing in as a “when play begins” rule if that’s a big deal)

Honestly, as a player I’d probably find it awkward not to have location names, so beyond resolving this testing issue, I might consider if there were a way to include them somehow?

1 Like

Ha, scooped with a better solution by my past self! I was trying to work around the showme thing, but yeah, making the room name display conditional probably makes more sense.

1 Like

If you only wanted to supress the location name during ‘looking’ operations (but still have it displayed in the ‘status bar’, and the ‘showme’ command) - would something like this not work. (unless I am missing something, as I have not tested it)

Rule for printing the name of a room when looking:
	do nothing.

Yes indeed, this seems to have the same effect as the suggestion by @DeusIrae - thanks!

1 Like