Build Server | Framework | Status |
---|---|---|
AppVeyor | .NET 4.6 | |
Travis | Mono 5.x |
PortraitBuilder is a Winforms application to help CK2 modders creating custom characters, by previewing their appearance, which can then be used in character history of mods, or to customize a character in a saved game.
This project is a fork of Measter's 1.x PortraitBuilder.
See the dedicated CK2 forum thread, after registering your CK2 game.
- Reading portraits from vanilla, DLCs zip archives and mod folders
- Saving current portrait as png image
- Import/export of DNA & properties strings
- Install .NET 4.6
- Start PortraitBuilder.exe
- Select your CK2 game executable (ex: C:\Program Files (x86)\Steam\SteamApps\common\Crusader Kings II\CK2game.exe). This value is kept into a file "gamedir.txt".
- Errors are logged to a log.txt file. Adding -logfull to PortraitBuilder.exe launch options will set log level to DEBUG.
- Install Mono 5.x. Note: GTK# is not required.
- Run ". PortraitBuilder" which is an alias for "MONO_PATH=./lib mono PortraitBuilder.exe" Note: on MacOS, use: "MONO_PATH=./lib mono --arch=32 PortraitBuilder.exe", as WinForms only work with Mono 32bits on MacOS
- Select your CK2 game executable (ex: ~/.local/share/Steam/SteamApps/common/Crusader Kings II/ck2 or /Users/USER/Library/Application Support/Steam/SteamApps/common/crusader kings ii/ck2.app). This value is kept into a file "gamedir.txt".
- Errors are logged to a log.txt file
Install Visual Studio Community 2017.
Build from PortraitBuilder.sln, it will automatically download dependencies via NuGet from packages.config file.
The built executable for .NET can also be executed with Mono, without needing to re-compile.
Main dependencies:
- dds-reader to read .dds images. A recompiled version targeting .NET 4.5 is used from /lib.
- Hime Parser Generator to perform a basic parsing of CK2 files.
- SharpZipLib to unzip DLCs
- log4net to handle logging
To re-generate the Lexer/Parser from the grammar, install Hime standalone distribution, and use the himecc command line utility:
himecc PortraitReader.gram -n PortraitBuilder.Parser
Create the following symlinks to simulate a CK2 Steam installation on Unix:
- Game files: ln -s /mnt/c/Program\ Files\ (x86)/Steam ~/.local/share/Steam
- Shortcut in home folder: ln -s ~/.local/share/Steam/SteamApps/common/Crusader\ Kings\ II ~/ck2
- Mod folder: ln -s /mnt/c/Users/[user]/Documents/Paradox\ Interactive ~/.paradoxinteractive