Limit extension to certain sections/chapters?

Is it possible to limit an included extension to only certain sections or chapters of my game source?

I’m working on my first IF, a game for my daughter. I want to have a certain section of the game be in Spanish, using the Spanish translation extension. If I just ‘include’ the extension it takes over for the entire time, which I don’t want. Ideally I only want the Spanish translation (text, commands, everything) to kick in when the player is in a certain area (section or region) of the game (say, for example, Spain).

Is there any way to accomplish that in Inform7?


Some extensions can be turned on and off. (That is, they define effects that can be turned on and off.) However, the parser translations aren’t set up that way.

You might be able to rewrite the Spanish translation extension to use a switch… but don’t do it for your first IF game. Sorry. Not an easy request.

Assuming that you want to do this for educational purposes - how 'bout using English language, but with the NPCs speaking Spanish only?

I will probably do that (write all the room descriptions and text in Spanish for that region) but was hoping I could “turn off” the English commands in the game as well so she’d have to write ‘mira perro’ instead of ‘examine dog’ as well.

And yes, it is a sneaky attempt at educational purposes. :wink: She’s learning Spanish in school so I thought this would be a cool way to incorporate that into the game.

Education (sneaky or not) aside, the idea of different languages being spoken in different parts of the game world (just as in the real world) is a great idea.

Robert Rothman

The pedagogical merits of Inform (and TADS—and IF-parsers generally?) for teaching foreign languages may be a little doubtful. “Mira perro” and “x dog” etc. aren’t well-formed Spanish or English sentences. Inform (and TADS—and IF-parsers generally?) gladly accepts input in Adventure-Spanish and Adventure-English, which would not really be a foreign language teacher’s dialect of choice.

Perhaps, for the Spanish part of the game, you could let the game proceed as a Choose Your Own Adventure, with a number of set choices in Spanish for what to do next to choose from at the end of each turn and bypassing the ordinary English input to and output from Inform’s action machinery during the player’s stay in Spain?