Problem with Extension(s)

Hi all

I’m very new to Inform and was wondering if I could get some help.

I’ve been tearing my hair out trying to compile a game that worked just fine before and now, seemingly for no reason, won’t. And what makes it even more boggling to me is that it’s an error with an extension. It’s Conversational Framework by Eric Eve, and the errors are:

          [code]In Book 2 - Abbreviated commands for addressing the current interlocutor in the extension Conversation Framework by Eric Eve:

Problem. In the sentence ‘let np be the number of visible people who are not the player’ , I was expecting to read a description of values, but instead found some text that I couldn’t understand - ‘visible people who are not the player’.

I was trying to match this phrase:

number of (visible people who are not the player - description of values)

This was what I found out:

visible people who are not the player = something unrecognised


Problem. In the sentence ‘let the interlocutor be a random visible person who is not the player’ , I was expecting to read a description of values, but instead found some text that I couldn’t understand - ‘visible person who is not the player’.

I was trying to match this phrase:

a/-- random (visible person who is not the player - description of values)

This was what I found out:

visible person who is not the player = something unrecognised


In Book 3 - Greeting Protocols, Chapter 2 - Greeting in the extension Conversation Framework by Eric Eve:

Problem. In the sentence ‘now the noun is a random visible person who is not the player’ , I was expecting to read a description of values, but instead found some text that I couldn’t understand - ‘visible person who is not the player’.

I was trying to match this phrase:

a/-- random (visible person who is not the player - description of values)

This was what I found out:

visible person who is not the player = something unrecognised[/code]

I’ve had Conversational Framework and Defaults installed since the beginning so I’m very confused.

Thanks!

First question: Have you added any other extensions recently?

Second question: Are you using the word “visible” in your own code for any reason?

Thanks for the reply Mr. Aikin!

In response to your first question
The only extension that I’ve added recently is List Control by Eric Eve, and that was after the fact to try and fix the problem, which it did not.

Complete list of extensions included: Basic Help Menu by Emily Short.
Basic Screen Effects by Emily Short.
Plurality by Emily Short.
Epistemology by Eric Eve.
List Control by Eric Eve.
Conversation Framework by Eric Eve.
Conversational Defaults by Eric Eve.

In response to your second
Yes. Only once and it relates to conversation. Here is the code:

Talking to is an action applying to one visible thing. Understand "talk to [someone]" or “converse with [someone]” as talking to. Check talking to: say "[The noun] doesn't reply."

I can’t remember if this was written after or before I started having problems. I’m pretty sure it was already there.

I just realized I forgot to add this to the problem list that came out. This is the part of my code.

and here is the code:

Rule for printing a refusal to act in the dark: if player is examining something, say "There is not a complete absence of light here but not enough to continue on in safety." otherwise "Your headlamp illuminates your path adequately."

There I think you want “if examining something” or “if examining something” rather than “If the player is examining something.” If you want to do something more complicated you could use the current action (see section 12.20 of the documentation), but you probably don’t need it here.

The error message is definitely bugged – it looks like this one, but maybe it’d be worth reporting.

I’m also not sure that you can put the if and the otherwise on the same line like that, but I could be wrong.

(I’m a bit confused by the otherwise message – if it’s a refusal to act in the dark, isn’t it misleading to say “Your headlamp illuminates your path adequately”? That suggests that there is sufficient light.)

Thanks for pointing that out Matt! I cleaned up my code and that part seems to be working correctly (for now anyways), thank you. i changed it to:

[code]Rule for printing a refusal to act in the dark:
if examining something:
say “There isn’t a complete absence of light here but not enough to examine something adequately.”

Visibility rule when in darkness:
if the headlamp is switched on:
say “Your headlamp illuminates your path adequately.”

Visibility rule when in darkness:
if the headlamp is switched off:
say “It’s too dark here to continue on.”[/code]

I wonder if that will be run now but I won’t know yet because I’m still getting the same error messages with the extension. There’s something I must be missing because it worked fine before. Why would it give me errors/bugs in the extension? I’ve tried re-downloading and installing but it doesn’t seem to help.

My Inform is really rusty, so no guarantees, but if you want to send me the source code I’ll take a look at it and see if I can spot anything wonky. Sometimes it’s something completely unrelated to the error message, like a missing carriage return character or something. I’m at midiguru23 [at] sbcglobal [dot] net. If you want to try this, let me know which versions of all of the extensions you have. My extensions folder is fairly current, but not completely…

This seems dangerous – if you aren’t examining then this won’t print anything at all, I don’t think. You can try this:

Rule for printing a refusal to act in the dark: if examining: say "You can't see anything in here."; otherwise: continue the activity.

(Doesn’t help with your other issue of course.)

Also looking at 17.16 suggests that “if we are examining something” would also work.

You’re absolutely correct, I really missed that one, thanks. Yeah, if you’re in the dark how would you examine anything anyway? :blush: What you have is much better. I think I wanted to incorporate low-light conditions, in which you could move around but not examine, but I can’t remember.

Yeah, I think I was looking at 17.16 when I wrote that. Thanks, Matt, what a huge help.

This extension thing has got me really bummed. Maybe I should learn Inform 6 or TADS?

If you don’t know anymore what has changed between when it worked and when it stopped working, the best (maybe only) way to debug is to start a new project, copy-paste the story source code there and remove code small segments at a time and trying to compile in between changes. When the story compiles normally you know that you’ve just removed the offending part.

(It also helps to compile more often instead of writing huge chunks before trying if any of it works.)

This still isn’t on point with your main problem, but now that I look at your visibility rules they aren’t actually making any decisions about visibility – your “headlamp is switched on” rule should almost certainly end “there is sufficient light,” and the “your headlamp is switched off” rule should maybe be a rule for refusing to act in the dark (though it might be harmless if you don’t have too many complicated things going on with which actions require light). See section 12.19.

As for your main problem, I was able to reproduce these errors by adding this line to a short source code (along with the extensions):

The player piano is a thing.

Is it possible that you’ve recently defined something with “player” in its name? Then the extensions might be trying to interpret “player” as referring to the player piano (or whatever it is) and getting all mixed up, probably because the player piano isn’t a person. (Adding “the player hater is a person” doesn’t lead to these errors – though I bet it’d lead to all sorts of crazy bugs.)

Sounds like it might be related to Inform bug 956.

You could also write it like this.

Rule for printing a refusal to act in the dark while examining: say "You can't see anything in here.".

This also has the advantage of being a more specific rule and therefore given a higher priority.

Hope this helps.

Yes, climbingstars’ rule is better – I was trying to think of something like that but couldn’t remember the exact syntax.

Fixed!

Could be, i don’t know.

Thanks Juhana, I forgot I had saved an earlier version in Glulxe, so it was just a matter of finding the differences.

The offending code:

The player carries a headlamp The headlamp is a device; it is switched off. The player carries a breather The breather is a device; it is switched off.

All I had to do is create spaces between each line and then it compiled fine. Anyone know the reason for this? Just so I can understand and learn a bit more.

Then matt w your comment helped me find it a lot easier, thanks! And I see what you and climbingstars are saying about the acting in the dark rule. Would this work?

[code]Rule for printing a refusal to act in the dark while going: say “It’s too dark to continue on.”.

Visibility rule when in darkness:
if the headlamp is switched on:
say “Your headlamp illuminates your path adequately.”

Visibility rule when in darkness:
if the headlamp is switched off:
say “It’s too dark here to continue on.”
[/code]

Or is it to much and I don’t need the visibility rules? Guess I should test them and see. Thanks again guys!

You need full stops after some of those lines – adding extra blank lines effectively created the full stops. So if you’d written “The player carries a headlamp.” and “The player carries a breather.” it would have been fine.

As it is, I think Inform was interpreting your line thus: “(The player carries a headlamp The headlamp) is a device; it is switched off.” and trying to create a device with the unusual name of “The player carries a headlamp The headlamp”. Since that has “the player” in it, it was running into the problem we were talking about. (As far as Inform knows, that’s a sensible thing to call a device.)

EDIT: The problem with your visibility rules is that they aren’t actually doing anything to the visibility. You need to end them with “there is sufficient light” and “there is insufficient light” – that’s how a visibility rule tells the rest of the game whether it’s too dark. (As far as I know – I’ve never actually done anything with visibility to speak of.)

If you bring a light source into a dark room, you will be able to see automatically, without writing your own visibility rules. So, if your rule for switching the headlamp on makes it ‘lit’, you don’t need these visibility rules.

Thanks for the explanation Matt.

I understand what you and Felix are saying about the visibility rules now. I didn’t really understand what I was writing them for, or I thought it was for something different.

Felix said:

Yeah, you’re right. i think this is what I confused Matt about. I thought I was writing a rule for whenever I turn on my light in a dark room.

Yes, ordinarily the player can (try) do anything in a lighted room, but in a dark room the player cannot perform such actions as are defined as’ requiring light’.

Sometimes, you might wish to let the player perform some such action in some dark room (or in all dark rooms under some conditions, like wearing infra-red goggles), or you might wish the player to be unable to perform some such action in some lighted room (or in all lighted rooms under some conditions, like having been temporarily blinded): that’s the kind of situation the visibility rules are for.

Thanks Felix, that makes complete sense now.

Really, thanks to everyone.

Being obviously brand new at this, I was feeling a bit of apprehension to come and post/ask for help. I’m glad I did now, you guys are a fine group of people. Thanks for making me feel welcome.

I’m sure I’ll be posting more!