Overview

A fancy option for configs in which there’s a mapping of context:value pairs, and a default value in case none of the given contexts are relevant.

These are meant for just-shy-of-datapack-data options, when the value’s a fixed value except for some simply-stated cases.

Example

{
	"outOfBattleCaptures": {
    "value": false,
    "overrides": {
      "chatot": true
    }
  }
}

The above outOfBattleCaptures is an option present in the Options Con Tim mod. In this config setup (not the default setup for the mod, by the way), the default value is false for all contexts, but if the Pokémon in a specific context is a Chatot, the value true is used instead.

Functionally, this means that - with this setup - no Pokémon may be captured outside of battle, except for Chatot.

Built-In

Pokémon

The OverridableOption.PokemonOption class uses a PokemonProperties string as a context value, and compares that against the relevant Pokémon. For example, when determining the value for the above outOfBattleCapture scenario, the Pokémon that the player is attempting to capture outside of battle is passed to the getValue call on the option, which is what causes any given Chatot to match that override.

Volatility

As this violates my general idea that config options should be flat, and anything nested should be pushed to datapack data, this may be deprecated in the future. However, that’s my personal taste, and I’ve still found these to be useful, so long as the context doesn’t become more complex than a simple string, and there’s no context fighting.