Using Default Messages by Ron Newcomb

Okay… this one has me confused (yet again).

Using Default Messages by Ron Newcomb I am trying to replace library message 30.

In the examples I see:

– 30 “I don’t know the word ‘[the misunderstood word]’.”

and even this should work:

– 30 “I don’t know the word [the noun].”

But my attempt of:

– 30 “Are you having flashbacks again? I am not seeing a [the noun] here.”

or

– 30 “Are you having flashbacks again? I am not seeing a [noun] here.”

Gives me the this if player tries to take an imaginary object:

take unicorn
Are you having flashbacks again? I am not seeing a nothing here.

If I use [the noun] or [noun] this is what I get… and I get a compile error if I use the [misunderstood word]:

Problem. In the sentence ‘“Are you having flashbacks again? […]”’ I was expecting to read an object, but instead found some text that I couldn’t understand - ‘misunderstood word’.

As usual, I am probably missing the obvious… but if someone tries to take an imaginary object (in my tests, a unicorn) I wanted something better than “You can’t see any such thing.”

Other replacements have worked fine… Using just straight text and [noun] in the replacement message. For example, this works fine:

going action 2 “You can’t go [noun] from here. [list the exits]”

So what am I missing?

Does your source contain the decide phrase that identifies the misunderstood word?

To decide which snippet is the misunderstood word: (- (((wn - 1) * 100) + 1) -).
I suppose that phrase is what makes it all work.

Or you could use my extension Lost Items. This is exactly the kind of thing I intended it for. It is compatible with Default Mesages, and I can offer personal technical support… :smiley:

inform7.com/extensions/Mike%20Ci … index.html

That is what I was missing! Thank you very much.

I will look into Lost Items too… it might come in useful for other things I may try.

Sorry for the late reply, a huge storm came through last night and my internet connection has been down all day. I have been going through withdrawals all day!

OT:

A storm knocked mine out last night too (for about 9 hrs). You don’t live in central FL do you? (And yes, I realize that storms are a worldwide phenomenon and that internet outages are common enough that this isn’t really that big of a coincidence – I’m just curious.)

Yeah, southeast Tampa near the fairgrounds. It was rough night, and it hasn’t stopped yet. Still up and down. I have to carefully time hitting the submit button. :wink:

Also, I was wondering, can you explain what the math means that made this work? It works, so I don’t NEED to understand, but I am the type that likes to understand… and to know why something works. It helps in overall knowledge of the programming structure, and will help in the future if other cases where something similar might come up.

Well, a snippet is an I7 concept. It’s one or more consecutive words in the last input from the player. The whole of this input (the maximum snippet of any “turn” of the game) is aptly referred to as “the player’s command” in I7 source text. – I guess you knew all that already.

In I6 a snippet is represented as a number: The first word in the player’s command is number 1, the second number 2 and so on; multiply the number of the word where the snippet starts with 100 and then add the number of consecutive words in the snippet and you get the I6 value of the snippet.

A five words player’s command like GIVE BANANA TO HUNGRY ORANGUTAN is thus represented by the number 105 (meaning the snippet begins with word #1 and is five words long); the snippet BANANA is represented by the number 201 (begins with word #2 and is one word long); the number 402 would represent the snippet HUNGRY ORANGUTAN, etc.

“wn” is a global I6 variable (the number of the currently parsed word in the input) (guess its an acronym for “word number”). After reading a word the parser increments wn, so the last word read becomes wn-1.

So

((wn - 1) * 100) + 1

means that the snippet value for the misunderstood word begins at the last parsed word (wn - 1) and is one word long.

(And – though, again, I’m sure you already know it – the “(- -)” notation simply means that we enter I6 code.)

(If you want to go to the sources, this is explained in the comments to §§ 4 & 5 of the Parser Template in Appendix B – and I think the I6 Designer’s Manual goes into some details about the way the parser reads input etc.)

Wow! Thank you. That is an excellent explanation.

And knowing this will be very useful.

Now I have another 510 page appendix to digest. This is one I hadn’t looked at yet. Appendix A was hard enough. :wink: But it is definitely “need to know” information.

Thanks again.