This article contains various tips and specs on creating extensions for Transcendence.

Optional Type Definitions

Sometimes you need to define a type conditionally, for example, only when a certain extension or library is loaded. You can use the extends= parameter on a type to specify that the type should only be used if the given extensions/libraries are loaded. For example:

<!ENTITY unidCorporateCommand "0x00800000">
...
<Type unid="..."
      extends="&unidCorporateCommand;">
   ...
</Type>

This type is only loaded if Corporate Command is also loaded. If Corporate Command is not selected or not available, then the type is not loaded. You can specify a list of UNIDs in the extends= parameter to indicate that the type requires all the specified extensions.

Conversely, the excludes= parameter specifies one or more extension UNIDs that prevent the type from being loaded. For example, excludes="&unidCorporateCommand;" specifies that a type should not be loaded if Corporate Command is loaded.

The decision to load or not load a type happens when the game is created. The choice is saved with the game, so if the player re-loads the game later, the same set of types are loaded. Even if Corporate Command is later installed, the original save file will not load the type. Conversely, if a game is saved with a requirement to Corporate Command, then loading it later requires it to be loaded.