Consulting it about both objects and topics

So, in Robin & Orchid, we have a wonderfully implemented notebook that can be CONSULTED about almost everything in the game. What’s notable about it though is that it can be consulted about abstract topics (CONSULT NOTES ABOUT HIGH SCHOOL) and about people and objects in the game (CONSULT NOTES ABOUT THE BASEMENT). It even works with constructions like CONSULT NOTES ABOUT HERE or X AIDEN; CONSULT NOTES ABOUT HIM. Is there some elegant, simple way to implement this behaviour?

You need to define a replacement for consulting it about which takes an object rather than a topic. That will cover “him” and “here”. Then you can do something like Threaded Conversation does and put topics (as objects, with synonyms and all) in a transparent scenery container which is part of a backdrop.

You can also take care of topics by leaving in the old consulting it about action; then “consult book about foo” will go to your new action if foo is an in-scope object and otherwise to consulting the book about the topic “foo.” (Then you don’t have to do the transparent scenery container which is part of the backdrop.) Proof of concept:

[code]The Cave is a room. A book is in the cave.

Reading in it about is an action applying to one thing and one visible thing. Understand “consult [something] about [something]” as reading in it about. [And you would want to include the rest of the commands that lead to consulting it about; see the index or standard rules.]

Instead of reading in something about something: say “You can’t consult [the noun] about anything.”
Instead of reading in the book about something: say “The book tells you many interesting things about [the second noun]; interesting that it is something you have encountered.”

Instead of consulting the book about “melons”: say “You need to leave now.”; end the story.
Instead of consulting the book about “the/an answer”: say “The book has the answer!”

Test me with “actions/consult book about me/consult book about the answer/consult book about book/consult book about flibbertigibbet/consult book about melons”.[/code]

Small correction: you want to use [any thing] for the second noun.

I have a working version, but now my main issue is having the parser understand “here.” I’ve tried:

Understand "here" as the location.

But that throws up:

If I understand the standard rules correctly, the location is an object that varies. You can’t have the parser understand something as the expansion of a variable?

No, it has to be 'Understand “x” as ". But you can add a condition clause, thus:

Understand “here” as a room when the item described is the location.

Note that the clause is only necessary if you’re putting many rooms in scope, or using an “[any room]” token in a grammar line. If only one room at a time is in scope, you could just say 'Understand “here” as a room."

And that actually works as expected. Thanks; it really helps.