How do I limit the standard verbs used in Inform 7?

Was wondering if it is possible to use a limited number of standard verbs (ie TAKE/GET. KILL/ATTACK, DROP, etc) and eliminate the unused portion in Inform 7? Is there a rule for that?

Funnily enough, I found this cool page just yesterday that you can use to disable the standard actions you don’t need.

(I figure there is probably a way to whitelist the actions you do need rather than blacklist all the ones you don’t, but this can be sort of a stopgap measure.)

Thanks Brian! I will check that out! :slight_smile:

Belatedly, but this is the aforementioned whitelist, and the nuclear option:

After reading a command:
	if the player's command matches "[accepted command]" or the player's command includes "verb1" or the player's command includes "verb2": (LIST OF VERBS YOU WANT TO ENABLE HERE, ONE BY ONE): 
		make no decision;
	otherwise:
		carry out the verb reminding activity;
		reject the player's command.[/code]

You will need to define [accepted command]; here's an example:

[code]
Understand "restart/restore/save/quit/about/help/amusing/credits/author/info/testers/look/l/wait/z/score" as "[accepted command]".
[/code]

(This is a sample list; you can put anything you want in here, as long as they are single-word commands. At a minimum, you will probably want to keep the meta-commands around.)

You will also need to create an activity for "verb reminding" (or whatever; this is just what it's called in my code):

[code]Verb reminding is an activity. 

Rule for verb reminding:
	say "(whatever you want your error message to read)".

Those are the basics. You will almost certainly want to add additional checks in this basic routine, as once you allow a verb in you allow all prepositional offshoots. Be very sure you do not mix up “includes” with “matches,” as doing so will introduce bugs. (The documentation goes over the distinction, though it should be pretty self-explanatory.)

Also: These are the basics for verbs. They are NOT the basics for nouns. This system plays very nicely with keyword-only commands (like those in Blue Lacuna, for instance), and all you need to do to enable those in the parser is add these two lines:

otherwise if the player's command matches "[a thing]": make no decision;

Lucea, I don’t think your option is quite nuclear enough. The player’s command may have multiple instructions, joined with commas or "then"s. As long as one of the commands is in your whitelist, the whole string will get through. A short example:

"Original Sin" by JRB

The Garden is a room. The forbidden fruit is in the Garden. The forbidden fruit is edible.

Carry out eating the forbidden fruit:
	say "Disobedience! You are expelled from the garden forthwith.";
	end the story.

Praying is an action applying to nothing. Tilling is an action applying to nothing. Understand "pray" as praying. Understand "till" as tilling. Report tilling: say "You till industriously." Report praying: say "You pray piously."

Understand "restart/restore/save/quit/about/help/amusing/credits/author/info/testers/look/l/wait/z/score" as "[accepted command]".

After reading a command:
	if the player's command matches "[accepted command]" or the player's command includes "till" or the player's command includes "pray": 
		make no decision;
	otherwise:
		carry out the verb reminding activity;
		reject the player's command.

Verb reminding is an activity. 
Rule for verb reminding:
	say "Please confine yourself to tilling or praying."

I can bring about the Fall of Man with

pray then eat the forbidden fruit

You can also, for additional safety, unlist the existing commands. Danse Nocturne has (at the time of release) a complete list:

Understand the commands "take", "carry", "hold", "get" and "pick" as something new. Understand the command "stand" as something new. Understand the commands "remove", "shed", "doff", "wear" and "don" as something new. Understand the commands "put", "insert", "drop", "throw" and "discard" as something new. Understand the commands "give", "pay", "offer", "feed", "show", "present" and "display" as something new. Understand the commands "go", "walk" and "run" as something new. Understand the commands "inventory", "i" and "inv" as something new. Understand the commands "look", "l" and "consult" as something new. Understand the commands "open", "unwrap", "uncover", "close", "shut" and "cover" as something new. Understand the commands "enter", "cross", "sit", "exit", "leave" and "out" as something new. Understand the commands "examine", "x", "watch", "describe", "check" and "read" as something new. Understand the commands "yes", "y", "no" and "sorry" as something new. Understand the commands "bother", "curses", "drat", "darn", "shit", "fuck" and "damn" as something new. Understand the command "search" as something new. Understand the command "wave" as something new. Understand the commands "set" and "adjust" as something new. Understand the commands "pull", "drag", "push", "move", "shift", "clear" and "press" as something new. Understand the commands "turn", "rotate", "twist", "unscrew", "screw", and "switch" as something new. Understand the commands "lock" and "unlock" as something new. Understand the commands "attack", "break", "smash", "hit", "fight", "torture", "wreck", "crack", "destroy", "murder", "kill", "punch" and "thump" as something new. Understand the commands "wait" and "z" as something new. Understand the commands "answer", "say", "shout", "speak", "tell" and "ask" as something new. Understand the command "eat" as something new. Understand the commands "sleep" and "nap" as something new. Understand the command "sing" as something new. Understand the commands "climb" and "scale" as something new. Understand the commands "buy" and "purchase" as something new. Understand the commands "squeeze" and "squash" as something new. Understand the commands "take", "carry", "hold", "get" and "pick" as something new. Understand the command "swing" as something new. Understand the commands "wake", "awake" and "awaken" as something new. Understand the commands "kiss", "embrace" and "hug" as something new. Understand the commands "think" as something new. Understand the commands "smell", "sniff", "listen", "hear", "taste" and "touch" as something new. Understand the commands "rub", "shine", "polish", "sweep", "clean", "dust", "wipe", and "scrub" as something new. Understand the commands "tie", "attach" and "fasten" as something new. Understand the commands "burn" and "light" as something new. Understand the commands "drink", "swallow" and "sip" as something new. Understand the commands "cut", "slice", "prune" and "chop" as something new. Understand the commands "jump", "skip" and "hop" as something new.

Full source here.

Ha. That said, while I haven’t tested this yet, I suppose you could get around this issue by doing a check for instances of “then” then removing the matched snippet. It would return a parser error, probably, but anyone who tries this probably knows what they’re doing.

Sure, though dealing with commands connected by commas might take some work, since commas have various other uses in command input.

I sometimes wonder why we have the convention of allowing multiple commands to be entered at once; it’s main function seems to be as a trap for authors who want to play around with the parser. (But that’s probably wrong - I never use multiple commands myself when playing, but I remember from a thread some time ago that lots of people do.)

I think that’s a relic of slower computers, when there might be a significant delay between your command and the response. So if you needed to navigate to the other side of the map quickly you could type “N.E.E.S.SE.D.NW.W.N.W.W.” and then let it process without interaction for a while, rather than having to pause between each directional command.

It’s still useful in that context for things like ClubFloyd…though Inform games lack Infocom’s niceties in that regard (cutting your list of commands short if one of them fails, or if something interesting happens that you might want to react to).

It’s a reasonable convention to keep around. Sometimes you want to rack up a set of commands like “E. PULL LEVER. READ DIAL. PUSH LEVER. W” and either paste them in a lump, or use up-arrow command history to fetch them in a lump.

The problem is that Inform’s handling of multiple commands is rickety, and the “after reading a command” feature makes it easy to gloss over the situation without thinking about it.

This isn’t too hard to hack in. It already has to cut the list short if you die (or win), so the parser structure supports the general concept.

True, but most authors don’t think about action failure or success (since for player actions, nothing in the standard library actually relies on it). So any “instead” rules would by default interrupt action flow.

With Modified Timekeeping it would be easier, though. I’ll look into adding that feature.

I wouldn’t rely on action failure or success, for exactly that reason. Instead I’d define a separate flag “interrupt multiple actions” and let the author set it at will.

I think I did something like this in the I6 days. (Looks…) Yeah, in Dreamhold, in an obscure case where you’re solving a puzzle wrong. It wasn’t very important, I admit.

I wrote a bit of I7 code for interrupting multiple commands, though I didn’t test it very robustly. It’d probably be better to hook it into I6 at the proper place.

My main use-case for multiple commands has been in games where I have to shuttle around a map a lot from one place to the next–I remember using them a bunch in Metamorphoses when I wanted to take something back and forth between the rooms where i was working on a puzzle and the metamorphosizing machines.

The way that testing scripts are processed is interesting:

test chemical with "take test tube / examine murky liquid / smell liquid / drink liquid"

runs the commands through the parser one by one. This seems a better model for how multiple commands might be handled.

By the way, I agree that it’s worth keeping multiple commands available. (But I’d be happy to see the end of the comma used as a separator.)

The reason I made this topic, and asked this question is for a simple reason: when I play an interactive fiction, just like anyone who plays, due to lack of verbs to interactive with the scene back in the day, it does suck, but when you get verbs that are useless and yet the player notices that you can use this verb but cannot truly use it in game in an interactive level, even I think that sucks just as much, if not even more then not being able to interact with certain props in the scene. Even when you cannot use it through the entirety of the game, due that the author never had intended to use those verbs, is too excessive, if not a bit much on the memory side. Unless I am wrong, and compiling it to zcode or glulx truncates those unneeded verbs, I find excess and waste not appealing at all,