Suvorov: Expanded scripting language for CK2
Suvorov allows you to write CK2 modifications in a more concise and organized fashion, grouping features together according to your own file structure instead of splitting each individual feature up over a multitude of folders. For example, if you have an event that fires on a specific action and adds a character modifier, you can group the on_action, the event and the modifier together in the same file. If you add a new province, you can define its history, titles, holder character etc in the same file. If you create a trait that unlocks an associated targetted decision as well as a maintenance event to fire for all trait holders, there is no need to pollute three different subfolders. This way, mods are more maintainable and adding or removing features doesn't mean you have to go through several different files.
Install and use
Install with pip install suvorov. Make sure to use pip3 if Python 3 isn't your default version.
You can now create new mods in the folder suvorovmods in your CK2 user directory.
Call the command suvorov build (modfoldername) to prepare the mod so that CK2 can read it. Call suvorov build without any arguments to build all your mods.
Mod structure
In a suvorov mod, you can add any files according to the vanilla structure (e.g. gfx, interface, common) in the pdx subfolder. For new, suvorov-style files, you can follow any folder structure you like (except the pdx folder of course). So your mod could look like this:
mymod
├ pdx
| ├ gfx
| | └ trait.png
| └ localisation
| └ texts.csv
├ crusade_changes
| ├ crusade_start.txt
| └ crusade_end.txt
├ various.txt
└ modinfo.yml
Specify your mod metadata (name, picture, esc.) in modinfo.yml in the root of your folder directory.
New Syntax
Path-independent definitions
These new files with the ending .txt or .suv accept a syntax like vanilla files, only with an enclosing scope defining their type, e.g.:
events = {
namespace = mymod
character_event = {
id = mymod.1
is_triggered_only = yes
option = {
name = mymod.eventoption.1
add_trait = patient
remove_trait = cynical
remove_trait = arbitrary
}
}
}
on_actions = {
on_crusade_preparation_starts = {
events = {
mymod.1
}
}
}
Templating
In case of .suv files, you can also use some basic templating:
events = {
namespace = mymod
character_event = {
id = mymod.2
is_triggered_only = yes
@forin = {
@for = choice
@in = choices
option = {
name = $$choice.name
change_$$choice.attribute = 2
}
}
}
}
The data source for these can be defined over any number of .yaml files in your mod under the top key data, like this:
data:
choices:
- name: "Use the dagger"
attribute: "intrigue"
- name: "Use the quill"
attribute: "diplomacy"
Inline localisation
.suv files allow you to localize things directly in their definition file - if you don't care about multilingual support, this is a nice way to further lower the amount of files and to keep things together:
traits = {
idol = {
@loc = "Idol"
@loc_desc = "This character is a K-Pop Idol."
sex_appeal_opinion = 70
intrigue = 1
}
}
events = {
character_event = {
id = 31
desc = @loc:"Your sister wants to become a K-Pop idol."
option = {
name = @loc:"Nice"
FROM = { add_trait = idol }
}
}
}
Metadata
Release files for suvorov 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| suvorov-1.0.2.tar.gz | 12.6 kB | Without provenance | Details for suvorov-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| suvorov-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for suvorov-1.0.2-py3-none-any.whl |
Total release size: 40.1 kB
Release files / suvorov-1.0.2.tar.gz
| Download URL | suvorov-1.0.2.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f07cdf850d37c1b9bd3f427db0b2502f21fc0f67dc5c4931235c920c5cd9b91c
|
|
BLAKE2b-256 checksum How to use checksums |
d3edf08ad79ce2c21e68ba75675664761e3e14c3da9979f7691ea6a4e155ca05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.9
|
Release files / suvorov-1.0.2-py3-none-any.whl
| Download URL | suvorov-1.0.2-py3-none-any.whl |
|---|---|
| Size | 27.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc20f8b0e3ddd61a6af315dc9bbd8d5a674d373ed47c359b41925adfa33a2ce0
|
|
BLAKE2b-256 checksum How to use checksums |
e21051d673a1a1a2eae13704aa132e79a5786223a4845e0a98b61a0448adfc57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.9
|
Security for suvorov 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.