Expand description
§Guide
The entity command manipulates the lists of game objects that live inside an epoch.
An epoch is a snapshot of the game state that can be written to disk or rolled back to an earlier one.
Every entity type (character, town, event, …) has the same set of operations:
§Summary
| Sub‑command | Usage | What it changes |
|---|---|---|
| add | <entity> add [OPTIONS] [IDENTIFIER] | Creates a new <entity>, pushes it to the epoch’s list, and writes the epoch. |
| del | <entity> del <IDENTIFIER> | Removes the matching <entity> from the list and writes the epoch. |
| edit | <entity> edit <IDENTIFIER> [OPTIONS] | Modifies the stats/position/duration/effect/bounds of the chosen <entity> and writes the epoch. |
| find | <entity> find <IDENTIFIER> | Prints full details of a single <entity>. |
| show | <entity> show [<IDENTIFIER>] | Lists all entities on one line, or shows one <entity> in full detail. |
| diff | <entity> diff <IDENTIFIER> | Prints the difference between the current and previous epoch for that <entity>. |
IDENTIFIER is either a name or a @tag (@1234).
If omitted, a random name is generated for the type you are working on.
§Options
| Flag | Description |
|---|---|
-d, --delta | Apply a delta to the supplied stats (add or subtract) instead of overwriting them. |
-v, --verbose… | Increase output verbosity. |
--rng <RNG> | How to fill unspecified stats. Possible values: zero, low, med, high, legendary, mixed, flawed. Default: zero. |
--pos-exact <POS> / --pos <POS> | Place the new entity at a specific x,y coordinate (the epoch must be in a map context). |
--duration <DURATION> | Lifespan of the entity (e.g. Permanent, Temporary, Duration(1) for a one‑turn event). |
--bounds <BOUNDS> | Effect limits, given as min,max (e.g. 10,80). |
--effect <EFFECT> | How the effect is applied:recurring, when-present, permanent-effect-to-apply, permanent-effect-applied. |
-s, --stats <STATS> | One or more key:value pairs, e.g. fod,10 military:8. |
§Usage
All the following example use chr as a choice of entity but can be safely substitued to any entity: event, town, blocker etc…
# Create a character named “Aria”
chr add Aria \
--stats fod:10 mil:8 \
--rng mixed
# Edit that character: bump military, shorten duration
chr edit Aria \
--stats mil:5 \
--duration Duration:5
# Show all characters
chr show
# Show one character in detail
chr show Aria
# Delete a character
chr del Aria
# Diff a character between two epochs
chr diff AriaTip –
<entity> diffautomatically loads the current epoch and the previous one, so you don’t need to specify epoch numbers.
All changes are persisted immediately to the epoch file after the command finishes.
Structs§
- Entity
Args - Arguments required for any entity operation.
Enums§
- Entity
SubCommands - Commands that operate on an entity.
Functions§
- find_
by_ 🔒args - Helper function finding by name, note that a lot more helpers could be done to find by other criterias
- find_
by_ 🔒id - Find an entity matching a tag
- find_
by_ 🔒name - Find an entity matching a name
- find_
entity 🔒 - Looks up an entity inside the given
epoch_infoaccording to the supplied arguments. - handle_
create_ 🔒entity - Function handler for the create subcommand
- handle_
delete_ 🔒entity - Function handler for the delete subcommand
- handle_
diff_ 🔒entity - Function handler for the diff subcommand
- handle_
edit_ 🔒entity - Function handler for the edit subcommand
- handle_
entity_ commands - Handles an entity subcommand.
- handle_
find_ 🔒entity - Function handler for the find subcommand
- handle_
show_ 🔒entity - Function handler for the show subcommand
- update_
defaults 🔒 - Update the default values of the entity with sensible defaults
- update_
stats 🔒 - Update the given stats with the given argumenbts Note that this function will not change name & id due to the usage variance between caller
- vec_
entities 🔒 - Returns a slice over the entities of the requested type from the given
EpochInfo. - vec_
entities_ 🔒mut - Returns a mutable slice over the entities of the requested type from the given
EpochInfo.