The 'think about' verb

Hi forum. I am not so great with Inform 7 and I need some help.

I’m trying to build a ‘think about’ system that covers both things (present and absent) and topics, and where the responses can change depending on circumstance (e.g. whether you have seen the ficus tree, or which room Laura’s unconscious body is in right now)

I can see a bunch of ways to implement this but most of them strike me as bug-prone or very clunky and time-consuming. Does anyone have a relatively sleek suggestion for me?

I’m not sure this is as “sleek” as you’re looking for, but I used the “THINK” command in The Bibliophile. I just used a bunch of instead lines with if/then filler. For example:

instead of thinking in The Kitchen: if the player does not carry the wallet: say "You think you left your wallet in here somewhere last night."; otherwise: say "Nothing comes to mind right now."

Not wonderfully elegant, but you get the gist, I hope.

I do, and that could work for a bunch of stuff. Was sort of hoping to be able to implement a sort of topic-lookup for it, so you could think about both objects and concepts (e.g. “think about laura”, “think about love”, and “think about new washington”)

That might be something that using Tables could help with. Unfortunately, that’s a weakness of mine as I rarely make tables in my code. Hopefully someone can chime in with further help.

I just got a tables suggestion on twitter, too. It looks straightforward! Hopefully implementing it will be too XD

If you want to allow “think about” for objects and topics one thing to do is to define two different actions:

Thinking about is an action applying to one topic. Understand "think about [text]" as thinking about. Pondering about is an action applying to one visible thing. Understand "think about [any thing]" as pondering about.

Then you could have one table for looking up topics for thinking about (the text typed in is stored in “the topic understood”) and another table for looking up objects for pondering about. Or other rules for thinking about or pondering about.

If you want rules that apply to both kinds of thinking, you could use kinds of action:

Thinking is a mental action. Pondering is a mental action. Before a mental action when the location is the Loud Room: say "You can't possibly think with all this racket!" instead.

(Defining kinds of action can be kind of tetchy but I think you can usually omit the prepositions–maybe the existence of the plain “thinking” action would be problematic though.)

Hope this is helpful!

An alternate implementation is to use objects to represent abstract ideas meant to be thought about, rather than topics. This makes it easier to track whether something has been thought about by the player and make inferences, and keeps it down to one action. This works really well with Eric Eve’s Epistemology extension.

Include Epistemology by Eric Eve.

Things have some text called thought. The thought of a thing is usually "You can't think of anything relevant about it right now."

Thinking about is an action applying to one visible thing. Understand "think about [any thing]" as thinking about.

Check thinking about:
    if the noun is not known, say "That's not something you know.";
    rule fails.

Report thinking about:
    say the thought of the noun.

War is a subject. The thought is "It never changes."