ParadoxGameConverters / CK3ToEU4

Converts Crusader Kings 3 saves into Europa Universalis 4 mods
MIT License
51 stars 24 forks source link

Revolutionary flag scripting #276

Open IohannesIohannium opened 2 years ago

IohannesIohannium commented 2 years ago

Except in cases where such would be inherited from EU4 definitions (e.g. France), we could generate revolutionary flags for all countries coming from CK3. This would ensure that less eyesore colour combinations appear with revolutionary targets and sister republics.

The following line must be added to the country's countries/XXX.txt definition file: revolutionary_colors = { A B C }

A, B and C are determined thus, from the country's coat of arms definition:

Case 0: The title is mapped to a EU4 country with a defined revolutionary_colors line: copy it from the EU4 file as it is Case 1: The only named colours are yellow and/or white: do NOT output the revolutionary_colors line at all Case 2: There is no named colour (borked file): do NOT output the revolutionary_colors line at all Case 3: There is a named colour that is not yellow or white:

Example.

Coat of arms definition:

e_france = { 
    pattern = "pattern_vertical_split_01.dds"   
    color1 = "yellow"   
    color2 = "blue"
    colored_emblem = {
        texture = "ce_eagle_double.dds"
        color1 = "black"
        color2 = "red"
        mask = {1}  
        }
    colored_emblem = {
        texture = "ce_fleur.dds"
        color1 = "yellow"
        color2 = "yellow"
        mask = {2}
        instance = { position = { 0.5 0.29 } scale = { 0.3 0.3 }  }
        instance = { position = { 0.8 0.29 } scale = { 0.3 0.3 }  }
        instance = { position = { 0.6 0.6 } scale = { 0.3 0.3 }  }
    }
}

Process:

Hardcoded exceptions by title:

IohannesIohannium commented 2 years ago

The following equivalences should be first done:

IohannesIohannium commented 2 years ago

How to treat unknown colors (other strings or a RGB/HSV value): treat them as black