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 π
Blockis 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 π
ScopeContexttracks 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.
- datacontext π
DataContexttracks what we know about the GUI datamodels and datacontexts. Currently it only tracks theScriptedGuiname.- datatype π
- Validator for the
[ ... ]code blocks in localization and gui files. The main entry points are thevalidate_datatypesfunction and theDatatypeenum. - date π
- The
Datetype 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. - defines π
- Utility code for managing the in-game defines
- 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
.guifile processing - helpers π
- Miscellaneous convenience functions.
- imperator π
- Files specifically for validating Imperator: Rome mods.
- item π
- Giant enum for all the
Itemtypes in the game. - launcher_
settings π - Loader for the
launcher-settings.jsonfile. - lowercase π
- Type-safety wrapper for strings that must be lowercase
- macros π
MacroCacheto cache macro expansions, andMacroMapto trackLocuse across macro expansions.- mod_
metadata π - Loader and validator for the
.metadata/metadata.jsonfiles used by Vic3 - modfile π
- Loader and validator for the
.modfiles themselves. - modif π
- Validator for
modifswhich 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
FileEntryandLoc. - 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/bmpfile. - scopes π
- The core
Scopestype 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.
- special_
tokens π - token π
- Contains the core
TokenandLoctypes, which represent pieces of game script and where in the game files they came from. - 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 π
- variable_
scopes π - variables π
- A registry of all the script variables that have been defined somewhere.
- vic3 π
- Files specifically for validating Victoria 3 mods.
MacrosΒ§
StructsΒ§
- Everything
- A record of everything known about the game and mod being validated.
- Loc
- LogReport
Metadata - Describes a report about a potentially problematic situation that can be logged.
- ModFile
- Representation of a
.modfile and its contents. - ModMetadata
- Representation of a
metadata.jsonfile and its contents. - Pointed
Message - Token
- A Token consists of a string and its location in the parsed files.
EnumsΒ§
- Confidence
- 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.
- File
Kind - 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.
- Game
- Enum specifying which game we are validating.
- Item
- β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. - Severity
- Determines the output colour. User can also filter by minimum severity level: e.g. donβt show me Info-level messages.
FunctionsΒ§
- add_
loaded_ mod_ root - Record a secondary mod to be loaded before the one being validated.
labelis what it should be called in the error reports; ideally only a few characters long. - disable_
ansi_ colors - Disable color in the output.
- emit_
reports - Print all the stored reports to the error output.
Set
jsonif they should be printed as a JSON array. Otherwise they are printed in the default output format. - get_
version_ from_ launcher - Looks up the gameβs version in the launcher settings.
- log
- Store an error report to be emitted when
emit_reportsis called. - set_
output_ style - Override the default
OutputStyle. (Controls ansi colors) - set_
show_ loaded_ mods - 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.
- set_
show_ vanilla - 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.
- suppress_
from_ json - take_
reports - Extract the stored reports, sort them, and return them as a hashmap with the occurrences for each instance of metadata split out.
- validate_
config_ file - 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.
Type AliasesΒ§
- LogReport
Pointers - Should contain one or more elements.
- Tiger
Hash Map - Tiger
Hash Set