Save as extension

Hi – I’m looking to save my main working file as an extension. I’m working on a project that I would like to offer to other authors in the near future, as well as clean up my story file by getting these functions into an included file. I have a few questions, though:

  1. How do you save a program as an extension?

  2. Do you need to change the top of the file in any way? Meaning, when you create a new I7 file, you have to set a few things such as the author’s name, and title, for example. Do you have to keep these basic things out of the file, so they don’t throw an error when adding title and author in the story file?

  3. Is there anything that you can have in a typical I7 program that you can’t in an extension? Are there any hidden limitations, or errors I can expect, when moving from a story file to an extension?

  4. Finally, is there a way to hide the source code? I would like to include documentation on how to use the extension in a story file, but not necessarily give away the source code.

Thanks for any help!

  1. File > New Extension. Copy/paste your code between the header and footer.

  2. Remove that line.

  3. Not AFAIK.

  4. No.

  1. Cool, sounds easy enough.

  2. Okay – how does the extension remember my name and the name of the extension?

  3. Cool. I’ll do some testing and see if I run into anything.

  4. Hm. Anyone have a second opinion on this? I don’t mind giving away the code, I guess, if the file is somehow registered to me, but I would rather not.

Inform will prompt you for your name and the extension’s name, just like when you start a new project.

The original answer was correct. Would you like a third opinion?

The Inform convention is that the extension’s name and author appears in the “version” output. So you’ll be credited, unless you waive that credit with the “authorial modesty” option.

Okay, then my next question is: what protections are there from someone taking the code, rehashing it, and not crediting me?

There is no protection against that. It’s like HTML. People can steal all the HTML off your web site, and guess what? It doesn’t matter.

If you place an appropriate license on your code, you could sue the offender. Or you could send a nasty note saying that you could sue. (Much cheaper than hiring a lawyer.)

(All the extensions on have an attribution license, which basically says what I said above – the extension author must be credited in any game that uses the extension.)

In real life, none of this has ever been a problem. People create Inform extensions (going back to the I6 days) for the common good. If you don’t want people to use your code, don’t post it. If you do post it, people will use it respectfully, because what’s the point of being a jerk about it? It’s not like it’s worth more money if the credit is deleted. I’ve never heard of a case where an Inform extension was rehashed in that way, without permission.

Thanks for the clarification. That is actually something of what I’m afraid of – someone taking the code, rehashing it as their own, and making $ off my work, especially when I want to give it away for free. (As long as the credit is there, I wouldn’t mind if they did make money off of it.) I guess a user agreement would work. I have a ton of versions of this, so I have proof of my work going back pretty far.

This is where dynamic languages come into play. You can’t steal PHP code, or ASP.NET code, or Ruby on Rails code – it’s parsed behind the scenes, and the only thing left in the source code is the HTML output. The logic to get there is hidden. I was hoping that I7 offered a similar protection with extensions.

You can rest easy – that is never going to happen.

Thanks! I’ll drop the issue completely.

Good! You’ll feel better, I promise. :wink:

But seriously, it’s true, you needn’t worry. First of all, as others have already pointed out, that’s just not the way this community operates.

Consider too, though, that if your extension does something really useful and you end up publishing it to the I7 repository of extensions, then there it will stay, in public view and free for anyone to use. So it would be pointless for someone else to take your work, rehash it, claim it as their own and then try to somehow sell that same functionality when your extension is available for free, right there on the I7 extensions page for all to see – which is the first place anyone is going to look for additional functionality – and yours clearly does the same thing as theirs! Not to mention that their source code will be open to public view as well, and likely to look suspiciously like yours, maybe with a few names changed. As the previous poster said, it’s just never going to happen.

Conversely, the more you use extensions others have developed the more you’ll come to realize they are not always the “black boxes” we might wish them to be. For one thing, the I7 namespace is global. That alone means that no matter how carefully an extension is coded, it may clash with someone else’s code at some point. Rules can also interact in unexpected ways, or perhaps the default ordering turns out not to work quite right, when several extensions are made to interact with one another. If the extension source weren’t open to look at, issues like these would become utterly untraceable, and therefore unresolveable for the poor author who ran into them, rendering the extensions in question useless. Being able to look at the guts of how things work is sometimes an unavoidable necessity.

So in short, when we decide to share in Inform, we share the functionality along with the details of how it’s done, for anyone who cares to (or occasionally needs to) have a look at it. It’s a great way both to participate and to learn.

With that said…happy extension-crafting!!!

Taryn has a good point there. And what would be the point of someone removing your name from an extension anyway? It’s not hard to do, but the effect is minimal and it overtly violates the license.

Thanks, Tayrn. That was actually the kind of response I needed. I’ve been in bands, worked on music, and have already run into copyright issues in that field. You make complete sense that there is no point to take what’s free. What I worry about, and it might be an inane fear, but its something you deal with in certain artistic fields, is someone taking your idea or creation, gaining the rights to it, and then preventing you from using your own work. I was on the fence about releasing this, but I’ll definitely release it now. Thanks for the very clear and complete response.

Cool! I look forward to seeing what you’ve come up with.