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

duelistgamer

Second Lieutenant
49 Badges
Apr 17, 2015
108
57
  • Crusader Kings II
  • Europa Universalis IV: Mare Nostrum
  • Lead and Gold
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Leviathans Story Pack
  • Europa Universalis 4: Emperor
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome
  • Stellaris: Ancient Relics
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Legacy of Rome
  • Europa Universalis IV
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Stellaris
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Pre-order
So when you're creating a new provinces.bmp, you also need to define definitions.csv with all the province names for the various RGB colour values. I've made a tool that will speed up the creation of definitions.csv if provinces.bmp has not yet been made.

What this tool will do is take your entire (or partial) list of provinces, parse through them, sequentially assign those provinces numbers, and give them random RGB values with no repetitions.

Also, you read that correctly - you don't need to define all the thousands of provinces your map will have at once! You can create lists of provinces by country, duchy, continent etc in different files - whatever makes sense to you, and then by supplying the correct arguments (the province start number) to the tool, you can create separate csvs for each of those files, and manually merge them without any grief. This tool will create a file where it will store all the RGB values it has already assigned, so you can ask the tool to read from that file and then ensure that there are no repeated colours to avoid conflicts. So that way you can share that file with your collaborators and avoid conflicts. You can also specify a custom-named text file to store those values in for convenience.

https://gny-001f2.github.io/CK2-Province-Script-Generator/

I must emphasize that the tool isn't properly tested right now. I need your help for that. The current release should only be considered an alpha version, although all the functionality described above is already implemented. The readme is lacking, but that will be correctly completed with the release of the first stable version of this tool.

As with my previous tool to automate music script generation, you will need Python 3, preferably the 3.5.1 reference implementation since that is what I am using to test these scripts. Use python3 psg.py -h to get the list of all the arguments available to you. Yeah, it's only command line right now. A future version may have GUI though.

If you have any questions, feel free to ask!
 

Attachments

  • CK2-Province-Script-Generator-2.1.1.zip
    12,9 KB · Views: 33
Last edited:
  • 5
  • 1
Reactions:
v2.0 released, changelog below:

Code:
New in v2.0 released on 2016-05-24:

- Dropped support for delimiters to decrease my maintenance overhead.
  Consequently, the -d flag no longer works in this release.
  Every province should be listed in a separate line.
  If there are extra spaces between words they will be condensed to one space.
  Similarly, leading and trailing spaces in every line will be trimmed.
- Added support for C-style single-line comments denoted with '//'. NOTE: Do not list
  province names in the same line as a comment, that is not supported.
- The script now supports the presence of empty lines for improved formatting.
 
v2.1.0 released, minor changes:

Code:
- Comments can now be entered in the same line as a province. Everything before the "//" will
  be treated as a part of the province name, and everything after will be treated as a part of the
  comment
- Added docstrings so you can read what each function is supposed to do.

Changelog included in the release has more details.
 
Last edited:
v2.1.1 released with a major bugfix.

Code:
- Fixed a major bug that caused usedrgbvalues.txt to grow exponentially with
  multiple uses due to an incorrectly set write mode
- Added compactor.py to assist existing files to be shrunk down for
  significant file size decreases depending on the number of repeated lines
  in the list.