Skip to content

Revolutionary flag scripting #276

Open
@IohannesIohannium

Description

@IohannesIohannium

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:

  • Set A to the numerical value of the first named colour, not counting yellow or white (black = 1, purple = 3, red = 16, blue = 15, green = 9, brown = 7, orange = 6, blue_light = 14)
  • To set B, IF A is NOT 1 (so not black): see what comes first in definition between yellow, white and black. Set B to 1 if black, to 8 if yellow, to 0 if white
  • To set B, IF A is 1 (thus black): see what comes first in definition between yellow and white. Set B to 8 if yellow, to 0 if white
  • To set B, in case there is no yellow or white: set B to 0
  • To set C, IF B is NOT 1: list all colours appearing excluding yellow and white, output the second one listed.
  • To set C, IF B is 1: list all colours appearing excluding yellow, white and black, output the second one listed.
  • To set C, if there is no colour when excluding: set C equal to A

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:

  • Is there a revolutionary_colors line defined in the EU4 vanilla country file? NO
  • Is there any named colour different than yellow and white? YES
  • First named colour different than yellow and white: blue. Set A to 15
  • Is A different than 1? YES
  • First defined colour that is either yellow, white or black: yellow. Set B to 8
  • Is B different than 1? YES
  • List of colours that are not yellow or white by appearance: blue, black, red
  • Second of the list is black. Set C to 1
  • Output result revolutionary_colors = { 15 8 1 } (revolutionary flag is blue-yellow-black)

Hardcoded exceptions by title:

  • e_guinea = { 5 8 10 } # Modern flag
  • e_siberia = { 10 0 10 } # Modern flag
  • k_jerusalem = { 0 8 0 } # Impossible with this algorithm, as historically fit
  • d_piedmonte = { 5 13 6 } # Historical
  • d_ancona = { 13 8 5 } # Historical
  • d_latium = { 1 0 5 } # Historical

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions