• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

drFlK

Private
73 Badges
Jun 7, 2011
24
1
  • Victoria 2: Heart of Darkness
  • Europa Universalis IV: Call to arms event
  • For the Motherland
  • Hearts of Iron III
  • Heir to the Throne
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Semper Fi
  • Victoria 2: A House Divided
  • Crusader Kings II
  • Europa Universalis IV: Third Rome
  • Cities: Skylines Deluxe Edition
  • Europa Universalis IV: Pre-order
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Age of Wonders III
  • Europa Universalis IV: Conquest of Paradise
  • Cities in Motion 2
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis III
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis III Complete
  • Europa Universalis IV: Mandate of Heaven
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Conclave
  • Europa Universalis III Complete
  • Crusader Kings II: Horse Lords
  • Island Bound
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • 500k Club
[Linux] Python CK2 launcher for Linux

Python CK2 launcher for Linux

A small Crusader Kings 2 launcher written in Python with DLC and Mod support.

New in version 0.4:
  • Added -skiplauncher


Screenshots:
ck2launcher0.3.pngck2launcher_conf0.3.png

Changelogs for older versions
Version 0.3.3:
  • Fixed log not beeing writen to disc correctly
  • Moved configuration file to ~/.config/ck2launcher.conf (your existing configuration file will be moved automatically)
  • Updated readme file

Version 0.3.2:
  • Fixed PNG loading bug when running from Steam
  • Fixed sound issues for some linux distros

Version 0.3.1:
  • Fixed bug where the launcher informed the user about a game crash when closed correctly
  • Fixed bug where the launcher window was created too small for its content
  • Code cleanup

Version 0.3:
  • Added DLC support to launcher
  • The selection of Mod's and DLC's is restored on launch
  • The launcher no longer closes when unable to read a mod file
  • The launcher no longer closes when unable to find the mod directory
  • The launcher no longer closes when unable to launch the game
  • Log file is now created in the same path as the launcher executable

Version 0.2:
  • Added CK2 logo.
  • Error and warning messages are now shown with dialogs.
  • Added configuration window into launcher, no need for maunally editing the configuration file anymore.
  • If the configuration file is missing the launcher creates one with default values.

Version 0.1:
  • First release


Usage without Steam:
  1. Install wxwidgets

    In order to use it you will need Python 2 (should allready be installed on any distro) and wxpython.
    You can install wxpython on Ubuntu and Ubuntu based distros using:
    Code:
    sudo apt-get install python-wxgtk2.8
    For ArchLinux use:
    Code:
    sudo pacman -S wxpython
    For other distros refer to your distro's user manual or use Google.
  2. Download ck2launcher-0.4.tar.gz
  3. Decompress it anywhere
  4. Make sure ck2launcher and ck2launcher.py have execution permissions:
    Code:
    chmod +x ck2launcher ck2launcher.py
    or using your file browser's "File properties" window.
  5. Run ck2launcher.py
  6. Edit the configuration to fit your needs (All options are explained in the README file)
  7. Click on 'Run CK2' and have fun :happy:

Usage with Steam:
The file ck2launcher is a bash script desgined to be used from Steam that fixes the PNG loading issue. So in order to use it from within Steam:

  1. Follow the instructions above up to point 4 (included)
  2. Open the Crusader Kings II preference window in Steam and click on "SET LAUNCH OPTIONS..."
  3. Write the path to ck2launcher (not ck2launcher.py) into the input box followed by " %command%" (without quotes). For example if your ck2launcher is in /home/$USER/.bin that path would be:
    Code:
    /home/$USER/.bin/ck2launcher %command%
  4. Launch game and have fun


Download: ck2launcher-0.4.tar.gz

Old versions:
 
Last edited:
I made some changes to this script for my own use. Basically what I added was support for dependencies between different mods. Which I needed to support the Project Balance and Somewhat more historic map combination of mods.

This is only primitive support, because I don't really know python all that well (I also took some code from an external site, which didn't really specify any license). It has no error handling in case you select an incomplete set of dependencies (i.e. C depends on B and A, B depends on A and you only checked C and A).

Code is on github
 
Thanks for this! :D

Btw, for those whose sound isn't working on various linux distros, just add this line of code anywhere below the import statements in ck2launcher.py:

os.environ['SDL_AUDIODRIVER'] = "alsa"

That should do the trick.
 
You actually made it blend in with my DE theme instead of using a custom theme. Looks really nice. Awesome.
 
What you instruct to put in the Steam launch options is different from what you have in the example code. For me, using %command just launches the game normally, while using %command% doesn't do anything. Am I doing something wrong?

EDIT: The ck2launcher doesn't work at all, but the ck2launcher.py works when launched manually. Neither work from Steam.

EDIT 2: When I do use the .py manually, it launches the game, but without mods, regardless of if they are selected or not. The DLC is used, but I don't know if this if because of the launcher or not.
 
Last edited:
What you instruct to put in the Steam launch options is different from what you have in the example code. For me, using %command just launches the game normally, while using %command% doesn't do anything. Am I doing something wrong?

EDIT: The ck2launcher doesn't work at all, but the ck2launcher.py works when launched manually. Neither work from Steam.

EDIT 2: When I do use the .py manually, it launches the game, but without mods, regardless of if they are selected or not. The DLC is used, but I don't know if this if because of the launcher or not.

It works for me when following the instructions.

Did you give the files execution permission?

Create a folder in your home directory named ck2launcher and extract the files to this folder.

In the terminal:
Code:
cd ~/ck2launcher
chmod +x ck2launcher ck2launcher.py
~/ck2launcher/ck2launcher.py

Click options:
Gamepath: /home/YOURUSERNAME/.local/share/Steam/SteamApps/common/Crusader Kings II
Mods: /home/YOURUSERNAME/.paradoxinteractive/Crusader Kings II/mod

Launch game to test it.

Steam launch options:
Code:
~/ck2launcher/ck2launcher %command%

Hope it helps.
 
Last edited:
I did everything you said up to just before the Steam thing. It works to launch the game, but without a mod, regardless of if it was selected.

Then I tried the Steam part, and IT WORKS! I don't know how or why. I did everything before that I did when I followed your directions, but I used the GUI for most of it.

The DLC checkboxes work as well, although they are listed as active in the CKII content tab in-game. Their icons don't show up and I (for example) can't play Muslims when I disable SoI.

For the mod, it says in the CKII content tab that it is active or inactive (depending on if I check it in the launcher). It doesn't, however, alter the game. I am specifically using the Middle Earth mod.

EDIT: I looked in the mod file and saw that all the filenames used the \ instead of the /. I switched them, but to no avail. I have the mod working fine in Windows, so it's probably a mod issue, but since you're all Linux people, if any of you know what's wrong...
 
Last edited:
I did everything you said up to just before the Steam thing. It works to launch the game, but without a mod, regardless of if it was selected.

Then I tried the Steam part, and IT WORKS! I don't know how or why. I did everything before that I did when I followed your directions, but I used the GUI for most of it.

The DLC checkboxes work as well, although they are listed as active in the CKII content tab in-game. Their icons don't show up and I (for example) can't play Muslims when I disable SoI.

For the mod, it says in the CKII content tab that it is active or inactive (depending on if I check it in the launcher). It doesn't, however, alter the game. I am specifically using the Middle Earth mod.

EDIT: I looked in the mod file and saw that all the filenames used the \ instead of the /. I switched them, but to no avail. I ahve the mod working fine in Windows, so it's probably a mod issue, but since you're all Linux people, if any of you know what's wrong...

Can you post the contents of the ck2launcher.log and ck2launcher.conf? Should be in the same directory your launcher is in.
 
Last edited:
Seems to be a problem with the mod itself, I can't load it either. If it works on fine on Windows maybe there is some problems with file naming (Linux respects upper/lower case, Windows has case insensitive naming), path related like you pointed out or an encoding problem.

Ok. Thanks so much for your help and for the launcher.

EDIT: It was capitalization. It works now.
 
Last edited:
This is awesome. Quick question, does this affect things like Ironman mode and achievements?