Multi-word nouns

Foo is a room.
The first cat is in Foo.
The other button is in Foo.
The first button is in Foo.
Understand “bar” as the first button.

This complains with a long error message about line 5 being wrong. I have tried several things:

  • “button” refers to the other button
  • “first” refers to the first cat
  • if i have one word as the name, it works fine
  • you can happily say “The first button is a container”, for example.
  • you cannot refer to the first button while in the “When play begins” block

How do i implement line 5?

1 Like

Are you using Inform 10? I copy-pasted your code to Inform 6M62 (the previous version, that I have to use) and it compiled okay.

Can you please paste the error message verbatim?

-Wade

1 Like

ok i forgot to test my code verbatim and it turns out it only fails with number phrases. Try:
Foo is a room.
The other button is in Foo.
The 1 button is in Foo. Understand “bar” as the 1 button.

1 Like

Right. I think the upshot is you can’t / shouldn’t name an object starting with a digit. It’s too difficult for the compiler to sort out, which is enough of a reason to not do it.

If you called the thing ‘1 button’ for your own use as an author (e.g. the player is unlikely to ever call a button ‘1 button’. They might call it ‘button 1/one’, but not ‘1 button’.) just put the number to the right, in words, for your own naming purposes; name the object “button one”. Inform also won’t have a problem if you then say ‘Understand “button 1” as button one.’ You can even get away with ‘Understand 1 as button one’, but such an unqualified connection of the number 1 to the object is a bit fraught and could come back to bite you later, or in other circumstances.

I guess I’d sum up my advice:

  • Don’t start an object’s name with a number
  • Don’t ‘understand (a number on its own)’ as a particular thing, for safety. I’ve a vague memory I saw a post that indicated Inform 10 might block this anyway, or some numeric vagueness, but I can still do this second thing in Inform 6M62

-Wade

3 Likes

ok!

1 Like

ok, i don’t know why this does or does not work, but:

Elevator is a room.
The happy button is in Elevator.
The one dog is in Elevator.
The one button is in Elevator.
Understand “cow” as the one button.

also produces an error.

This example compiles for me. You could post your error message. However, Wade is right in that starting a name with a number might lead to confusion down the road (Inform can understand “one” as “1”)

If I can ask, what are you trying to do? Will players be typing FEED ONE DOG for instance?

I think the problem is in this output:

>x button
Which do you mean, the happy button or the one button?

>one
(the happy button)
You see nothing special about the happy button

Which is a result, as @kamineko and @severedhand point out, from naming something with a number at the beginning (either as a symbol or in words).

Since it looks like you want to have several numbered buttons, you might want to try something like this:

Note that I didn’t bother to change the name of the dog, since that didn’t seem to cause any additional problems (except for the indefinite article).

ETA: note that the parser doesn’t care about order (or even repetition) when parsing multi-word nouns. See this output:

>x one button
(the one button)
You see nothing special about the one button.

>x button one
You see nothing special about the one button.

>x one button one one button button
You see nothing special about the one button.

1 Like

Ok, i figured out that “one” is apparently a synonym for “1” (i think). So, say, ‘cow button’, would work