A quick question about I7 Understanding statements

Hi everyone,

Just a (hopefully) simple question for someone with more experience than me:

In an “understand” statement in Inform 7 (like understand “the portly gentleman” as Cecil), is there a way to read a term to be understood from a variable or (better still) table? Like, for example, understand X as Cecil?

I tinkered around a bit and couldn’t come up with anything. I’m using cloned objects in the project I’m currently working on (using the Dynamic Objects extension), and I’d like to be able to pull a cloned object’s information, including the name(s) the player can refer to the object as, from a table. You know, if that’s possible.

Is it?

This doesn’t involve table lookup, but you can use one of the object’s properties to refer to it; see 16.15. Understanding things by their properties and in particular the Peers example ( inform7.com/learn/man/ex283.html#e283 ) for one way to do this.

The example Fido ( inform7.com/learn/man/Rex140.html#e140 ) lets you let the player name his dog, but that may be overkill for what you want.

Thank you – working with that idea, I was able to define properties with a table and then refer to objects by their properties (I was forgetting about Inform’s “understand property as referring to” options, which is extremely handy).

I’d also like to say thanks. I was making a practice-game about visiting all 48 mainland states without hitting one twice and couldn’t figure out how to match up a state with its abbreviation property. It works now.