Beginner with a few questions

Hey there,

I’m brand new to inform, working on my first game. I’ve got some questions if you experts wouldn’t mind indulging me. Sorry for the long post, but I saved them up so I didn’t flood the forum.

Question: Does this forum or the Inform community in general have a Discord?

I’m in the Narrative Games discord but they don’t have an Inform channel and I feel awkward asking Inform questions. Also it’s pretty quiet in there most of the time. It would be cool to hang out around people that are making IF and talking about it.

Question: Can I be more efficient with some of my declarations?

Just for example, I have some Instead rules laid out like so:

[code]Instead of going to the Triangle Hole by cog boat:
say “There’s no way you could haul the boat out of the canal. You’ll have to get out.”;

Instead of going to the Circular Hole by cog boat:
say “There’s no way you could haul the boat out of the canal. You’ll have to get out.”;

Instead of going to the Square Hole by cog boat:
say “There’s no way you could haul the boat out of the canal. You’ll have to get out.”;[/code]

This works fine, but instinctively I want to write something more along the lines of:

Instead of going to either the Triangle Hole, the Circular Hole, or the Square Hole by cog boat: say "There's no way you could haul the boat out of the canal. You'll have to get out.";
This doesn’t work.

I tried the extension Alternatives by Eric Eve, but I couldn’t find a single scenario where I wanted to simplify what I had written into this format where it actually worked. I just feel like I am writing lots of inefficient little rules like this and I’m worried it’s because I don’t understand that there’s a better way to do it.

Question: What am I doing wrong here?

Rule for printing the description of a dark room (called the dark place) when the dark place is in the Waterway: if the dark place is Canal3: say "The waterway is dark. A faint glow of light emanates in the distance from a passage in the north wall." instead; say "The waterway is dark.";

My idea here is that I have a number of rooms representing a canal. If it is dark, “The waterway is dark.” unless you are in Canal3, in which case the description mentions a lit passage to the north. The error message that kicks back here is:

I’ve also tried:

Rule for printing the description of a dark room when the room is in the Waterway:

and:

Rule for printing the description of a dark room when it is in the Waterway:

Question: In the Simple Chat extension by Mark Tilford, can you set a chat node to sc-inactive and sc-once at the same time?

I’m guessing not many people will know the answer to this, but when I tried it, it kicked back an error. I just wanted to set a chat node that was inactive by default, but once activated could only be used once.

Question: Is there a way to do exceptions?

For example:

The sun is a view. It is everywhere. EXCEPT X, Y, and Z.

It makes more sense to me to list exceptions to a rule when there are only one or two, rather than making a long list of places where it is. This isn’t a huge problem when you are creating a view or something like this but becomes a problem when you want to list a rule like:

“Instead of doing anything other than:”

Where you want to prevent the player from doing anything other than maybe two or three approved actions for a specific time. For example:

Instead of doing anything other than waiting during jackScene1: say "Hey, I didn't say you could do that."

But I don’t want the player to only be able to wait. I would like the player to be able to look, wait, and push Jack off a cliff. All other functionality should fall under the “Instead of doing anything:” rule, but I can’t for the life of me figure out how to get any exceptions in there.

Question: What am I doing wrong here?

[code]Understand “ask [someone] about [any seen thing]” as interrogating it about. Interrogating it about is an action applying to two visible things.

Understand the commands “show” and “display” and “present” as something new.

Understand “show [something] to [someone]” or “display [something] to [someone]” or “present [something] to [someone]” as interrogating it about (with nouns reversed).
Understand “show [someone] [something]” as interrogating it about.

Carry out interrogating someone about something:
say “‘Sorry. I don[’]t know anything about that.'”;

Instead of interrogating Jack about an item listed in the Table of Jack Items:
say “[reply entry][paragraph break]”.

Table of Jack Items
item reply
“painted key” “Jack thinks it over. ‘You said you pulled it out of a painting?’”[/code]

I pretty much ripped this word for word out of an example in the documentation and I can’t get it to compile.

The example that I pulled it from is 297: Nameless.

Question: What am I doing wrong with my Glimmr include?

I was hoping to test out the Glimmr Automap extension. According to the documentation it says I just need to include Glimmr Automap and Glimmr Automap Tileset. When I do that, it kicks back the error:

I can’t really figure out what this is referring to.

I do have another extension, Glulx Text Effects which also references a Table of Common Color Values (continued), but that one compiles fine with no issues. Is there some kind of clash?

Phew, that’s a lot of questions. Sorry to drop a big one on ya, but like I said, I didn’t want to make a bunch of posts with all these nagging little things that I’ve been stumbling over. Any help is appreciated, even if it’s just pointing me in the right direction for something.

Thanks a bunch.

Welcome to the forum! I don’t know of any Inform Discord but we’re usually happy to answer questions here.

Instead of going to either the Triangle Hole, the Circular Hole, or the Square Hole by cog boat: say "There's no way you could haul the boat out of the canal. You'll have to get out.";

Usually with things like this, the way to do it is to write things out in full:

Instead of going to the Triangle Hole by cog boat, or going to Circular Hole by cog boat or going to the Square Hole by cog boat: say "There's no way you could haul the boat out of the canal. You'll have to get out.";

or you could simplify this by exploiting the fact that “by cog boat” is an abbreviation for an action variable called “the vehicle gone by”:

Instead of going to the Triangle Hole or going to the Circular Hole or going to the Square Hole when the vehicle gone by is the cog boat: say "There's no way you could haul the boat out of the canal. You'll have to get out.";

BUT the simplest way to do this may be to define a new property that wraps all these up:

[code]Definition: a room is canal bank if it is the Triangle Hole or it is the Circular Hole or it is the Square Hole.

Instead of going to a canal bank room by cog boat:
say “There’s no way you could haul the boat out of the canal. You’ll have to get out.”;[/code]

(Warning: I haven’t tested any of these, so they could all be wrong.)

A warning: if you got Alternatives from the Inform7.com site, those extensions tend to be for older versions of Inform, so they might not work. Anyway, you can usually do what you need just by writing everything out. Remember, Inform isn’t really English and it can’t fill in a lot of stuff we automatically fill in when we write it. (Also, the word “either” doesn’t do anything in Inform, I think.)

–Printing the description of a dark room. This is a bit messed up.

The thing is that the phrase “rule for printing the description of dark room” is actually about an activity called “printing the description of a dark room” and doesn’t break out the dark room as a separate thing! This is unusual–usually activities like this are called something like “printing the name of something” and then if you say “printing the name of a dark room,” the dark room would be an argument of the activity, and you could say “(called the dark place)” as you did. But in the specific case of printing the description of a dark room, that won’t work. There’s more discussion of that here.

OK, so here’s what you can do:

Rule for printing the description of a dark room when the location is in the Waterway:

“The location” is the location of the player, that is, the room they’re in. So that should work. (This is like what you’re trying to do with “the room,” but again, when you say that Inform doesn’t understand which room you mean.)


“Instead of doing anything other than:”

Try a kind of action.

[code]Looking is jack action. Waiting is jack action. Pushing Jack off a cliff is jack action. [assuming you’ve defined pushing jack off a cliff as an appropriate action]

Instead of doing anything other than Jack action during jackscene1: say “Hey, I didn’t say you could do that.”[/code]

(WARNING: this might be interpreted as “anything other than (Jack action during jackscene1)”. If that happens sometimes you can clear it up by explicitly putting in parentheses: “Instead of doing (anything other than Jack action) during jackscene1:”)

–Question: What am I doing wrong here?

The interrogation action is defined as applying to two things, but you’re trying to apply it to a table column that contains quoted topics rather than things. If the painted key is an object in your game world, take the quotation marks off it in your table. If “painted key” is just supposed to be a text, use the built-in asking it about action, which applies to one thing and one topic, as in the Nameless example:

Instead of asking Nameless Advisor about a topic listed in the Table of Nameless Advisor Topics: say "[reply entry][paragraph break]".

–Glimmr

I think most of the Glimmr extensions that you might officially find are for older versions of Inform–6G60, specifically. The main Glimmr dev basically stopped working on it before the next Inform update, which changed a lot of things. (In particular, I think that the formatting of the Table of Common Color Values got changed–that may be a table that’s in Glulx Text Effects, which did get updated–that leads to the kind of error you got.)

The latest I know of Glimmr is here–some of the extensions are getting updated for use in Kerkerkruip and can be found at Kerkerkruip’s Github page. But it might not be easy to get versions that work with the latest Inform.

Thanks so much for the comprehensive reply.

Definition: a room is canal bank if it is either the Triangle Hole or the Circular Hole or the Square Hole.

This works perfectly with Alternatives. I think it seems to work well with IF statements, but not with INSTEAD…WHEN… statements. (I think “either” is a part of the extension that adds the word “or”)

I was sketchy on how Definitions worked, so this helps clear that up a bit as well.

–The dark room thing:

Rule for printing the description of a dark room when the location is in the Waterway:

This actually kicks back a different error:

Just to clarify, the waterway is a region that contains the rooms of the canal.

–Instead of doing anything other than:

Instead of doing anything other than Jack action during jackscene1: say "Hey, I didn't say you could do that."

This works! Thank you. I did not know you could do this.

–Interrogating

It was the quotes. That fixed it! Thank you.

–Glimmr

Thanks for the link, I will try these out to see if they work any different.

Cheers for your help overall.

Don’t know if this will work, but you might try:

Rule for printing the name of a room when the location is in the Waterway and the location is dark.

Oh man, I have to apologise.

Rule for printing the description of a dark room when the location is in the Waterway:

…did work, but I had a typo in my initial declaration of the region which is why it didn’t understand it. Sorry!

So this is moot, see above, but I think this doesn’t work because “printing the name of a dark room” doesn’t actually go by printing the name of the room… it’s a special activity that usually prints “Darkness” without checking the room name.

In my initial post I’d asked a question about exceptions. One issue I was having with this was with multiple scenes:

So the example:

Instead of doing anything other than waiting during jackScene1: say "Hey, I didn't say you could do that."

…works. But what if you want that to happen during 3 or 4 scenes?

[code]Instead of doing anything other than waiting during jackScene1:
say “Hey, I didn’t say you could do that.”

Instead of doing anything other than waiting during jackScene2:
say “Hey, I didn’t say you could do that.”

Instead of doing anything other than waiting during jackScene3:
say “Hey, I didn’t say you could do that.”[/code]

Doesn’t seem efficient.

I thought I had found a solution for this in Example 159: Bowler Hats and Baby Geese. I set “A scene can be restricted or free.” and then labeled all the scenes as restricted. For example:

[code]jackScene1 is a restricted scene.
jackScene2 is a restricted scene.
jackScene3 is a restricted scene.

Instead of doing anything other than waiting during a restricted scene:
say “Hey, I didn’t say you could do that.”[/code]

The three scenes are sequential.

I then add other actions by declaring something like:

Instead of attacking Jack during a restricted scene: try pushing Jack instead;

This all seems to make sense in my head, and matches the way it is written in Example 159. Yet, when I try to compile this, Inform throws back an internal error.

I’m really not sure what I did here as I feel like I copied the example pretty much exactly as it is described in the documentation.

In fact, just to rule out the possibility that I might have done something stupid elsewhere or included a typo, I tested this in a fresh/blank project using only the copy pasted pertinent parts of the example:

[code]A scene can be restricted or free.

Instead of going somewhere during a restricted scene:
say “Better to stay here for the moment and find out what is going to happen next.”

The Broad Lawn is a room. “A sort of fun fair has been set up on this broad lawn, with the House as a backdrop: it’s an attempt to give local children something to do during the bank holiday. In typical fashion, everyone is doing a very good job of ignoring the House itself, despite its swarthy roofline and dozens of blacked-out windows.”

The House is scenery in the Broad Lawn. The description is “A cautious vagueness about the nature of the inhabitants is generally considered a good idea. They might be gods, or minor demons, or they might be aliens from space, or possibly they are embodiments of physical principles, or expressions of universal human experience, or… at any rate they can run time backward and forward so it warbles like an old cassette. And they’re always about when somebody dies. Other than that, they’re very good neighbors and no one has a word to say against.”[/code]

…and it still throws back the internal error.

So assuming this is not me missing something really stupid, is there some alternative way of replicating this functionality? To save me copy pasting and repeating large chunks of code for each scene where I would like an alternative or excluded action to apply?

Thanks.

It sounds like your INSTEAD rules are clashing. “Instead of doing anything except waiting…” is overriding “instead of attacking…” where you redirect to the pushing action, which then gets caught by “instead of doing anything” since pushing is an action that is something besides waiting.

You could try “Instead of doing anything except waiting or attacking jack or pushing jack during a restricted scene.” which should free up your attacking and pushing actions to redirect elsewhere.

This is why you don’t want to rely on INSTEAD for everything because INSTEAD suspends parsing and only follows the directions you write. If you write “instead of switching on the light switch” the parser will follow this written rule instead of every other rule that concerns darkness, whether the switch is already on, whether the room is already lit…which defeats the purpose of the parser entirely.

Hey,

Thanks for the suggestion, but this example…

[code]A scene can be restricted or free.

Instead of going somewhere during a restricted scene:
say “Better to stay here for the moment and find out what is going to happen next.”

The Broad Lawn is a room.[/code]

…is copy pasted directly from the documentation, and even on a clean/new project it still throws back the same error. Even though there are no other Instead rules for this one to conflict with. The functionality of setting a scene as “restricted” or “free” seems to fundamentally break something. I’m wondering if there is an alternative way to be able to do the same thing? Group a bunch of scenes together so that a rule can be applied to two or three scenes without having to repeat code for every scene where a rule is applicable.

Apparently this is reported as a bug already: inform7.com/mantis/view.php?id=1823

Okay, this is a documented bug and it has to do with the word “during”. I got the example to run by saying “while a [adjective] scene is happening”

[code]Testroom is a room. Exit is north of testroom.

A scene can be restricted or free.

Instead of going somewhere while a restricted scene is happening:
say “Better to stay here for the moment and find out what is going to happen next.”

Boring movie is a restricted scene. Boring movie begins when play begins.[/code]

This seems to be the bug:
inform7.com/mantis/view.php?id=1823

Thank you. That works perfectly.