New action with non-object variable

Hi! I’m just getting started with Inform7, and I’ve been trying to figure out if I can create a new action with a non-object variable that modifies/determines the output.
Basically, I’m talking about adverbs. The sandboxy project I’m working on (not a full game, just for fun!) is a modified conversation system based on replies, e.g.:

However, I’ve been combing through the documentation, and can’t find any workarounds that might support a system like that. I’ve hacked together something functional with Mark Tilford’s Simple Chat, because the node structure works pretty well for me, but I’d really prefer the flexibility of a more traditional parser input that would also allow for breaking out of the conversational thread (changing the topic etc.) without being too overt about it. And of course, I’m just curious to see if it can be done at all.
At this point I’m pretty much out of ideas, so any advice would be appreciated!

Two ways you can approach this: you can either make the adverbs into secret hidden things, and place them in scope only when replying. (See Example 350.)

Or you can make the replying action pertain to text rather than objects:

Understand "reply [text]" as replying.

You’d then use ‘the topic understood’ to refer to that text. See 16.5: The text token.

The second option is probably quicker and easier; the first option will give you more flexibility. (You might run into trouble if you want an action that takes two nouns and an adverb, though.)

Thanks so much, that is really helpful! I’ll try it both ways and see how it works out. :slight_smile:

A third approach would be to make the adverbs a kind of value. If you called the kind of value “intonation,” then you would make your action apply to one intonation, and use “the intonation understood” to refer to the intonation the player entered.

[code]Intonation is a kind of value. The intonations are aggressively, pacifically, and firmly.

Hailing is an action applying to one intonation. Understand “hail [intonation]” as hailing.

Report hailing: say “You [intonation understood] say, ‘Hail!’”

Before hailing aggressively:
say “Are you sure you want to adopt that tone?”;
unless the player consents, stop the action.

Auditorium is a room.[/code]

(The bit about “the player consents” is just something that stops to ask the player yes or no before going on.)

However, if you do this you might also have to create an action that understands “hail [text]” so you could print friendlier error messages when the player enters an adverb that isn’t one of yours. So maga’s second approach may be better anyway.

Adverbs are generally thought to be an anti-pattern in IF. Instead of using adverbs, you might be able to use more specific verbs - English has lots of them luckily! However as this is a conversation, you might be better off using a conversation engine with suggested responses. I don’t know if everyone else would agree, but I feel like having responses like “you could threaten the monster, apologise for intruding, ask the monster about itself” is subtler and therefore better than putting aggressive, penitent or inquisitive right out there.

Well, seeing as this is a sandboxy project for fun and not a full game, quollish may as well stick with adverbs.