Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Particle CLI

Particle commands inspect and convert particles.xr libraries. Use the unpacked representation to edit a library, then verify the packed result before adding it to gamedata.

Examples

Run from a working directory containing the source particles.xr. Use new destinations for the unpacked library and rebuilt file:

xrf-cli particle info --path ./particles.xr
xrf-cli particle unpack --path ./particles.xr --dest ./particles_unpacked

Example output — inspect particles:

Read particle file ./gamedata/particles.xr
Particles file information:
Version: 1
Effects count: 921
Groups count: 350

Exit code: 0.

Edit the exported files, then validate and pack them:

xrf-cli particle verify --path ./particles_unpacked --unpacked
xrf-cli particle pack --path ./particles_unpacked --dest ./particles.rebuilt.xr
xrf-cli particle verify --path ./particles.rebuilt.xr

verify checks that the selected representation can be read. It does not resolve the library’s texture dependencies. After installing the rebuilt file, use gamedata verification to check the library in its asset context, and inspect the affected effects in game.

Look up effects and groups

xrf-cli particle list --path ./particles.xr --kind group --name campfire
xrf-cli particle find --path ./particles.xr --texture pfx/pfx_splash_02 --effect explosions\effects\campfire_sparks
xrf-cli particle inspect --path ./particles.xr explosions\campfire_boar_grill

list names every effect and group, or those of one kind or whose name holds a text: an effect with its shader, textures, particle limit and action types, a group with its effects and the children they spawn. find answers which effects sample a texture or draw with a shader or run an action type, and which groups play an effect or spawn it as a child, each match with every way it matched. A texture matches in any case, with either slash and with or without its extension, as the engine finds it. inspect explains one effect (sprite, flags, frames, collision, actions) or group (each effect’s time window, flags and children), and reports it whole with --json or --report. A name nothing holds fails with exit code 1, naming the names that contain it.

Example output — explain a group:

group explosions\campfire_boar_grill
  time limit: none, loops
  effects: 5
    0. explosions\effects\campfire_boar_grill_smoke from 0 s to 0 s (Enabled)
    1. explosions\effects\campfire_boar_grill_sparks from 0.5 s to 0 s (Enabled)
    2. explosions\effects\fire_distort from 0 s to 0 s (Enabled)
    3. explosions\effects\campfire_boar_grill_vacuum from 0 s to 0 s (Enabled)
    4. explosions\effects\campfire_boar_grill_drop from 0 s to 0 s (Enabled, OnBirthChild, OnDeadChild)
       on birth: explosions\effects\campfire_boar_grill_drop_smoke
       on death: explosions\effects\campfire_boar_grill_drop_sparks

Exit code: 0.

Re-serialize a library

xrf-cli particle repack --path ./particles.xr --dest ./particles.repacked.xr
xrf-cli particle re-unpack --path ./particles_unpacked --dest ./particles_unpacked_roundtrip

repack reads a packed library and writes another packed file. re-unpack imports an unpacked library and exports it to another directory. Neither command automatically compares the result with its source. Serialization can change bytes, so a hash difference alone does not demonstrate a change to the particle definitions.

Failure notes

Packing rejects an existing output file, and unpacking rejects an existing destination directory, unless --force is supplied. Use that flag only when replacing the selected output is intended.

A successful read or conversion establishes that the tool accepts the data. It does not establish visual equivalence or correct behavior of every effect.

Command reference

xrf-cli particle find

Find the effects drawing with a texture or shader or running an action, and the groups playing an effect

xrf-cli particle find [OPTIONS] --path <path> <--texture <texture>|--shader <shader>|--action <action>|--effect <effect>>
OptionRequiredDefaultDescription
-p, --path <path>yesPath to the particle library, particles.xr
--texture <texture>...Texture to find the effects sampling, with or without its extension. Repeat to find several
--shader <shader>...Shader to find the effects drawing with, such as particles\add. Repeat to find several
--action <action>...Action type to find the effects running, as the unpacked library names it, such as TargetColor. Repeat to find several
--effect <effect>...Effect to find the groups playing or spawning it. Repeat to find several
-s, --silentTurn off logging
-v, --verboseTurn on verbose logging
--jsonWrite 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 particle info

Command to print information about provided particle file

xrf-cli particle info [OPTIONS] --path <path>
OptionRequiredDefaultDescription
-p, --path <path>yesPath to the particle library, particles.xr
-s, --silentTurn off logging
-v, --verboseTurn on verbose logging
--jsonWrite 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 particle inspect

Explain one effect or group: its sprite, frames and actions, or the effects it plays and spawns

xrf-cli particle inspect [OPTIONS] --path <path> <name>
OptionRequiredDefaultDescription
-p, --path <path>yesPath to the particle library, particles.xr
<name>yesName of the effect or group, in any case and with either slash, such as explosions\campfire
-s, --silentTurn off logging
-v, --verboseTurn on verbose logging
--jsonWrite 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 particle list

List the effects and groups a particle library holds, with what each draws and plays

xrf-cli particle list [OPTIONS] --path <path>
OptionRequiredDefaultDescription
-p, --path <path>yesPath to the particle library, particles.xr
--kind <kind>List only effects or only groups. Possible values: effect, group.
--name <name>List only names containing this text, in any case and with either slash, such as campfire or explosions\effects
-s, --silentTurn off logging
-v, --verboseTurn on verbose logging
--jsonWrite 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 particle pack

Command to pack unpacked particle files into single particle.xr

xrf-cli particle pack [OPTIONS] --path <path>
OptionRequiredDefaultDescription
-p, --path <path>yesPath to unpacked particle file folder
-d, --dest <dest>unpackedPath to resulting packed *.xr file
-f, --forceWhether existing packed particle should be pruned if destination folder exists
-s, --silentTurn off logging
-v, --verboseTurn on verbose logging
--jsonWrite 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 particle repack

Command to repack provided particle.xr into another file

xrf-cli particle repack [OPTIONS] --path <path> --dest <dest>
OptionRequiredDefaultDescription
-p, --path <path>yesPath to particle file
-d, --dest <dest>yesPath to resulting particle file
-s, --silentTurn off logging
-v, --verboseTurn on verbose logging
--jsonWrite 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 particle re-unpack

Command to re-unpack provided particle directory into another directory

xrf-cli particle re-unpack [OPTIONS] --path <path> --dest <dest>
OptionRequiredDefaultDescription
-p, --path <path>yesPath to unpacked particle directory
-d, --dest <dest>yesPath to resulting unpacked particle
-s, --silentTurn off logging
-v, --verboseTurn on verbose logging
--jsonWrite 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 particle unpack

Command to unpack provided particle.xr into separate files

xrf-cli particle unpack [OPTIONS] --path <path>
OptionRequiredDefaultDescription
-p, --path <path>yesPath to particle.xr file
-d, --dest <dest>unpackedPath to folder for exporting
-f, --forceWhether existing unpacked data should be pruned if destination folder exists
-s, --silentTurn off logging
-v, --verboseTurn on verbose logging
--jsonWrite 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 particle verify

Command to verify provided particle file

xrf-cli particle verify [OPTIONS] --path <path>
OptionRequiredDefaultDescription
-p, --path <path>yesPath to particle.xr file
-u, --unpackedWhether should verify unpacked particle
-s, --silentTurn off logging
-v, --verboseTurn on verbose logging
--jsonWrite the run’s JSON report to stdout, moving human output to stderr
--report <PATH>Write the run’s JSON report to a file