[I7] Split source into several files


is it possible to have the source code of a game split into several smaller files, and “include” them in the main source, like with Inform 6 ? I guess it’s possible to do it by using extensions (“Include Part 1 of the game by Otto”), but it’s not very conveniant.

Not without using an external script. There’s no support in I7 itself.

Poster has a post on his “Sturm und Drang IF” blog describing how he went about doing it on the Mac:

On Windows, I made my own wacky system using a combination of extensions, symbolic links, and the Mercurial version control system. So now I have all of my files in one folder and can version control the changes as I see fit. Once the initial setup of all this is done, it’s pretty convenient.

This should theoretically be possible on mac and linux as well, but I haven’t tried yet. It probably depends on how Inform 7 interprets the links in those systems.

I’m doing the same with MacOS, extensions, symlinks, and Git. It works almost fine. The only flaw is that the IDE doesn’t notice changes to extension files, so I keep having to hit " " to recompile and re-run the game.

thank you for your comments, we’ll test symbolic links and such.

I’ve always wondered - couldn’t you essentially do this by making parts of your code into extensions? If you made every fiddly bit an extension I would imagine you could pare your actual source down into rooms and objects.

yes, but I don’t find it very “clean”. If it doesn’t need reloading them manually each time I change something, it could be an option.

Yeah. You can lay out the code in just about any way. I have nearly everything in extensions (a characters file, a world file, etc.) but your idea would certainly work as well.

In Windows, all I have to do is save the extension file in my editor (notepad++) and then click “go” in inform7 to compile and test the code. No refreshing necessary. I guess the Mac version of I7 isn’t so convenient, going by zarf’s post.