How to discard most default actions and rules?

I am writing a small game and I dont need most of the default actions.

I created an awkward :
instead of the player doing something other than…
and a:
Rule for printing a parser error

to block all commands except a few.

But for example if the player types “attack”
there is the default rule that provides a missing noun that displays “(Charles)” if for example a person called Charles is here, before writing the expected error message.

How can I disable all these kind of problems I can’t even imagine since I don’t know all the default rules and actions?

Below is code for making Inform forget all player’s command verbs defined by the Standard Rules. Edit to suit your purpose.

[rant]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.
[Understand the commands “score”, “quit”, “q”, “save”, “restart” and “restore” as something new.
Understand the commands “verify” and “version” as something new.
Understand the commands “script” and “transcript” as something new.
Understand the commands “superbrief”, “short”, “verbose”, “long”, “brief” and “normal” as something new.
Understand the commands “nouns” and “pronouns” as something new.
Understand the command “notify” as something new.][/rant]

(This approach won’t result in a notably smaller game file however. All the actions etc. will still be defined as usual, only the player can’t trigger them. So, its usefulness depends on why you want to disable standard actions.)

2 Likes

There is no simple solution ? incredible!
Anyway thank you it will be useful. I will delete just the few I need the parser to answer to ^^

It’s looking more and more like I7 may not be the right language for your project.

There has been talk of writing a “Standard Rules Lite” extension. I did some poking around to see if I could delete all actions at a low level, but there appear to be complications.

I could have sworn someone else has already started work on the project though. Was it Ron Newcomb?

I’m pretty sure that “Default Messages” (which I love) will let you define a custom default response.

This is a simple but brutal solution, which basically throws out the whole parser and then puts a few bits back in:

[code]Section Grammar (in place of Section SR4/10 - Grammar in Standard Rules by Graham Nelson)

[by Juhana Leitonen]

Understand “quit” or “q” as quitting the game.
Understand “save” as saving the game.
Understand “restart” as restarting the game.
Understand “restore” as restoring the game.
Understand “verify” as verifying the story file.
Understand “version” as requesting the story file version.
Understand “script” or “script on” or “transcript” or “transcript on” as switching the story
transcript on.
Understand “script off” or “transcript off” as switching the story transcript off.[/code]

Simply writing a section that goes in place of SR4/10 eliminates the part of the Standard Rules that contains all the declarations; the actual section puts back some of the metacommands that your players are going to want. (Especially quitting. Don’t remove quitting.) Then you’d have to declare all the commands that you want to work – in the games Juhana and I used this in, we were processing commands entirely through keywords.

Even with this section put in, the game will still understand a direction as going in that direction (so “w” would be understood as going west). I think that’s hardcoded into I6.

I tried ripping out the whole of Part SR4, which includes not only the grammar section but all the action definitions and specific action processing rules. That didn’t go so well - most of the actions are built into I6, below even the template layer.

But your idea makes me think I can at least do a little better. Here I copied Part SR4 and edited out all the specific action processing rules except for the out-of-world ones. Then I used your grammar section:

[spoiler][code]Part SR4 - Minimal Actions (in place of Part SR4 - Actions in Standard Rules by Graham Nelson)

Section SR4/1 - Generic action patterns

Section SR4/2 - Standard actions concerning the actor’s possessions

Taking inventory is an action applying to nothing.
The taking inventory action translates into I6 as “Inv”.
Taking is an action applying to one thing.
The taking action translates into I6 as “Take”.
Removing it from is an action applying to two things.
The removing it from action translates into I6 as “Remove”.
Dropping is an action applying to one thing.
The dropping action translates into I6 as “Drop”.
Putting it on is an action applying to two things.
The putting it on action translates into I6 as “PutOn”.
Inserting it into is an action applying to two things.
The inserting it into action translates into I6 as “Insert”.
Eating is an action applying to one carried thing.
The eating action translates into I6 as “Eat”.

Section SR4/3 - Standard actions which move the actor

Going is an action applying to one visible thing.
The going action translates into I6 as “Go”.
Entering is an action applying to one thing.
The entering action translates into I6 as “Enter”.
Exiting is an action applying to nothing.
The exiting action translates into I6 as “Exit”.
Getting off is an action applying to one thing.
The getting off action translates into I6 as “GetOff”.

Section SR4/4 - Standard actions concerning the actor’s vision

Looking is an action applying to nothing.
The looking action translates into I6 as “Look”.
Examining is an action applying to one visible thing and requiring light.
The examining action translates into I6 as “Examine”.
Looking under is an action applying to one visible thing and requiring light.
The looking under action translates into I6 as “LookUnder”.
Searching is an action applying to one thing and requiring light.
The searching action translates into I6 as “Search”.
Consulting it about is an action applying to one thing and one topic.
The consulting it about action translates into I6 as “Consult”.

Section SR4/5 - Standard actions which change the state of things

Locking it with is an action applying to one thing and one carried thing.
The locking it with action translates into I6 as “Lock”.
Unlocking it with is an action applying to one thing and one carried thing.
The unlocking it with action translates into I6 as “Unlock”.
Switching on is an action applying to one thing.
The switching on action translates into I6 as “SwitchOn”.
Switching off is an action applying to one thing.
The switching off action translates into I6 as “SwitchOff”.
Opening is an action applying to one thing.
The opening action translates into I6 as “Open”.
Closing is an action applying to one thing.
The closing action translates into I6 as “Close”.
Wearing is an action applying to one carried thing.
The wearing action translates into I6 as “Wear”.
Taking off is an action applying to one carried thing.
The taking off action translates into I6 as “Disrobe”.

Section SR4/6 - Standard actions concerning other people

Giving it to is an action applying to one carried thing and one thing.
The giving it to action translates into I6 as “Give”.
Showing it to is an action applying to one carried thing and one visible thing.
The showing it to action translates into I6 as “Show”.
Waking is an action applying to one thing.
The waking action translates into I6 as “WakeOther”.
Throwing it at is an action applying to one carried thing and one visible thing.
The throwing it at action translates into I6 as “ThrowAt”.
Attacking is an action applying to one thing.
The attacking action translates into I6 as “Attack”.
Kissing is an action applying to one thing.
The kissing action translates into I6 as “Kiss”.
Answering it that is an action applying to one thing and one topic.
The answering it that action translates into I6 as “Answer”.
Telling it about is an action applying to one thing and one topic.
The telling it about action translates into I6 as “Tell”.
Asking it about is an action applying to one thing and one topic.
The asking it about action translates into I6 as “Ask”.
Asking it for is an action applying to two things.
The asking it for action translates into I6 as “AskFor”.

Section SR4/7 - Standard actions which are checked but then do nothing unless rules intervene

Waiting is an action applying to nothing.
The waiting action translates into I6 as “Wait”.
Touching is an action applying to one thing.
The touching action translates into I6 as “Touch”.
Waving is an action applying to one thing.
The waving action translates into I6 as “Wave”.
Pulling is an action applying to one thing.
The Pulling action translates into I6 as “Pull”.
Pushing is an action applying to one thing.
The Pushing action translates into I6 as “Push”.
Turning is an action applying to one thing.
The Turning action translates into I6 as “Turn”.
Pushing it to is an action applying to one thing and one visible thing.
The Pushing it to action translates into I6 as “PushDir”.
Squeezing is an action applying to one thing.
The Squeezing action translates into I6 as “Squeeze”.

Section SR4/8 - Standard actions which always do nothing unless rules intervene

Saying yes is an action applying to nothing.
The Saying yes action translates into I6 as “Yes”.
Saying no is an action applying to nothing.
The Saying no action translates into I6 as “No”.
Burning is an action applying to one thing.
The Burning action translates into I6 as “Burn”.
Waking up is an action applying to nothing.
The Waking up action translates into I6 as “Wake”.
Thinking is an action applying to nothing.
The Thinking action translates into I6 as “Think”.
Smelling is an action applying to one thing.
The Smelling action translates into I6 as “Smell”.
Listening to is an action applying to one thing.
The Listening to action translates into I6 as “Listen”.
Tasting is an action applying to one thing.
The Tasting action translates into I6 as “Taste”.
Cutting is an action applying to one thing.
The Cutting action translates into I6 as “Cut”.
Jumping is an action applying to nothing.
The Jumping action translates into I6 as “Jump”.
Tying it to is an action applying to two things.
The Tying it to action translates into I6 as “Tie”.
Drinking is an action applying to one thing.
The Drinking action translates into I6 as “Drink”.
Saying sorry is an action applying to nothing.
The Saying sorry action translates into I6 as “Sorry”.
Swearing obscenely is an action censored, and applying to nothing.
The Swearing obscenely action translates into I6 as “Strong”.
Swearing mildly is an action censored, and applying to nothing.
The Swearing mildly action translates into I6 as “Mild”.
Swinging is an action applying to one thing.
The Swinging action translates into I6 as “Swing”.
Rubbing is an action applying to one thing.
The Rubbing action translates into I6 as “Rub”.
Setting it to is an action applying to one thing and one topic.
The Setting it to action translates into I6 as “SetTo”.
Waving hands is an action applying to nothing.
The Waving hands action translates into I6 as “WaveHands”.
Buying is an action applying to one thing.
The Buying action translates into I6 as “Buy”.
Singing is an action applying to nothing.
The Singing action translates into I6 as “Sing”.
Climbing is an action applying to one thing.
The Climbing action translates into I6 as “Climb”.
Sleeping is an action applying to nothing.
The Sleeping action translates into I6 as “Sleep”.

Section SR4/9 - Standard actions which happen out of world

Quitting the game is an action out of world and applying to nothing.
The quitting the game action translates into I6 as “Quit”.

The quit the game rule is listed in the carry out quitting the game rulebook.
The quit the game rule translates into I6 as “QUIT_THE_GAME_R”.

Saving the game is an action out of world and applying to nothing.
The saving the game action translates into I6 as “Save”.

The save the game rule is listed in the carry out saving the game rulebook.
The save the game rule translates into I6 as “SAVE_THE_GAME_R”.

Restoring the game is an action out of world and applying to nothing.
The restoring the game action translates into I6 as “Restore”.

The restore the game rule is listed in the carry out restoring the game rulebook.
The restore the game rule translates into I6 as “RESTORE_THE_GAME_R”.

Restarting the game is an action out of world and applying to nothing.
The restarting the game action translates into I6 as “Restart”.

The restart the game rule is listed in the carry out restarting the game rulebook.
The restart the game rule translates into I6 as “RESTART_THE_GAME_R”.

Verifying the story file is an action out of world applying to nothing.
The verifying the story file action translates into I6 as “Verify”.

The verify the story file rule is listed in the carry out verifying the story file rulebook.
The verify the story file rule translates into I6 as “VERIFY_THE_STORY_FILE_R”.

Switching the story transcript on is an action out of world and applying to nothing.
The switching the story transcript on action translates into I6 as “ScriptOn”.

The switch the story transcript on rule is listed in the carry out switching the story
transcript on rulebook.
The switch the story transcript on rule translates into I6 as “SWITCH_TRANSCRIPT_ON_R”.

Switching the story transcript off is an action out of world and applying to nothing.
The switching the story transcript off action translates into I6 as “ScriptOff”.

The switch the story transcript off rule is listed in the carry out switching the story
transcript off rulebook.
The switch the story transcript off rule translates into I6 as “SWITCH_TRANSCRIPT_OFF_R”.

Requesting the story file version is an action out of world and applying to nothing.
The requesting the story file version action translates into I6 as “Version”.

The announce the story file version rule is listed in the carry out requesting the story
file version rulebook.
The announce the story file version rule translates into I6 as “ANNOUNCE_STORY_FILE_VERSION_R”.

Requesting the score is an action out of world and applying to nothing.
The requesting the score action translates into I6 as “Score”.

The announce the score rule is listed in the carry out requesting the score rulebook.
The announce the score rule translates into I6 as “ANNOUNCE_SCORE_R”.

Preferring abbreviated room descriptions is an action out of world and applying to nothing.
The preferring abbreviated room descriptions action translates into I6 as “LMode3”.

The prefer abbreviated room descriptions rule is listed in the carry out preferring
abbreviated room descriptions rulebook.
The prefer abbreviated room descriptions rule translates into I6 as “PREFER_ABBREVIATED_R”.

The standard report preferring abbreviated room descriptions rule is listed in the
report preferring abbreviated room descriptions rulebook.
The standard report preferring abbreviated room descriptions rule translates into
I6 as “REP_PREFER_ABBREVIATED_R”.

Preferring unabbreviated room descriptions is an action out of world and applying to nothing.
The preferring unabbreviated room descriptions action translates into I6 as “LMode2”.

The prefer unabbreviated room descriptions rule is listed in the carry out preferring
unabbreviated room descriptions rulebook.
The prefer unabbreviated room descriptions rule translates into I6 as “PREFER_UNABBREVIATED_R”.

The standard report preferring unabbreviated room descriptions rule is listed in the
report preferring unabbreviated room descriptions rulebook.
The standard report preferring unabbreviated room descriptions rule translates into
I6 as “REP_PREFER_UNABBREVIATED_R”.

Preferring sometimes abbreviated room descriptions is an action out of world and
applying to nothing.
The preferring sometimes abbreviated room descriptions action translates into I6 as “LMode1”.

The prefer sometimes abbreviated room descriptions rule is listed in the carry out
preferring sometimes abbreviated room descriptions rulebook.
The prefer sometimes abbreviated room descriptions rule translates into I6 as
“PREFER_SOMETIMES_ABBREVIATED_R”.

The standard report preferring sometimes abbreviated room descriptions rule is listed
in the report preferring sometimes abbreviated room descriptions rulebook.
The standard report preferring sometimes abbreviated room descriptions rule translates
into I6 as “REP_PREFER_SOMETIMES_ABBR_R”.

Switching score notification on is an action out of world and applying to nothing.
The switching score notification on action translates into I6 as “NotifyOn”.

The switch score notification on rule is listed in the carry out switching score
notification on rulebook.
The switch score notification on rule translates into I6 as “SWITCH_SCORE_NOTIFY_ON_R”.

The standard report switching score notification on rule is listed in the report
switching score notification on rulebook.
The standard report switching score notification on rule translates into
I6 as “REP_SWITCH_NOTIFY_ON_R”.

Switching score notification off is an action out of world and applying to nothing.
The switching score notification off action translates into I6 as “NotifyOff”.

The switch score notification off rule is listed in the carry out switching score
notification off rulebook.
The switch score notification off rule translates into I6 as “SWITCH_SCORE_NOTIFY_OFF_R”.

The standard report switching score notification off rule is listed in the report
switching score notification off rulebook.
The standard report switching score notification off rule translates into
I6 as “REP_SWITCH_NOTIFY_OFF_R”.

Requesting the pronoun meanings is an action out of world and applying to nothing.
The requesting the pronoun meanings action translates into I6 as “Pronouns”.

The announce the pronoun meanings rule is listed in the carry out requesting the
pronoun meanings rulebook.
The announce the pronoun meanings rule translates into I6 as “ANNOUNCE_PRONOUN_MEANINGS_R”.

The understand token a time period translates into I6 as “RELATIVE_TIME_TOKEN”.

Section SR4/10 - Grammar

Understand “quit” or “q” as quitting the game.
Understand “save” as saving the game.
Understand “restart” as restarting the game.
Understand “restore” as restoring the game.
Understand “verify” as verifying the story file.
Understand “version” as requesting the story file version.
Understand “script” or “script on” or “transcript” or “transcript on” as switching the story
transcript on.
Understand “script off” or “transcript off” as switching the story transcript off.
[/code][/spoiler]

Depending on what you’re doing, you might want to put back the rules and specifications for a couple actions, for example looking, going and taking, which can be triggered by low-level events.

If there’s not already an extension to do this, what do you think about me or Matt or Juhana submitting this modification as an extension?

Yes please! :slight_smile:

Okay, that’s a nice vote of confidence!

What do you think about keeping at least some of the rules for looking, taking, and going? (probably just the ones that interact with each other)

I think I’m remembering what Ron Newcomb did. It was even more drastic - I think he may have even removed most of I6 from the story. I’ll go look for his post…

Here it is:

https://intfiction.org/t/compilation-efficiency/3102/12

It seems like there are several layers which you might want to strip away:

  • Commands which do nothing: rubbing, turning, jumping etc.
  • All commands except those which have a direct effect on the world model: so this also tosses out waiting, listening, asking etc.
  • All commands except for some very basic subset, as you suggest… although I’m not sure whether there could be an agreed-upon subset that would be useful to people. LOOK, TAKE, DROP, GO? (edit: oh yeah, and that EXAMINE thing.)
  • All commands except meta-commands like UNDO etc.
  • Every single command.

Ideally you could offer use options that would let an extension user just pick what they wanted, but until/unless conditional compilation is added to Inform, this isn’t possible.

The most-requested variants of this, it seems to me, are the first and maybe the fourth. Either one would probably find an appreciative audience.

It looks like even Ron’s version doesn’t remove the underlying I6 actions. But they don’t take up so much space, I suppose.

I think the bedrock version of an extension like this needs to strip out everything except the parser-implemented metacommands (OOPS and UNDO), which are not listed in the Standard Rules. It’s easier to paste things back in than it is to remove more things from an already replaced section.

You could then have a couple of pasteable code blocks in the extension docs that users can include to selectively restore some of the layers that Aaron mentioned. Conditional compilation would, as Aaron mentioned, be much nicer–but basic, non-sexy functionality like this has not tended to perform well in the Uservoice rankings. I don’t know how important the votes are when Graham et al make decisions, but if they use votes to prioritize, conditional compilation isn’t happening anytime soon.

–Erik

The actions are gone from the compiled game – along with most everything else that doesn’t explicitly appear in the source – but the Naga project isn’t suitable for being an extension because it breaks so much of I7.

If you’re wanting to remove actions wholly (not just the player’s references as done up-thread), then after doing said replacement, use the template replacement functionality mentioned in 25.25 “The Template Layer” in the manual. Spatchcock stubs as needed.

OTOH, for Michael Bacon’s Interactive Poetry extension (see the Inform site), we just hid the actions, since it was easier than to remove them from the templates and memory.

Did that make sense?

In fact I decided to make a very simple game to learn I7 a bit more and I ended with this problem (lol)
“Very simple” is not so simple to do with inform7 as well :wink:

Ooh this looks nice.
It seems I can add the few actions I need as well.
Thanks a lot!

Yes thank you very much, I in fact need the opening action.
I also use a talking action and an examining action (maybe) as well.
The game is mostly a talk thing… and there is only one room. And it is more a story than a game.

Second vote on the love. Love love love. I think if I had to pick just one extension to bring to a desert island, my brain would explode deciding between that one and Plurality.

I knew there was something like that already! I looked at the site, but as usual, their system of organization doesn’t lead me to anything.

I’ll have a look at Interactive Poetry and think about submitting something complementary, or creating an update.

I guess I should look into it ^^

It seems like the best solution would be restructuring the Standard Rules into more detailed subsections; then we could create new sections “in place of” those to remove specific actions or groups and leave the rest.

For example, if Part SR4 - Actions became a Volume and Section SR4/8 - Standard actions which always do nothing unless rules intervene became a Part then we could assign each action its own Section, such as:

[spoiler]Section SR4/8/- Rub

Rubbing is an action applying to one thing.
The Rubbing action translates into I6 as “Rub”.

The specification of the rubbing action is
“The Standard Rules define this action in only a minimal way, blocking it
with a check rule which stops it in all cases. It exists so that before
or instead rules can be written to make it do interesting things in special
cases. (Or to reconstruct the action as something more substantial, unlist
the block rule and supply carry out and report rules, together perhaps
with some further check rules.)”

Check an actor rubbing (this is the block rubbing rule):
stop the action with library message rubbing action number 1 for the noun.[/spoiler]
… and a corresponding section in Grammar

[spoiler]Section SR4/10/- Rub

Understand “rub [something]” as rubbing.
Understand the commands “shine”, “polish”, “sweep”, “clean”, “dust”, “wipe” and “scrub” as “rub”.[/spoiler]
The Grammar section could then be broken up into equivalent Parts as the action definitions, so they can be removed categorically as well.