Login
Remember
IF Answers
Ask a Question

# When should you include extensions in extensions? (Inform 7)

+1 vote
142 views
asked Jun 15 in Authoring by bg (692 points)

If you're writing an extension and it includes some optional features A and B that make use of other extensions (C and D), but some people may not want to use features A and B, do you go ahead and include extensions C and D, or not? On one hand, you want things to work out of the box. On the other hand, if you're a game author who doesn't want features A and B, there's no good way (that I know of) to un-include C and D without modifying the including extension directly.

Or is this a case where feature B should really be in a separate little add-on extension that can be used with the main extension, and the add-on extension would include the necessary other extension (D)?

In this case the extensions "C" and "D" are Basic Screen Effects by Emily Short and Rewrite the Command Line by Ron Newcomb, if that makes a difference.

- inform7
- extensions

## 1 Answer

+1 vote
answered Jun 15 by Joseph Geipel (207 points)

§27.9 in the Documentation shows off a lot of the options you can use for having extensions interact with other extensions.

Notably for your case, you have the ability to make certain parts of the extension used only if another extension is included via a parenthetical after a heading:

    Book 3 (for use with Basic Screen Effects by Emily Short)

This will make all of Book 3 (which may include Feature A) only be acknowledged if Basic Screen Effects is included. You can also cause the reverse effect by turning the "with" into a "without". If your added feature is deeply intwined in one of the extension's general rules, you can still use the parenthetical to get into that rule through tricks such as, say, defining a truth state differently within Book 3.

Using this, you can allow the author to not include Extension C if they don't need feature A or not include Extension D if they don't need Feature B. Whether this is a better idea than making a side extension is a matter of taste and your specific extension.

## Related questions

- What are best practices for modifying extensions in Inform 7?
- How should you attribute an extensions you've made a small change to?
- In the latest Inform ATTACK how do you write a First standard_attacker rule?
- When using hyperlinks, how do you make the command appear appear next to the > instead of on the following line? (Inform 7)
- How do you avoid an extra line break when refreshing a window with Flexible Windows (Inform 7)?

...