Pixel Dream StudiosWiki

Choice slots

For when two packs each own half of what one person has to say. A conversation leaves a named gap, and anyone may write for it.

A dialogue is one id and one file: claim the same id and you replace it outright. That is the right answer for rewriting somebody's greeting, and the wrong one for adding a line to it, since two packs that both did it would erase each other silently.

So a conversation can leave a gap with a name on it, and anyone may write for the gap.

The host leaves a slot

data/villagers/dialogues/farmer.json, the pack that owns the greeting:

"choices": [
  { "label": { "translate": "villagers.choice.trade" }, "actions": [ { "type": "open_trades" } ] },
  { "slot": "villagers:business" },
  { "label": { "translate": "villagers.choice.weather" } },
  { "label": { "translate": "rpg_dialogue.choice.leave" } }
]

A { "slot": "..." } entry sits among the ordinary choices, in the position where contributions belong.

Another pack fills it

data/errands/dialogue_choices/deliveries.json, a different pack entirely:

{
  "into": "villagers:business",
  "priority": 0,
  "choices": [
    {
      "label": { "translate": "errands.choice.deliver" },
      "requires": [ { "condition": "errands:errand", "state": "ready" } ],
      "actions": [ { "type": "errands:hand_in_errand" } ]
    }
  ]
}
FieldDefaultMeaning
intorequiredThe slot to fill, named exactly as the slot that declares it. A list, "into": ["a:x", "b:y"], fills several with the same choices.
priority0Where these sit among other packs' contributions to the same slot. Highest first, ties broken by file id.
choicesrequiredOrdinary choices, requires and actions and all.

One file can fill forty conversations. Every greeting that leaves the same slot open is filled by the same contribution, rather than five choices copied into forty files that then drift apart.

Four things worth knowing

The host decides where they land

Appending to the end would put contributions after the farewell, and the farewell has to stay last.

Contributions add, they do not replace

Two packs filling one slot both appear. A slot nobody fills is not there at all, so a mod that ships a greeting with a gap for its sibling works perfectly well on its own.

One file can fill several slots

Give into a list where the same choices belong in more than one place.

{ "into": [ "rpg_villagers:business", "rpg_errands:business" ], "choices": [ ... ] }

A mod that fills a village mod's slot when it is installed, and its own fallback greeting's when it is not, is writing the same choices for both.

You cannot inject into a conversation that did not invite it

No slot, no gap. Override the file instead. A slot is an invitation, and one you can read in the file rather than discover at runtime.

How it behaves

Contributed choices are weighed by their own requires when the panel is sent, exactly like the host's own.

The merge happens as the pack is read, so what the player sees is one list that nothing downstream can tell from a conversation written by a single hand.

Writing for a slot nobody declares

It is reported in the log:

Choices are written for slot x:y, which no dialogue leaves open

This is the one mistake here with no visible symptom, since the choices simply are not there. It is also expected in a clean run of any mod that names an absent sibling's slot: an optional integration costs one warning per boot and nothing else.

On this page