• 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.

Antoine

Captain
31 Badges
May 16, 2003
376
2
  • Victoria 2
  • Prison Architect: Psych Ward
  • Prison Architect
  • Crusader Kings II: Holy Fury
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Age of Wonders III
  • Knights of Honor
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Knights of Pen and Paper 2
  • Crusader Kings II: Way of Life
  • 500k Club
  • Warlock 2: The Exiled
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Hearts of Iron II: Armageddon
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • Majesty 2
  • Knights of Pen and Paper +1 Edition
  • Europa Universalis III Complete
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Deus Vult
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
Edit, 07/2014 : I'm not into PI games modding anymore, and haven't updated this file since more than one year.

Talias released a more complete language file ( http://forum.paradoxplaza.com/forum...pad-user-defined-language-and-auto-completion ) with all recent commands, and more functionalities.

So I rather advise to use his version.


Anyway if for whatever reason you prefer to use my color coding model I keep it online, but be aware commands introduced in the 2013 and 2014 patches aren't in.

I've made a language file to have the keywords appear in color in notepad++ (free text editor you can download here).
Of course considering the huge number of commands in ck2 I can't guarantee it's complete, but at least the code look a little clearer.

Woa85.jpg

Download the language file.


(1. Unzip the file to notepadd++ folder
2. In notepad click view and configure user defined language panel* then import UserDefineLang.xml
3. In language you should have a new one called ck2code)

Tip :
Due to a limitation of user made languages in notepadd++ the function highlighting the corresponding } when you have your cursor on a { doesn't work when they are defined as block opener/closer in an user defined language.
So if you want to use the highlighting to verify your {}, configure the language and remove them as block opener/closer (then you lose the ability to close blocks, but gain the highlighting).

Version 2.1 :

Added most new keywords since patch 1.6.
Added localisation keywords (but it doesn't work well, as notepadd don't recognize them if there is no space around ; a possibility would be to set them as prefix, but then it colors the following text too, and that creates problem in other files because some commands use the same beginning words).
 
Last edited:
You are a god, cheers ;).
 
Dude, that's maybe the most important file to be stickied in the Master Mod List of Knuckey ! Seriously, thanks !
 
Great tool, thanks.

Sorry for the noobish question, but once it has been imported, how to you get to have it working?
As you can see here,
ck2userdefinedlanguage.JPG
ck2userdefinedlanguage1.JPG
I got it successfully installed, but once I go to Language, no ck2 appearing... must be something really obvious I'm missing here... :blush:
 
I had tried it before.
But after quiting and restarting, it appered on the Language tab alright. :rolleyes: One of those little quirks that most people are used to, I guess...

Thanks, Baneslave, for the 'gentle nudge' anyway! ;)

EDIT - and Thanks Antoine for the beautiful thing you made!!
 
Last edited:
I had a dream about this last night, lost in a sea of nested curly brackets {} I had no escape but to eat my way out of them, and in the end all my Kings were dead due to events firing without end, the horror.

Now I see this, I no longer have to dread a massively nested inheritance.

Thanks much.
 
Great tool!

Just a quick mention to say that both 'ruled_years' and 'culture_group' appear to be uncategorised into any keyword group and without colour.
 
This is great thanks :)

Here's a list of what I have noted to be not yet grouped or coloured (with what they do):
  • foa = "localisation string" (form of address)
  • short_name = yes/no (makes a landed title use the short version of its' name)
  • location_ruler_title = yes/no (unsure, has to do with religious head)
  • landless = yes/no can a title exist without land
  • primary = yes/no can the title be held as a secondary title
  • color2 = { R G B } similar to colour but secondary colour
  • capital = province number determine the capital of a title
  • caliphate = yes/no is it a caliphate
  • tribe = yes/no Is the title a tribe (does it use Regnal Numbers or not)
  • holy_order = yes/no
  • mercenary = yes/no
  • strength_growth_per_century = numerical value determines the rate a merc band's/holy order's max size grows every century
  • dignity = numerical value An AI weighting for counted as having this many more counties than it does
  • title_prefix = "localisation string" what comes before a title name (i.e. Tribe of Potato, Kingdom of Potato etc.)

Highlighting the ; in the localisation files would also be nice :)
 
Last edited:
What about one that makes each set of brackets different colours? That'd be the main thing I get issues with.
 
Excellent start to an excellent idea! For anyone that wishes to add more words or symbols (semicolons etc.), here's a very quick tutorial:

1. Follow the instructions from the original post, for getting the style file working.

2. Open Notepad++, if you haven't already.

3. There's a symbol in the toolbar that looks like a lightning bolt over a window. If you hover over it, with the mouse, it'll say "User-Defined Dialogue...". Click on the button.
USR_def_dialogue.png
4. Under the 'User language:' drop down menu, select CK2code.

5. Under the 'Keywords Lists' tab you can add new words to the style xml, each separated by a space. They update immediately, so you can see the results as you go.

I recommend fiddling around with the settings, until you find what's best for you. It makes modding text files significantly less hassle. It also helps protect against late-night spelling mistakes and missing brackets; which the validator occasionally misses.

EDIT: Of course, you can also edit the xml file directly, but I personally prefer using the Notepad++ UI.
 
i dont know what to do with this. how do i write mod using this? the modding FAQ is not really helpful. for example i would love to create an event, but how? i cannot even find the files that hold the actual text for events etc.
 
i dont know what to do with this. how do i write mod using this? the modding FAQ is not really helpful. for example i would love to create an event, but how? i cannot even find the files that hold the actual text for events etc.

The CK2 Language File is for Notepad++, it colours different parts of the CK2 syntax in different colours. This way, when you edit game files, it's a lot easier to make sense of and pick out errors. Virtually every part of the game can be modded using Notepad++ and the game's code is actually surprisingly simple, once you play around with it a bit.

First off, you'll want to set up a mod directory, to avoid breaking the game's core files.

In the main installation directory, most of the events files are in a file called 'events'. These files also refer to the 'localization' folder, in which you can edit the text that actually shows up in the game.

I've found that the best way to learn is tinker with things, see if you can figure out what different bits do and don't be scared to simply edit bits and see what happens!

Once you get going, it's worth taking a look at the Event coding efficiency thread. Good style isn't essential, but it helps prevent needlessly slowing the game down by getting it to do extra work...
 
okay, i got some insight on how creating events works. but does notepad++ and the language file allow the creation of totally new event files (as in creating new documents that the game would recognize), or would i need to mod existing documents (by adding my custom events).

and by setting up a mod directory, you basically mean a copy of the whole game or just certain folders?
 
okay, i got some insight on how creating events works. but does notepad++ and the language file allow the creation of totally new event files (as in creating new documents that the game would recognize), or would i need to mod existing documents (by adding my custom events).

and by setting up a mod directory, you basically mean a copy of the whole game or just certain folders?

Essentially, which ever files you don't copy into the mod directory, the game will run from the core game. Most mods only include the files that have been changed or added, as this saves space! Files in the mod directory that have the same name as those in the core game folder will override the originals. So long as you use the same format, the game will attempt to read all of the files in a folder.

Hence, if you put a custom events file with a unique name in the mod 'events' folder, the game will read it. Be careful not to use event IDs that conflict with those of the game.