Modifying Inform 7 standard rules

Modifying Inform 7 standard rules - is there any way to do this? I want to change some of the standard messages used.

You don’t usually need to modify the standard rules to change default messages, unless you want to do something complex like changing the inventory list. Try using one of David Fisher’s extensions for changing default messages, Default Messages or Custom Library Messages.

These are really cool. I think I’m going to play with one if time permits after I get my game operational. Any notable difference between the two?

Question about this:

LibMsg <unknown object>			"You can't see any such thing."

Would this (or something like it) work?

LibMsg <unknown object>			"You can't see any such thing.[or]You wish.[or]Fat chance.[at random]"

Also, I’ve never used an extension before – I notice that you do so with an include line, which brings up a more basic question on Inform programming: Can you keep your own source code in several files? If so do you do this with includes too? I haven’t really thought about this yet because my code is in separate files for testing at the moment anyway.

Default Messages is more or less a trimmed-down version of Custom Library Messages, so unless you need the extra stuff in Custom Library Messages, it’s probably best to use Default Messages.

You’d need to add “[one of]” at the start of your message, like so:

LibMsg <unknown object>			"[one of]You can't see any such thing.[or]You wish.[or]Fat chance.[at random]"

But apart from that, I think it should work just fine.

(Incidentally, it’s probably better to use more helpful error messages than “You wish.”, since the player won’t know whether the command was understood and the game is disallowing it, or whether there was a problem understanding the command, like not being able to find a matching object.)

Officially, you have to keep all your code in a single file. If you really want to separate your code into different files, though, you can create your own pseudo-extensions and include them in your project. This is best done with code that you’ve already tested and that is relatively bug-free, since Inform 7 isn’t very helpful when it comes to finding bugs in extensions. Normally all extensions are listed in the credits of the game, but if you want to hide your pseudo-extensions, you can add

Use authorial modesty.

to the code of each of your pseudo-extensions, to stop them from showing up.

Yeah… I was sort of using “you wish” as shorthand. It’s good to know that kind of thing is possible, it could make the game feel more organic while still allowing useful messages.

Putting all the text in one file is not a big deal. I’m not ready to do anything substandard with that yet. I’ll just name my sections wisely.


So – to use this extension, do I just scroll to the messages I want to change, like so?

And maybe change to

And then put the extension (Default Messages.txt) into My Documents\Inform\Extensions…

And then say “Include Default Messages by David Fisher.” at the beginning of the code?

Also, will changing “first taking the object” to “first trying to take the object” help alleviate the awkwardness of stuff like this:

>Wear hat (First taking the hat) That seems to belong to Granny

Or will it have consequences I’m not thinking of?


No, you never modify the extension’s code directly. You include the extension as it is and put the code that controls the extension inside your own code:

[code]Include Default Messages by David Fisher.

Table of custom library messages (continued)
Message Id Message Text
LibMsg “(first trying to take [the main object])”[/code]

(this is covered in the extension’s documentation, section 1.4.)

Thanks Nitku – I don’t see the documentation though? Where is it?

If you click on the “Installed extensions” link in the main documentation’s table of contents, you are shown a list of all installed extensions. If you click on an extension’s name you are shown its documentation.

Hm, I can’t even seem to get it installed. I’m just using the Default Messages.txt file that you get when you right click and “save target as” on default messages in the post at the top of this thread. Is that it or is there more?

I mean, that’s totally where I put it.

The file needs to be called just “Default Messages” or “Default Messages.i7x”, not “Default Messages.txt”. The simplest way to install an extension is to save the downloaded text file somewhere where you can easily find it, then open Inform and use File/Install Extension (I think that’s where you find it). That way Inform will automagically put the extension where it belongs, with the right file extension and so on.

If you want to see a very heavy modification of the standard rules, you can get some inspiration from this extension (turning inform 7 into French): … 7x?view=co