Expand description
This library forms the bulk of the -tiger family of validators: ck3-tiger
, vic3-tiger
, and
imperator-tiger
. Each executable is a small wrapper around the functions in this library that
start and perform validation.
Modules§
- block π
Block
is the core type to represent Pdx script code - ck3 πFiles specifically for validating Crusader Kings 3 mods.
- config_
load πLoading and interpreting the config file. - context π
ScopeContext
tracks our knowledge of the scope types used in script and validates its consistency. - data πValidators for game item types which are generic across all supported games. Each sub-mod handles a specific item type or group of related item types.
- datatype πValidator for the
[ ... ]
code blocks in localization and gui files. The main entry points are thevalidate_datatypes
function and theDatatype
enum. - date πThe
Date
type represents in-game dates. - db πA general database of item types. Most game items go here.
- dds πValidator for the
.dds
(picture) files that are used in the game. - desc πValidator for triggered description blocks that compose a description from multiple localization keys.
- effect πValidate effects, which are parts of the script that change the game state.
- effect_
validation πValidators for effects that are generic across multiple games. - everything πStores everything known about the game and mod being validated.
- fileset πTrack all the files (vanilla and mods) that are relevant to the current validation.
- game πDealing with which game we are validating
- gui πTypes and functions related to
.gui
file processing - helpers πMiscellaneous convenience functions.
- imperator πFiles specifically for validating Imperator: Rome mods.
- item πGiant enum for all the
Item
types in the game. - lowercase πType-safety wrapper for strings that must be lowercase
- macros π
- mod_
metadata πLoader and validator for the.metadata/metadata.json
files used by Vic3 - modfile πLoader and validator for the
.mod
files themselves. - modif πValidator for
modifs
which is our name for the basic things that modifiers modify. - on_
action πTrack scope context for the builtin on-actions in the various games. - parse πParsers for the various kinds of game script.
- pathtable πA global table for the pathnames used in
FileEntry
andLoc
. - pdxfile πHelper functions for loading pdx script files in various character encodings.
- report πError report collection and printing facilities.
- rivers πSpecial validator for the
rivers.png
file. - scopes πThe core
Scopes
type which tracks our knowledge about the types of in-game values. - script_
value πValidation of script values, which are values that update dynamically based on rules given in their math blocks. - token π
- tooltipped πA helper type used for effects and triggers, which tracks what kind of tooltipping to expect. This affects which errors are logged about them. Some things only matter if an item is being tooltipped.
- trigger πValidate triggers, which are parts of the script that specify yes or no conditions.
- util πMiscellaneous helper functions related to filesystem operations.
- validate πValidation functions that are useful for more than one data module.
- validator π
- vic3 πFiles specifically for validating Victoria 3 mods.
Structs§
- A record of everything known about the game and mod being validated.
- Describes a report about a potentially problematic situation that can be logged.
- Representation of a
.mod
file and its contents. - Representation of a
metadata.json
file and its contents. - A Token consists of a string and its location in the parsed files.
Enums§
- Mostly invisible in the output. User can filter by minimum confidence level. This would be a dial for how many false positives theyβre willing to put up with.
- Note that ordering of these enum values matters. Files later in the order will override files of the same name before them, and the warnings about duplicates take that into account.
- Enum specifying which game we are validating.
- βitemsβ are all the things that can be looked up in the game databases. Anything that can be looked up in script with a literal string key, or thatβs loaded into tigerβs database and needs a unique key, is an
Item
. - Determines the output colour. User can also filter by minimum severity level: e.g. donβt show me Info-level messages.
Functions§
- Record a secondary mod to be loaded before the one being validated.
label
is what it should be called in the error reports; ideally only a few characters long. - Disable color in the output.
- Print all the stored reports to the error output. Set
json
if they should be printed as a JSON array. Otherwise they are printed in the default output format. - Store an error report to be emitted when
emit_reports
is called. - Configure the error reports to be written to this file instead of to stdout.
- Override the default
OutputStyle
. (Controls ansi colors) - Configure the error reporter to show errors that are in extra loaded mods. Normally those are filtered out, to only show errors that involve the modβs code.
- Configure the error reporter to show errors that are in the base game code. Normally those are filtered out, to only show errors that involve the modβs code.
- Extract the stored reports, sort them, and return them as a vector of
LogReport
. The stored reports will be left empty. - Check if config file that was passed in with βconf argument is valid. If it is not valid let the user know, set it to None, and use the default one instead.