Skip to content

OptionalFeatures

juanosarg edited this page May 30, 2026 · 4 revisions

OptionalFeatures is a system that allows us to have parts of the Vanilla Expanded Framework that don't load unless a mod requests to load them.

This is useful to "hide" parts of the Framework so they don't consume computer resources if there are no mods loaded that can take advantage of them!

How do I use this code?

If you want your mod to use these parts of the code that are usually not loaded, you will need to add an OptionalFeatures XML file to your mod. For example, this one is used by Alpha Memes (VIE Memes and Structures has a similar one) to use the improved precepts menu:

<?xml version="1.0" encoding="utf-8" ?>
<Defs>
    <VEF.OptionalFeatures.ModDef>
        <defName>AM_AlphaMemesIdeoMenuFeatures</defName>
        <label>Alpha Memes</label>
        <description>VE Framework new Ideo menu options for Alpha Memes</description>
        <Activate>
            <li>IdeoFloatMenuPlus</li>
        </Activate>
    </VEF.OptionalFeatures.ModDef>
</Defs>

See that "Activate" tag? There's where you can choose what to activate. At the moment there are several parts of the Framework using this system:

  • IdeoFloatMenuPlus: Adds an improved and expanded precept selection menu to the Ideology creation screen, allowing search and scroll bars. Used by VE Memes and Alpha Memes, for example.
  • TileMutatorMechanics: Allows the TileMutatorExtension to work, which adds functionality for Odyssey's tile mutators
  • WeaponTraitDefMechanics: Allows the WeaponTraitDefExtension to work, which adds functionality for Odyssey's ranged weapon traits

Clone this wiki locally