Dialog CLI
dialog info checks dialog XML structure and summarizes the dialog graph. Use it after changing phrases or links, or to
inspect an imported dialog set. dialog list lists dialogs, or the ones an NPC offers, dialog inspect explains one
dialog phrase by phrase, and dialog find shows where dialogs use an info portion or a script function. See
dialog configuration for authoring rules.
Inspect a dialog set
From a project containing an assembled gamedata directory:
xrf-cli dialog info ./gamedata --source directory --strict --report ./dialog-report.json
Example output excerpt — inspect dialogs:
Reading dialogs in ./gamedata (directory)
Swept 2 files in 7 ms, 0 unreadable, 0 archived
Dialogs: 4 total, 1 with no phrases, 1 with a priority
Phrases: 8 total, 5 links, 3 final, 2 without text, 0 outside a phrase list
Largest dialog: zat_test_trader_start with 4 phrases
Encodings: UTF-8: 1, windows-1251: 1
Dialog elements: dont_has_info: 1, has_info: 1, init_func: 1, precondition: 1
Exit code: 0. The finding is a warning, so the inspection passes; add --strict to fail on it.
--source directory selects the loose tree explicitly. The default, containing-installation, can discover the game
installation around the supplied path. Give several roots to layer them, with the highest-priority root first;
--prefix narrows the virtual path scope.
The summary covers files, dialogs, phrases, and links, including empty dialogs, final phrases, missing text, and phrases
outside a phrase list. Use --verbose for individual findings or inspect result in the saved report.
Interpret the result
Every dialog info finding is a warning: the reader is stricter than the engine’s, so an unreadable file or an
off-schema element is something to look at. Without --strict, a completed inspection passes with them, exit 0. With
--strict, they fail it with exit 3, and the report’s status says so. An error, incomplete inspection, or skipped input
produces exit 1, including when no dialog files were selected.
These checks establish structural consistency. Review the conversation in game to verify its conditions, scripting, and intended flow.
List the dialogs an NPC offers
xrf-cli dialog list ./gamedata --source directory --profile zat_b33_stalker_snag --language eng
Example output — Snag, in the xrf build:
zat_b33_stalker_snag_about_cache_dialog (configs\gameplay\dialogs_zaton.xml, 17 phrases, start of zat_b33_stalker_snag): -
zat_b33_stalker_snag_share_package_dialog (configs\gameplay\dialogs_zaton.xml, 45 phrases, actor dialog of zat_b33_stalker_snag): Here's the container.
zat_b33_stalker_snag_refuse_task (configs\gameplay\dialogs_zaton.xml, 9 phrases, actor dialog of zat_b33_stalker_snag): About that container...
actor_break_dialog (configs\gameplay\dialogs.xml, 1 phrases, actor dialog of zat_b33_stalker_snag, with info global_dialogs): Laters.
Profile 'zat_b33_stalker_snag' (zat_b33_stalker_snag) offers 4 dialogs
--profile takes the id profile_name() answers for an NPC. The profile resolves to its pinned specific character, or
to every character it may pick by class, and the list holds what the engine gathers when the actor talks to one: the
character’s start dialog, which the NPC opens itself, its actor dialogs, and the dialogs info portions offer to
everyone. Character descriptions are read with their #include lines spliced in, as the engine reads them. Each dialog
lists its own conditions under elements in the report; whether it is offered right now is for the running game to
judge.
The command reads the dialog, character, profile and info portion files configs\system.ltx lists, with its includes,
as the engine loads them: a file the lists leave out declares nothing, whatever its name. A tree with no system.ltx,
or one listing none of these, such as a folder of dialog files, is read by file name instead: dialog* files for
dialogs, character_desc*, npc_profile* and info_* for the rest. A system.ltx that does not resolve stops the
command.
Without --profile, the command lists every dialog it read. The report carries the dialogs either way. An unknown
profile, one that resolves to no character, or one picking by a class no team_default character has exits 1 and names
any character files that could not be read. The engine cannot spawn an NPC of such a profile.
Explain one dialog
xrf-cli dialog inspect ./gamedata --dialog zat_b33_stalker_snag_about_cache_dialog --source directory --language eng
Each phrase prints as [id] line -> next ids | effects, the effects being its info portions, preconditions and actions.
A dialog declared by more than one file is read from the first and the others are named; --file picks one by its
logical path. The report carries every element of every phrase in document order.
Find where an info portion or function is used
xrf-cli dialog find ./gamedata --source directory --info zat_b3_tech_drink_first_time --functor give_toolkit_1
Example output — in the xrf build:
Info portion 'zat_b3_tech_drink_first_time': given 0, taken 0, checked 2
configs\gameplay\dialogs_zaton.xml zat_b3_stalker_tech_start [1111] dont_has_info zat_b3_tech_drink_first_time
configs\gameplay\dialogs_zaton.xml zat_b3_stalker_tech_start [1112] has_info zat_b3_tech_drink_first_time
configs\gameplay\dialogs_zaton.xml zat_b3_stalker_tech_drink_1 [0] has_info zat_b3_tech_drink_first_time (never read: the entry phrase's own condition)
No dialog gives 'zat_b3_tech_drink_first_time'; scripts, logic and tasks may still give it
Function 'give_toolkit_1': 2 references
configs\gameplay\dialogs_jupiter.xml jup_b217_stalker_tech_instruments [11] action dialogs_zaton.give_toolkit_1
configs\gameplay\dialogs_zaton.xml zat_b3_stalker_tech_instruments [11] action dialogs_zaton.give_toolkit_1
Found 5 references
Repeat --info and --functor to search for several names at once. Each line names the file, the dialog, the phrase in
brackets or dialog for the dialog’s own conditions, and the element. A function given without a module, such as
give_toolkit_1, matches it in any module; dialogs_zaton.give_toolkit_1 matches that module only.
The game decides whether to offer a dialog from the conditions written on the dialog itself, then says its first phrase,
0, without checking that phrase’s own conditions. Such a condition is marked “never read”, unless another phrase leads
back to phrase 0. The drink above opens whenever the actor carries vodka, whatever its phrase 0 asks.
The warning only covers dialogs: scripts, logic sections and tasks can still give the portion. A name nothing mentions is not an error, and the run still exits 0.
Command reference
xrf-cli dialog find
Find every dialog and phrase naming an info portion or a script function, and what each does with it
xrf-cli dialog find [OPTIONS] <--info <info>|--functor <functor>> <path>...
| Option | Required | Default | Description |
|---|---|---|---|
<path> | yes | Root holding dialog xml. Give several to layer them, highest priority first | |
--source <source> | containing-installation | How to read the path: auto treats it as an installation only when it declares one, directory ignores any declaration, volumes mounts every archive volume beneath it, installation requires one, containing-installation searches parent directories for one. Possible values: auto, directory, volumes, installation, containing-installation. | |
--prefix <prefix> | Limit to one logical subtree, such as configs\gameplay | ||
--info <info>... | Info portion to find where dialogs check, give or take it. Repeat to find several | ||
--functor <functor>... | Script function to find where dialogs call it, as module.function or a bare function name in any module. Repeat to find several | ||
-s, --silent | Turn off logging | ||
-v, --verbose | Turn on verbose logging | ||
--json | Write the run’s JSON report to stdout, moving human output to stderr | ||
--report <PATH> | Write the run’s JSON report to a file |
xrf-cli dialog info
Read dialog XML and report what it holds
xrf-cli dialog info [OPTIONS] <path>...
| Option | Required | Default | Description |
|---|---|---|---|
<path> | yes | Root holding dialog xml. Give several to layer them, highest priority first | |
--source <source> | containing-installation | How to read the path: auto treats it as an installation only when it declares one, directory ignores any declaration, volumes mounts every archive volume beneath it, installation requires one, containing-installation searches parent directories for one. Possible values: auto, directory, volumes, installation, containing-installation. | |
--prefix <prefix> | Limit to one logical subtree, such as configs\gameplay | ||
--strict | Answer with a check failure when anything was unreadable or off schema | ||
-s, --silent | Turn off logging | ||
-v, --verbose | Turn on verbose logging | ||
--json | Write the run’s JSON report to stdout, moving human output to stderr | ||
--report <PATH> | Write the run’s JSON report to a file |
xrf-cli dialog inspect
Explain one dialog: its conditions and every phrase, with what each says, gives and runs
xrf-cli dialog inspect [OPTIONS] --dialog <dialog> <path>...
| Option | Required | Default | Description |
|---|---|---|---|
<path> | yes | Root holding dialog xml. Give several to layer them, highest priority first | |
--source <source> | containing-installation | How to read the path: auto treats it as an installation only when it declares one, directory ignores any declaration, volumes mounts every archive volume beneath it, installation requires one, containing-installation searches parent directories for one. Possible values: auto, directory, volumes, installation, containing-installation. | |
--prefix <prefix> | Limit to one logical subtree, such as configs\gameplay | ||
--language <language> | Language to show phrase lines in, such as rus or eng. Defaults to the first the tree holds | ||
--dialog <dialog> | yes | Id of the dialog to explain | |
--file <file> | Logical path of the file to read the dialog from, when more than one declares it | ||
-s, --silent | Turn off logging | ||
-v, --verbose | Turn on verbose logging | ||
--json | Write the run’s JSON report to stdout, moving human output to stderr | ||
--report <PATH> | Write the run’s JSON report to a file |
xrf-cli dialog list
List the dialogs a tree holds, or the ones reaching the actor from an NPC of one profile
xrf-cli dialog list [OPTIONS] <path>...
| Option | Required | Default | Description |
|---|---|---|---|
<path> | yes | Root holding dialog xml. Give several to layer them, highest priority first | |
--source <source> | containing-installation | How to read the path: auto treats it as an installation only when it declares one, directory ignores any declaration, volumes mounts every archive volume beneath it, installation requires one, containing-installation searches parent directories for one. Possible values: auto, directory, volumes, installation, containing-installation. | |
--prefix <prefix> | Limit to one logical subtree, such as configs\gameplay | ||
--language <language> | Language to show phrase lines in, such as rus or eng. Defaults to the first the tree holds | ||
--profile <profile> | NPC profile, as profile_name() answers it, to list only the dialogs the actor gets talking to one | ||
-s, --silent | Turn off logging | ||
-v, --verbose | Turn on verbose logging | ||
--json | Write the run’s JSON report to stdout, moving human output to stderr | ||
--report <PATH> | Write the run’s JSON report to a file |