Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revolutionary flag scripting #276

Open
IohannesIohannium opened this issue Nov 25, 2021 · 2 comments
Open

Revolutionary flag scripting #276

IohannesIohannium opened this issue Nov 25, 2021 · 2 comments

Comments

@IohannesIohannium
Copy link
Contributor

IohannesIohannium commented Nov 25, 2021

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
@IohannesIohannium
Copy link
Contributor Author

The following equivalences should be first done:

  • light_grey, samnite_beige, offwhite, ck2_white --> white (which means the algorithm will treat light_grey as if it were written white throughout the entire process)
  • samnite_green, dark_green, ck2_green --> green
  • roman_gold, ck2_yellow --> yellow
  • pitch_black, ck2_black --> black
  • achaemenid_mauve, ck2_purple --> purple
  • roman_red --> red
  • frost_blue --> blue
  • spartan_ocra --> orange
  • spartan_brown --> brown

@IohannesIohannium
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant