Sometimes, we want to add some randomization into Echo:NPC. For example, picking between two possible quests, or maybe having an easter-egg unique dialogue option.

This is done with something called randomizers.

Randomizers go at the top level of your template file, at the same level as header, states, etc. Randomizers should be thought of as their own “mini states”. You can go to randomizers in the same way you would states, for example by placing it inside the next argument of a state.

The Format

"randomizers": {
    "random_bye": {
        "echo:bye": 5,
        "echo:bye_2": 1

This shows creating a new randomizer called random_bye, with two sub-states. The numbers represent weights for how common this option will be picked. Higher numbers will be picked proportionally higher.

Why the echo: part?

Randomizers are fundamentally picking what component groups you want to add. Echo component groups are indexed with echo: under the hood. By keeping the format like this, the user can submit their own non-echo component groups into randomizers, if they so choose.