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

BeardedHoplite

Sitting in a Tin Can.
52 Badges
Aug 19, 2009
744
8
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Pre-order
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Semper Fi
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Crusader Kings II
  • Heir to the Throne
  • Hearts of Iron III Collection
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Darkest Hour
  • Europa Universalis IV: Art of War
  • Divine Wind
  • Europa Universalis III Complete
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: Sword of Islam
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Parklife
  • Hearts of Iron IV: Death or Dishonor
  • Crusader Kings Complete
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Cadet
  • Prison Architect
  • Stellaris Sign-up
  • Hearts of Iron IV Sign-up
  • Stellaris
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Mount & Blade: With Fire and Sword
  • Mount & Blade: Warband
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • 500k Club
  • War of the Roses
  • Victoria 2
  • Europa Universalis III Complete
Could anyone show me the event template to make a country's flag (and name, too) change automatically if they change government types? I'm aware the flag mod does the same thing, but I'd like to do my own flags.
 
Last edited:
Basicly, the code I use is below.
It's way different of the RRT877 uses, but also very similar.

Code:
event = {
id = 999999
random = no
persistent = yes
country = TAG

decision = { 
	OR = {
	AND = {
		NOT = { ispuppet = yes }
		NOT = { local_flag = TAG_COM }
		OR = {
			ideology = leninist
			ideology = stalinist
			}
		}
	AND = {
		NOT = { ispuppet = yes }
		NOT = { local_flag = TAG_DEM }
		OR = {
			ideology = social_democrat
			ideology = social_liberal
			ideology = market_liberal
 			ideology = social_conservative
			}
		}
	AND = {
		NOT = { ispuppet = yes }
		NOT = { local_flag = TAG_AUT }
		ideology = paternal_autocrat
		}
	AND = {
		NOT = { ispuppet = yes }
		NOT = { local_flag = TAG_LWR }
		ideology = left_wing_radical
		}
	AND = {
		NOT = { ispuppet = yes }
		NOT = { local_flag = TAG_FAS }
		OR = {
			ideology = nazi
			ideology = fascist
			}
		}
	AND = {
		NOT = { local_flag = TAG_USA }
            puppet = {country = TAG country = USA }
		}
	AND = {
		NOT = { local_flag = TAG_GER }
            puppet = {country = TAG country = GER }
		}
	AND = {
		NOT = { local_flag = TAG_SOV }
            puppet = {country = TAG country = SOV }
		}
	}
	}



name = "Wind of Changes"
desc = "The political reality in our country has changed, and is time to show the rest of the world proudly!"
style = 2

date = { day = 2 month = july year = 1914 }
offset = 30
deathdate = { day = 30 month = december year = 1963 }

action = {
	trigger = { 
	OR = {
		ideology = leninist
		ideology = stalinist
		}
	NOT = { local_flag = TAG_COM }
      NOT = { ispuppet = yes }
      }

	name = "Adopt a Leninist Flag"

	command = { type = flag_ext where = TAG which = "_len" }
	command = { type = name where = TAG which = "PR of TAG"}
	command = { type = local_setflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_SOV }
	}

action = {
	trigger = { 
	OR = {
		ideology = leninist
		ideology = stalinist
		}
	NOT = { local_flag = TAG_COM }
      NOT = { ispuppet = yes }
      }

	name = "Adopt a Syndicalist Flag"

	command = { type = flag_ext where = TAG which = "_syn" }
	command = { type = name where = TAG which = "Commune of TAG"}
	command = { type = local_setflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_SOV }
	}

action = {
	trigger = { 
	OR = {
		ideology = leninist
		ideology = stalinist
		}
	NOT = { local_flag = TAG_COM }
      NOT = { ispuppet = yes }
      }

	name = "Adopt a Stalinist Flag"

	command = { type = flag_ext where = TAG which = "_sta" }
	command = { type = name where = TAG which = "SR of TAG"}
	command = { type = local_setflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_SOV }
	}

action = {
	trigger = { 
	OR = {
		ideology = leninist
		ideology = stalinist
		}
	NOT = { local_flag = TAG_COM }
      NOT = { ispuppet = yes }
      }

	name = "Go historically"
     ai_chance = 55
	command = { type = flag_ext where = TAG which = "" }
	command = { type = name where = TAG which = ""}
	command = { type = local_setflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_SOV }
	}
		
action = {
	trigger = { 
	OR = {
		ideology = nazi
		ideology = fascist
		}
	NOT = { local_flag = TAG_FAS }
      NOT = { ispuppet = yes }
      }

	name = "Adopt a Nazi Flag"

	command = { type = flag_ext where = TAG which = "_naz" }
	command = { type = name where = TAG which = ""}
	command = { type = local_setflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_SOV }
	}		

action = {
	trigger = { 
	OR = {
		ideology = nazi
		ideology = fascist
		}
	NOT = { local_flag = TAG_FAS }
      NOT = { ispuppet = yes }
      }

	name = "Adopt a Fascist Flag"
      ai_chance = 55
	command = { type = flag_ext where = TAG which = "_fas" }
	command = { type = name where = TAG which = ""}
	command = { type = local_setflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_SOV }
	}		
		
action = {
	trigger = { 
     ideology = paternal_autocrat
	NOT = { local_flag = TAG_AUT }
      NOT = { ispuppet = yes }
      }

	name = "Adopt a Monarchist Flag"

	command = { type = flag_ext where = TAG which = "_aut"}
	command = { type = name where = TAG which = "TAG Empire"}
	command = { type = local_setflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_SOV }
	}		

action = {
	trigger = { 
     ideology = paternal_autocrat
	NOT = { local_flag = TAG_AUT }
      NOT = { ispuppet = yes }
      }

	name = "Adopt a New Monarchist Flag"

	command = { type = flag_ext where = TAG which = "_aut2"}
	command = { type = name where = TAG which = "TAG Neo-Empire"}
	command = { type = local_setflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_SOV }
	}		

action = {
	trigger = { 
     ideology = paternal_autocrat
	NOT = { local_flag = TAG_AUT }
      NOT = { ispuppet = yes }
      }

	name = "Go Historically"
     ai_chance = 55
	command = { type = flag_ext where = TAG which = ""}
	command = { type = name where = TAG which = ""}
	command = { type = local_setflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_SOV }
	}	

action = {
	trigger = { 
     ideology = left_wing_radical
	NOT = { local_flag = TAG_LWR }
      NOT = { ispuppet = yes }
      }

	name = "Adopt a Left-Wing-Radical Flag"

	command = { type = flag_ext where = TAG which = "_lwr"}
	command = { type = name where = TAG which = ""}
	command = { type = local_setflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_SOV }
	}		

action = {
	trigger = { 
	OR = {
		ideology = social_democrat
		ideology = social_liberal
		ideology = market_liberal
		ideology = social_conservative
		}
	NOT = { local_flag = TAG_DEM }
      NOT = { ispuppet = yes }
      }

	name = "Adopt a Social Conservative Flag"

	command = { type = flag_ext where = TAG which = "_sco"}
	command = { type = name where = TAG which = ""}
	command = { type = local_setflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_SOV }
	}		

action = {
	trigger = { 
	OR = {
		ideology = social_democrat
		ideology = social_liberal
		ideology = market_liberal
		ideology = social_conservative
		}
	NOT = { local_flag = TAG_DEM }
      NOT = { ispuppet = yes }
      }

	name = "Adopt a Social Liberal Flag"

	command = { type = flag_ext where = TAG which = "_sli"}
	command = { type = name where = TAG which = ""}
	command = { type = local_setflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_SOV }
	}		

action = {
	trigger = { 
	OR = {
		ideology = social_democrat
		ideology = social_liberal
		ideology = market_liberal
		ideology = social_conservative
		}
	NOT = { local_flag = TAG_DEM }
      NOT = { ispuppet = yes }
      }

	name = "Adopt a Market Liberal Flag"

	command = { type = flag_ext where = TAG which = "_mli"}
	command = { type = name where = TAG which = ""}
	command = { type = local_setflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_SOV }
	}		

action = {
	trigger = { 
	OR = {
		ideology = social_democrat
		ideology = social_liberal
		ideology = market_liberal
		ideology = social_conservative
		}
	NOT = { local_flag = TAG_DEM }
      NOT = { ispuppet = yes }
      }

	name = "Adopt a Social Democratic Flag"

	command = { type = flag_ext where = TAG which = "_sdm" }
	command = { type = name where = TAG which = ""}
	command = { type = local_setflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_SOV }
	}

action = {
	trigger = { 
	OR = {
		ideology = social_democrat
		ideology = social_liberal
		ideology = market_liberal
		ideology = social_conservative
		}
	NOT = { local_flag = TAG_DEM }
      NOT = { ispuppet = yes }
      }

	name = "Adopt an Awesome Flag"

	command = { type = flag_ext where = TAG which = "_awe"}
	command = { type = name where = TAG which = ""}
	command = { type = local_setflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_SOV }
	}		

action = {
	trigger = { 
	OR = {
		ideology = social_democrat
		ideology = social_liberal
		ideology = market_liberal
		ideology = social_conservative
		}
	NOT = { local_flag = TAG_DEM }
      NOT = { ispuppet = yes }
      }

	name = "Go Historically"
     ai_chance = 55
	command = { type = flag_ext where = TAG which = ""}
	command = { type = name where = TAG which = ""}
	command = { type = local_setflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_SOV }
	}		

action = {
	trigger = { 
      puppet = {country = TAG country = USA }
	NOT = { local_flag = TAG_USA }
      } 

	name = "Adopt the Flag Suggested by Our Masters"

	command = { type = flag_ext where = TAG which = "_usa"}
	command = { type = name where = TAG which = "US of TAG"}
	command = { type = local_setflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_SOV }
	}		

action = {
	trigger = { 
      puppet = {country = TAG country = GER }
	NOT = { local_flag = TAG_GER }
      } 

	name = "Adopt the Flag Suggested by Our Masters"

	command = { type = flag_ext where = TAG which = "_ger"}
	command = { type = name where = TAG which = "Reichkom. TAG"}
	command = { type = local_setflag which = TAG_GER }
	command = { type = local_clrflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_SOV }
	}		


action = {
	trigger = { 
      puppet = {country = TAG country = SOV }
	NOT = { local_flag = TAG_SOV }
      } 

	name = "Adopt the Flag Suggested by Our Masters"

	command = { type = flag_ext where = TAG which = "_sov"}
	command = { type = name where = TAG which = "Soviet Rep. of TAG"}
	command = { type = local_setflag which = TAG_SOV }
	command = { type = local_clrflag which = TAG_DEM }
	command = { type = local_clrflag which = TAG_AUT }
	command = { type = local_clrflag which = TAG_LWR }
	command = { type = local_clrflag which = TAG_COM }
	command = { type = local_clrflag which = TAG_FAS }
	command = { type = local_clrflag which = TAG_USA }
	command = { type = local_clrflag which = TAG_GER }
	}		
}
You can see that:
1. You need a id number (I put 999999 in this example).
2. You need to change the TAG by the TAG of the country you wanna change flag.
3. This code I gave to you changes flag in the following circunstances:
- when the country is not a puppet. To avoyd this, you shall delete all "ispuppet = yes" checks and ALSO the options for when the country is under USA, GER or SOV control. Otherwise the script will enter in a loop.
- when the country changes between Fascist, Autocrat, Democratic, LWR and Communist. Then you get the options to choose a flag from. If you want to change flag as RRT877 does in his mod (i.e: changing from social liberal to market liberal), you will need to create a "local_flag" for each of the ideologies.