﻿@baby_hair_age = 5
@african_clothing_no_hair_chance = 6.5

# Make sure the weights here match up best as possible with the custom_hair set
hairstyles = {

	usage = game
	selection_behavior = weighted_random

	western_straight = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = western_hairstyles_straight
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				portrait_western_clothing_trigger = yes
			}
            modifier = {
                factor = 0
                has_ep2_dlc_trigger = yes
            }			
		}
	}

	western_wavy = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = western_hairstyles_wavy
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_western_clothing_trigger = yes
			}
            modifier = {
                factor = 0
                has_ep2_dlc_trigger = yes
            }			
		}
	}
	


	western_curly = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = western_hairstyles_curly
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
				portrait_western_clothing_trigger = yes
			}
		}
	}

	western_afro = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = western_hairstyles_afro
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_afro
					}
					has_gene = {
						category = gene_hair_type
						template = hair_afro_no_beard
					}
				}
				portrait_western_clothing_trigger = yes
			}
		}
	}

	mena_straight = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = mena_hairstyles_straight
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				portrait_mena_clothing_trigger = yes
				NOT = {
				 	portrait_fp3_iranian_clothing_trigger = yes
				}				
			}
		}
	}

	mena_wavy = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = mena_hairstyles_wavy
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_mena_clothing_trigger = yes
				NOT = {
				 	portrait_fp3_iranian_clothing_trigger = yes
				}					
			}
		}
	}

	mena_curly = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = mena_hairstyles_curly
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
				portrait_mena_clothing_trigger = yes
				NOT = {
				 	portrait_fp3_iranian_clothing_trigger = yes
				}				
			}
		}
	}

	mena_afro = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = mena_hairstyles_afro
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_afro
					}
					has_gene = {
						category = gene_hair_type
						template = hair_afro_no_beard
					}
				}
				portrait_mena_clothing_trigger = yes
				NOT = {
				 	portrait_fp3_iranian_clothing_trigger = yes
				}					
			}
		}
	}

	byzantine_straight = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = byzantine_hairstyles_straight
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				portrait_byzantine_clothing_trigger = yes
				NOT = {
				 	portrait_epe_south_slav_clothing_trigger = yes
				}				
			}
		}
	}

	byzantine_wavy = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = byzantine_hairstyles_wavy
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_byzantine_clothing_trigger = yes
				NOT = {
				 	portrait_epe_south_slav_clothing_trigger = yes
				}					
			}
		}
	}

	byzantine_curly = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = byzantine_hairstyles_curly
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
				portrait_byzantine_clothing_trigger = yes
			}
		}
	}

	byzantine_afro = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = byzantine_hairstyles_afro
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_afro
					}
					has_gene = {
						category = gene_hair_type
						template = hair_afro_no_beard
					}
				}
				portrait_byzantine_clothing_trigger = yes
			}
		}
	}



	indian_straight = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = indian_hairstyles_straight
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				portrait_indian_clothing_trigger = yes
			}
		}
	}

	indian_wavy = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = indian_hairstyles_wavy
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_indian_clothing_trigger = yes
			}
		}
	}

	indian_curly = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = indian_hairstyles_curly
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
				portrait_indian_clothing_trigger = yes
			}
		}
	}

	indian_afro = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = indian_hairstyles_afro
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_afro
					}
					has_gene = {
						category = gene_hair_type
						template = hair_afro_no_beard
					}
				}
				portrait_indian_clothing_trigger = yes
			}
		}
	}

	steppe_straight = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = steppe_hairstyles_straight
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				portrait_steppe_clothing_trigger = yes
				NOT = {
				 	portrait_epe_eastern_turk_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_eastern_turk_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_seljuk_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_uyghur_clothing_trigger = yes
				}				
				
			}
		}
	}

	steppe_wavy = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = steppe_hairstyles_wavy
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_steppe_clothing_trigger = yes
				NOT = {
				 	portrait_epe_eastern_turk_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_eastern_turk_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_seljuk_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_uyghur_clothing_trigger = yes
				}								
			}
		}
	}

	steppe_curly = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = steppe_hairstyles_curly
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
				portrait_steppe_clothing_trigger = yes
				NOT = {
				 	portrait_epe_eastern_turk_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_seljuk_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_uyghur_clothing_trigger = yes
				}				
				
			}
		}
	}

	steppe_afro = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = steppe_hairstyles_afro
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_afro
					}
					has_gene = {
						category = gene_hair_type
						template = hair_afro_no_beard
					}
				}
				portrait_steppe_clothing_trigger = yes
				NOT = {
				 	portrait_epe_eastern_turk_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_eastern_turk_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_seljuk_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_uyghur_clothing_trigger = yes
				}								
			}
		}
	}
	
	mpo_mongol = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = mpo_mongol_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}					
				}
				portrait_steppe_clothing_trigger = yes
				NOT = {
				 	portrait_epe_eastern_turk_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_eastern_turk_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_seljuk_clothing_trigger = yes
				}							
				has_mpo_dlc_trigger = yes 
			}
			modifier = {
				add = 55
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}					
				}
                OR = {
                    portrait_epe_uyghur_clothing_trigger = yes  
                    portrait_epe_sino_iranian_clothing_trigger = yes   				 
                }					
                OR = {
                    portrait_era3_trigger = yes  
                    portrait_era4_trigger = yes   				 
                }					
				is_female = yes
				has_mpo_dlc_trigger = yes 
				has_tgp_dlc_trigger = yes
			}			
		}
	}

	mpo_western_turk = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = mpo_mongol_hairstyles
				range = { 0.36 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}					
				}
				portrait_epe_western_turk_clothing_trigger = yes	
				is_female = yes
				has_mpo_dlc_trigger = yes 
			}
		}
	}	

	northern_straight = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = northern_hairstyles_straight
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				portrait_northern_clothing_trigger = yes
				NOT = {
				 	portrait_epe_balto_finnic_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_east_slav_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_west_slav_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_gaelic_clothing_trigger = yes
				}
				
			}
		}
	}

	northern_wavy = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = northern_hairstyles_wavy
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_northern_clothing_trigger = yes
				NOT = {
				 	portrait_epe_balto_finnic_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_east_slav_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_west_slav_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_gaelic_clothing_trigger = yes
				}				
			}
		}
	}

	northern_curly = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = northern_hairstyles_curly
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
				portrait_northern_clothing_trigger = yes
			}
		}
	}

	northern_afro = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = northern_hairstyles_afro
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_afro
					}
					has_gene = {
						category = gene_hair_type
						template = hair_afro_no_beard
					}
				}
				portrait_northern_clothing_trigger = yes
			}
		}
	}

	african_straight = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = sub_saharan_hairstyles_straight
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				portrait_african_clothing_trigger = yes
			}
		}
	}

	african_wavy = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = sub_saharan_hairstyles_wavy
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_african_clothing_trigger = yes
			}
		}
	}

	african_curly = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = sub_saharan_hairstyles_curly
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				has_gene = {
					category = gene_hair_type
					template = hair_curly
				}
				portrait_african_clothing_trigger = yes
			}
		}
	}

	african_afro = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = sub_saharan_hairstyles_afro
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_afro
					}
					has_gene = {
						category = gene_hair_type
						template = hair_afro_no_beard
					}
				}
				portrait_african_clothing_trigger = yes
			}
		}
	}

	baby_hair = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = western_baby_hairstyles
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        # outfit_tags = { no_clothes }
		weight = {
			base = 0
			modifier = {
				add = 100
				scope:age < @baby_hair_age
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}

			}
		}
    }

    baby_hair_sub_saharan = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = sub_saharan_baby_hairstyles
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        # outfit_tags = { no_clothes }
		weight = {
			base = 0
			modifier = {
				add = 100
				age < @baby_hair_age
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_afro
					}
					has_gene = {
						category = gene_hair_type
						template = hair_afro_no_beard
					}
				}

			}
		}
    }

    no_hair = { # This is to give a random chance of a clean shaven look
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = no_hairstyles
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = -100
                scope:age < @baby_hair_age
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                }
            }
            # Different likelyhood of a clean shaven look in different cultures
            modifier = {
                add = @african_clothing_no_hair_chance
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_afro
					}
					has_gene = {
						category = gene_hair_type
						template = hair_afro_no_beard
					}
				}				
                portrait_african_clothing_trigger = yes
            }
			modifier = {
				add = 20
				is_male = yes
				OR = {
					portrait_malay_clothing_trigger = yes
					portrait_southeast_asian_clothing_trigger = yes
				}
			}			
            modifier = {
                add = 2000
                exists = this
                has_nickname = nick_the_actually_bald
            }
            modifier = {
                add = 2000
                exists = this
                has_character_modifier = hajj_halq_modifier
            }
            modifier = {
                add = 2000
                exists = this
                has_character_modifier = shaven_bald_modifier
            }
        }
    }

	# default_hair = {
	#     weight = {
	#         base = 0
	#         modifier = {
	#             add = 100
	#             scope:age >= @baby_hair_age
	#         }
	#         # This can't be always 100 otherwise it will get insta picked, so we subtract the no hair chance off to weight it properly
	#         modifier = {
	#             add = {
	#                 subtract = @african_clothing_no_hair_chance
	#             }
	#             portrait_african_clothing_trigger = yes
	#         }
	#     }
	# }

	# ### FP3 Hair ###
    # #iranian
    # fp3_hairstyles_iranian_straight = {
    #     dna_modifiers = {
    #         accessory = {
    #             mode = add
    #             gene = hairstyles
    #             template = fp3_hairstyles_iranian_straight
    #             range = { 0 1 } # For the randomness to work correctly
    #         }
    #     }   
    #     weight = {
    #         base = 0
    #         modifier = {
    #             add = 55
    #             OR = {
    #                 NOT = { exists = this }
    #                 has_gene = {
    #                     category = gene_hair_type
    #                     template = hair_straight
    #                 }
    #                 has_gene = {
    #                     category = gene_hair_type
    #                     template = hair_straight_thin_beard
    #                 }
    #             }
    #             portrait_fp3_iranian_clothing_trigger = yes
    #         }
    #         modifier = {
    #             add = -100
    #             exists = this
    #             is_lowborn = no 
    #             OR = {
    #                 is_from_ruler_designer = yes
    #                 has_character_flag = has_scripted_appearance
    #             }
    #         }
    #     }
    # }

    # fp3_hairstyles_iranian_straight_commoners = {
    #     dna_modifiers = {
    #         accessory = {
    #             mode = add
    #             gene = hairstyles
    #             template = fp3_hairstyles_iranian_straight_common
    #             range = { 0 1 } # For the randomness to work correctly
    #         }
    #     }   
    #     weight = {
    #         base = 0
    #         modifier = {
    #             add = 55
    #             OR = {
    #                 NOT = { exists = this }
    #                 has_gene = {
    #                     category = gene_hair_type
    #                     template = hair_straight
    #                 }
    #                 has_gene = {
    #                     category = gene_hair_type
    #                     template = hair_straight_thin_beard
    #                 }
    #             }
    #             portrait_fp3_iranian_clothing_trigger = yes
    #         }
    #         modifier = {
    #             add = -100
    #             exists = this
    #             is_lowborn = yes
    #             OR = {
    #                 is_from_ruler_designer = yes
    #                 has_character_flag = has_scripted_appearance
    #             }
    #         }
    #     }
    # }


    # fp3_hairstyles_iranian_wavy = {
    #     dna_modifiers = {
    #         accessory = {
    #             mode = add
    #             gene = hairstyles
    #             template = fp3_hairstyles_iranian_wavy
    #             range = { 0 1 } # For the randomness to work correctly
    #         }
    #     }   
    #     weight = {
    #         base = 0
    #         modifier = {
    #             add = 55
    #             OR = {
    #                 NOT = { exists = this }
    #                 has_gene = {
    #                     category = gene_hair_type
    #                     template = hair_wavy
    #                 }
    #             }
    #             portrait_fp3_iranian_clothing_trigger = yes
    #         }
    #         modifier = {
    #             add = -100
    #             exists = this
    #             is_lowborn = no 
    #             OR = {
    #                 is_from_ruler_designer = yes
    #                 has_character_flag = has_scripted_appearance
    #             }
    #         }
    #     }
    # }

    # fp3_hairstyles_iranian_wavy_commoners = {
    #     dna_modifiers = {
    #         accessory = {
    #             mode = add
    #             gene = hairstyles
    #             template = fp3_hairstyles_iranian_wavy_common
    #             range = { 0 1 } # For the randomness to work correctly
    #         }
    #     }   
    #     weight = {
    #         base = 0
    #         modifier = {
    #             add = 55
    #             exists = this
    #             is_lowborn = yes 
    #             has_gene = {
    #                 category = gene_hair_type
    #                 template = hair_wavy
    #             }
    #             portrait_fp3_iranian_clothing_trigger = yes
    #         }
    #         modifier = {
    #             add = -100
    #             exists = this
    #             OR = {
    #                 is_from_ruler_designer = yes
    #                 has_character_flag = has_scripted_appearance
    #             }
    #         }
    #     }
    # }


	#turkic

	### FP2 Hair ###

	fp2_hairstyles_iberian_muslim_straight = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = fp2_hairstyles_iberian_muslim_straight
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				portrait_fp2_iberian_muslim_clothing_trigger = yes
			}
			modifier = {
				add = -100
				exists = this
				is_lowborn = no 
				OR = {
					is_from_ruler_designer = yes
					has_character_flag = has_scripted_appearance
				}
			}
		}
	}

	fp2_hairstyles_iberian_muslim_straight_commoners = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = fp2_hairstyles_iberian_muslim_straight_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				portrait_fp2_iberian_muslim_clothing_trigger = yes
			}
			modifier = {
				add = -100
				exists = this
				is_lowborn = yes
				OR = {
					is_from_ruler_designer = yes
					has_character_flag = has_scripted_appearance
				}
			}
		}
	}

	fp2_hairstyles_iberian_muslim_wavy = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = fp2_hairstyles_iberian_muslim_wavy
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				is_lowborn = no 
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_fp2_iberian_muslim_clothing_trigger = yes
			}
			modifier = {
				add = -100
				exists = this
				OR = {
					is_from_ruler_designer = yes
					has_character_flag = has_scripted_appearance
				}
			}
		}
	}

	fp2_hairstyles_iberian_muslim_wavy_commoners = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = fp2_hairstyles_iberian_muslim_wavy_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				is_lowborn = yes 
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_fp2_iberian_muslim_clothing_trigger = yes
			}
			modifier = {
				add = -100
				exists = this
				OR = {
					is_from_ruler_designer = yes
					has_character_flag = has_scripted_appearance
				}
			}
		}
	}

	fp2_hairstyles_iberian_muslim_curly = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = fp2_hairstyles_iberian_muslim_curly
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				is_lowborn = no
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
				portrait_fp2_iberian_muslim_clothing_trigger = yes
			}
			modifier = {
				add = -100
				exists = this
				OR = {
					is_from_ruler_designer = yes
					has_character_flag = has_scripted_appearance
				}
			}
		}
	}

	fp2_hairstyles_iberian_muslim_curly_commoners = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = fp2_hairstyles_iberian_muslim_curly_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				is_lowborn = yes 
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
				portrait_fp2_iberian_muslim_clothing_trigger = yes
			}
			modifier = {
				add = -100
				exists = this
				OR = {
					is_from_ruler_designer = yes
					has_character_flag = has_scripted_appearance
				}
			}
		}
	}

	fp2_hairstyles_iberian_christian_straight = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = fp2_hairstyles_iberian_christian_straight
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				portrait_fp2_iberian_christian_clothing_trigger = yes
			}
			modifier = {
				add = -100
				exists = this
				OR = {
					is_from_ruler_designer = yes
					has_character_flag = has_scripted_appearance
				}
			}
		}
	}

	fp2_hairstyles_iberian_christian_wavy = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = fp2_hairstyles_iberian_christian_wavy
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_fp2_iberian_christian_clothing_trigger = yes
			}
			modifier = {
				add = -100
				exists = this
				OR = {
					is_from_ruler_designer = yes
					has_character_flag = has_scripted_appearance
				}
			}
		}
	}

	fp2_hairstyles_iberian_christian_curly = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = fp2_hairstyles_iberian_christian_curly
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
				portrait_fp2_iberian_christian_clothing_trigger = yes
			}
			modifier = {
				add = -100
				exists = this
				OR = {
					is_from_ruler_designer = yes
					has_character_flag = has_scripted_appearance
				}
			}
		}
	}

	### FP1 Hair ###

	fp1_straight = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = fp1_hairstyles_straight
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
                OR = {
					portrait_epe_norse_clothing_trigger = yes
					portrait_fp1_norse_clothing_trigger = yes
				}				
			}
			modifier = {
				add = -100
				exists = this
				OR = {
					is_from_ruler_designer = yes
					has_character_flag = has_scripted_appearance
				}
			}
		}
	}

	fp1_wavy = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = fp1_hairstyles_wavy
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
                OR = {
					portrait_epe_norse_clothing_trigger = yes
					portrait_fp1_norse_clothing_trigger = yes
				}
			}
			modifier = {
				add = -100
				exists = this
				OR = {
					is_from_ruler_designer = yes
					has_character_flag = has_scripted_appearance
				}
			}
		}
	}

	male_hair_rtt_01 = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = rtt_hairstyles
				value = 0
			}
		}

		is_valid_custom = {
			#monarchs_journey_unlock = 6
			trigger_if = {
				limit = { exists = root }
				is_female = no
			}
			trigger_else = {
				scope:female = no
			}
		}

		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				culture = culture:scottish
			}
		}
	}

	male_hair_rtt_02 = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = rtt_hairstyles
				value = 1
			}
		}

		is_valid_custom = {
			#monarchs_journey_unlock = 2
			trigger_if = {
				limit = { exists = root }
				is_female = no
			}
			trigger_else = {
				scope:female = no
			}
		}

		weight = {
			base = 0
		}
	}
	
	female_hair_rtt_02 = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = rtt_hairstyles
				value = 0.5
			}
		}

		is_valid_custom = {
			#monarchs_journey_unlock = 8
			trigger_if = {
				limit = { exists = root }
				is_female = yes
			}
			trigger_else = {
				scope:female = yes
			}
		}

		weight = {
			base = 0
			modifier = {
				add = 25
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
				culture = { has_cultural_pillar = heritage_frankish }
			}
		}
	}

	female_hair_rtt_01 = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = rtt_hairstyles
				value = 0
			}
		}

		is_valid_custom = {
			#monarchs_journey_unlock = 7
			trigger_if = {
				limit = { exists = root }
				is_female = yes
			}
			trigger_else = {
				scope:female = yes
			}
		}

		weight = {
			base = 0
		}
	}

	female_hair_rtt_02_milla = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = rtt_hairstyles
				value = 1
			}
		}

		is_valid_custom = {
			#monarchs_journey_unlock = 7
			trigger_if = {
				limit = { exists = root }
				is_female = yes
			}
			trigger_else = {
				scope:female = yes
			}
		}

		weight = {
			base = 0
		}
	}

	### EP2 Hair ###

	ep2_hairstyles_western_nobility = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = ep2_hairstyles_western
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = { # Men
				add = 55
				is_female = no
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}					
				}
				portrait_western_clothing_trigger = yes
				portrait_era1_trigger = yes
				NOT = {
					portrait_commoner_trigger = {
						CULTURE_INPUT = western
					}
				}
			}
			modifier = { # Women
				add = 105
				is_female = yes
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}					
				}
				portrait_western_clothing_trigger = yes
				portrait_era1_trigger = yes
				OR = {
					portrait_high_nobles_trigger = {
						CULTURE_INPUT = western
					}
					portrait_royalty_trigger = {
						CULTURE_INPUT = western
					} 
					portrait_imperial_trigger = {
						CULTURE_INPUT = western
					}                      
				}
			}
		}
	}

	ep2_hairstyles_western_common = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = ep2_hairstyles_western_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 10
				is_female = no
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}					
				}
				portrait_western_clothing_trigger = yes
				has_ep2_dlc_trigger = yes
			}
		}
	}

	sp3_hairstyles_western = { # Louis IX hairstyle
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = sp3_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 10
				is_female = no 
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}					
				}
				portrait_western_clothing_trigger = yes
				has_dlc_feature = couture_of_the_capets
			}
			modifier = {
				factor = 0
				has_ep2_dlc_trigger = yes  
				NOR = {
					portrait_era3_trigger = yes   
					portrait_era4_trigger = yes 
				}             
			}
		}
	}

	### EP3 Hair ###
	ep3_byzantine = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = ep3_byzantine_hairstyle
				range = { 0 1 }
			}
		}
		weight = {
			base = 0
		}
	}

	ep3_byzantine_wavy = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = ep3_byzantine_hairstyles_wavy
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = { # Men
				add = 55
				is_female = no
				is_lowborn = no 
				OR = {
					NOT = { exists = this }
					 has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}					
				}
				portrait_byzantine_clothing_trigger = yes
				has_ep3_dlc_trigger = yes
			}		
			modifier = { # Women
				add = 105
				is_female = yes
				is_lowborn = no 
				OR = {
					NOT = { exists = this }
					 has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}					
				}
				portrait_byzantine_clothing_trigger = yes
				has_ep3_dlc_trigger = yes
			}
		}
	}

	ep3_byzantine_curly = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = ep3_byzantine_hairstyles_curly
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = { # Men
				add = 55
				is_female = no
				is_lowborn = no 
				OR = {
					NOT = { exists = this }
					 has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}					
				}
				portrait_byzantine_clothing_trigger = yes
				has_ep3_dlc_trigger = yes
			}			
			modifier = { # Women
				add = 105
				is_female = yes
				is_lowborn = no 
				OR = {
					NOT = { exists = this }
					 has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}					
				}
				portrait_byzantine_clothing_trigger = yes
				has_ep3_dlc_trigger = yes
			}
		}
	}

	ep3_byzantine_straight = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = ep3_byzantine_hairstyles_straight
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = { # Men
				add = 55
				is_female = no
				is_lowborn = no 
				OR = {
					NOT = { exists = this }
					 has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				portrait_byzantine_clothing_trigger = yes
				has_ep3_dlc_trigger = yes
			}			
			modifier = { # Women
				add = 105
				is_female = yes
				is_lowborn = no 
				OR = {
					NOT = { exists = this }
					 has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
				}
				portrait_byzantine_clothing_trigger = yes
				has_ep3_dlc_trigger = yes
			}
		}
	}

	ep3_byzantine_wavy_commoners = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = ep3_byzantine_hairstyles_wavy_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = { # Men
				add = 55
				is_female = no
				is_lowborn = yes
				OR = {
					NOT = { exists = this }
					 has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}					
				}
				portrait_byzantine_clothing_trigger = yes
				has_ep3_dlc_trigger = yes
			}			
			modifier = { # Women
				add = 105
				is_female = yes
				is_lowborn = yes
				OR = {
					NOT = { exists = this }
					 has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}					
				}
				portrait_byzantine_clothing_trigger = yes
				has_ep3_dlc_trigger = yes
			}
		}
	}

	ep3_byzantine_curly_commoners = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = ep3_byzantine_hairstyles_curly_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = { # Men
				add = 55
				is_female = no
				is_lowborn = yes
				OR = {
					NOT = { exists = this }
					 has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}					
				}
				portrait_byzantine_clothing_trigger = yes
				has_ep3_dlc_trigger = yes
			}			
			modifier = { # Women
				add = 105
				is_female = yes
				is_lowborn = yes
				OR = {
					NOT = { exists = this }
					 has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}					
				}
				portrait_byzantine_clothing_trigger = yes
				has_ep3_dlc_trigger = yes
			}
		}
	}

	ep3_byzantine_straight_commoners = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = ep3_byzantine_hairstyles_straight_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = { # Men
				add = 55
				is_female = no
				is_lowborn = yes
				OR = {
					NOT = { exists = this }
					 has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				portrait_byzantine_clothing_trigger = yes
				has_ep3_dlc_trigger = yes
			}				
			modifier = { # Women
				add = 105
				is_female = yes
				is_lowborn = yes
				OR = {
					NOT = { exists = this }
					 has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
				}
				portrait_byzantine_clothing_trigger = yes
				has_ep3_dlc_trigger = yes
			}
		}
	}	
	
    ############################################################################################################################################
    ######################################################### EPE ADDED  ###############################################################
    ############################################################################################################################################
		

    #######################
    ###### caucasus/South Slav #######
    #######################

    caucasus_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = caucasus_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
				OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}					
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				OR = {				
                portrait_epe_south_slav_clothing_trigger = yes
                # portrait_epe_bulgarian_clothing_trigger = yes			
				}
            }
        }
    }

    caucasus_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = caucasus_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				OR = {				
                portrait_epe_south_slav_clothing_trigger = yes
                # portrait_epe_bulgarian_clothing_trigger = yes							
				}
            }
        }
    }	
	
    #######################
    ###### East Slav #######
    #######################

    east_slav_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = east_slav_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
				OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}					
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				OR = {				
                	portrait_epe_east_slav_clothing_trigger = yes								
				}
                has_fp1_dlc_trigger = yes                 
            }
        }
    }

    east_slav_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = east_slav_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
					exists = this				
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				OR = {				
               		portrait_epe_east_slav_clothing_trigger = yes			
				}
                has_fp1_dlc_trigger = yes                 
            }
        }
    }

    east_slav_curly = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = east_slav_hairstyles_curly
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
					exists = this				
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
				OR = {				
                portrait_epe_east_slav_clothing_trigger = yes	
                portrait_epe_balto_finnic_clothing_trigger = yes	
                portrait_sami_clothing_trigger = yes
                portrait_ugro_permian_clothing_trigger = yes					
                portrait_epe_gaelic_clothing_trigger = yes					
				}
            }
        }
    }

    east_slav_afro = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = east_slav_hairstyles_afro
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_afro
					}
					has_gene = {
						category = gene_hair_type
						template = hair_afro_no_beard
					}
				}
				OR = {				
                portrait_epe_east_slav_clothing_trigger = yes	
                portrait_epe_balto_finnic_clothing_trigger = yes	
                portrait_epe_gaelic_clothing_trigger = yes	
                portrait_sami_clothing_trigger = yes
                portrait_ugro_permian_clothing_trigger = yes				
				}
            }
        }
    }	
	
    ##non DLC
    non_dlc_east_slav_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = northern_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                OR = {
                    NOT = { exists = this }
                    has_gene = {
                        category = gene_hair_type
                        template = hair_straight
                    }
                    has_gene = {
                        category = gene_hair_type
                        template = hair_straight_no_beard
                    }					
                    has_gene = {
                        category = gene_hair_type
                        template = hair_straight_thin_beard
                    }
                }
                OR = {				
                portrait_epe_east_slav_clothing_trigger = yes	
                portrait_epe_balto_finnic_clothing_trigger = yes
                portrait_sami_clothing_trigger = yes
                portrait_ugro_permian_clothing_trigger = yes				
                portrait_epe_gaelic_clothing_trigger = yes				
                }
                NOT = {
                has_fp1_dlc_trigger = yes
                }               
            }
        }
    }

    non_dlc_east_slav_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = northern_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                    exists = this				
                OR = {
                    has_gene = {
                        category = gene_hair_type
                        template = hair_wavy
                    }
                    has_gene = {
                        category = gene_hair_type
                        template = hair_wavy_no_beard
                    }
                }
                OR = {				
                portrait_epe_east_slav_clothing_trigger = yes
                portrait_epe_balto_finnic_clothing_trigger = yes	
                portrait_sami_clothing_trigger = yes
                portrait_ugro_permian_clothing_trigger = yes				
                portrait_epe_gaelic_clothing_trigger = yes	
                }
                NOT = {
                has_fp1_dlc_trigger = yes
                }               
            }
        }
    }	
	
    #######################
    ###### Balto-Finnic #######
    #######################

    balto_finnic_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = balto_finnic_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
				OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}					
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				OR = {							
                portrait_epe_balto_finnic_clothing_trigger = yes
                portrait_sami_clothing_trigger = yes
                portrait_ugro_permian_clothing_trigger = yes				
				}
                has_fp1_dlc_trigger = yes                 
            }
        }
    }

    balto_finnic_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = balto_finnic_slav_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
					exists = this				
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				OR = {				
                portrait_epe_balto_finnic_clothing_trigger = yes	
                portrait_sami_clothing_trigger = yes
                portrait_ugro_permian_clothing_trigger = yes				
				}
                has_fp1_dlc_trigger = yes                 
            }
        }
    }	
	
	
    #######################
    ###### West Slav #######
    #######################
				
    early_west_slav_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = gaelic_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
				OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}					
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				OR = {							
                    portrait_epe_west_slav_clothing_trigger = yes					
				}
                has_ep2_dlc_trigger = yes  
                OR = {
                    portrait_era1_trigger = yes
                    portrait_era2_trigger = yes
                }				
            }
        }
    }

    early_west_slav_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = gaelic_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
					exists = this				
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				OR = {				
                portrait_epe_west_slav_clothing_trigger = yes				
				}
                has_ep2_dlc_trigger = yes 
                OR = {
                    portrait_era1_trigger = yes
                    portrait_era2_trigger = yes
                }                
            }
        }
    }
    
	#####high medieval West slav
	
    west_slav_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = western_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
				OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}					
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				OR = {							
                portrait_epe_west_slav_clothing_trigger = yes					
				}
                has_ep2_dlc_trigger = yes  
                OR = {
                    portrait_era3_trigger = yes
                    portrait_era4_trigger = yes
                }				
            }
        }
    }

    west_slav_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = western_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
					exists = this				
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				OR = {				
                portrait_epe_west_slav_clothing_trigger = yes				
				}
                has_ep2_dlc_trigger = yes 
                OR = {
                    portrait_era3_trigger = yes
                    portrait_era4_trigger = yes
                }                
            }
        }
    }
	
    ###non DLC version

    non_dlc_west_slav_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = western_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
				OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}					
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				OR = {							
                portrait_epe_west_slav_clothing_trigger = yes					
				}			
            }
            modifier = {
                factor = 0     
                has_ep2_dlc_trigger = yes   
            }			
        }
    }

    non_dlc_west_slav_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = western_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
					exists = this				
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				OR = {				
                portrait_epe_west_slav_clothing_trigger = yes				
				}                
            }
            modifier = {
                factor = 0     
                has_ep2_dlc_trigger = yes   
            }			
        }
    }
		
	
    #######################
    ###### Gaelic/Irish #######
    #######################

    gaelic_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = gaelic_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
				OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}					
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				OR = {							
                    portrait_epe_gaelic_clothing_trigger = yes					
				}
                has_fp1_dlc_trigger = yes                 
            }
        }
    }

    gaelic_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = gaelic_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
					exists = this				
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				OR = {				
                    portrait_epe_gaelic_clothing_trigger = yes				
				}
                has_fp1_dlc_trigger = yes                 
            }
        }
    }	
		
	
    #######################
    ###### Eastern Turkic/Default Turk  #######
    #######################
				
    turkic_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = turkic_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
				OR = {
					NOT = {
						exists = this
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				OR = {							
					AND = {
						portrait_epe_eastern_turk_clothing_trigger = yes
				    	NOT = {
				 	    	portrait_epe_seljuk_clothing_trigger = yes
				    	}
					}
					AND = {
					  	portrait_epe_seljuk_clothing_trigger = yes
                        OR = {		
                            portrait_era1_trigger = yes  
                            portrait_era2_trigger = yes  	
                        }
					}		
                    #portrait_epe_uyghur_clothing_trigger = yes					
				}				
            }
        }
    }

    turkic_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = turkic_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				OR = {							
					AND = {
					  	portrait_epe_eastern_turk_clothing_trigger = yes
				        NOT = {
				 	    	portrait_epe_seljuk_clothing_trigger = yes
				        }
					}
					AND = {
					  portrait_epe_seljuk_clothing_trigger = yes
                        OR = {		
                        	portrait_era1_trigger = yes  
                            portrait_era2_trigger = yes  
                            portrait_era3_trigger = yes  							
                        }
					}		
                    #portrait_epe_uyghur_clothing_trigger = yes					
				}
            }
        }
    }

    turkic_curly = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = turkic_hairstyles_curly
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
				OR = {							
					AND = {
					  	portrait_epe_eastern_turk_clothing_trigger = yes
				        NOT = {
				 	    	portrait_epe_seljuk_clothing_trigger = yes
				        }
					}
					AND = {
					  	portrait_epe_seljuk_clothing_trigger = yes
                        OR = {		
                            portrait_era1_trigger = yes  
                            portrait_era2_trigger = yes  
                            portrait_era3_trigger = yes  							
                        }
					}		
                    portrait_epe_uyghur_clothing_trigger = yes							
				}
            }
        }
    }

    turkic_afro = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = turkic_hairstyles_afro
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_afro
					}
					has_gene = {
						category = gene_hair_type
						template = hair_afro_no_beard
					}
				}
				OR = {							
                portrait_epe_eastern_turk_clothing_trigger = yes	
                portrait_epe_seljuk_clothing_trigger = yes	
                portrait_epe_uyghur_clothing_trigger = yes					
				}
            }
        }
    }
		
    #######################
    ###### North africa/maghreb/berber #######
    #######################
    fp2_maghreb_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = fp2_hairstyles_maghrebi_straight_common
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
				OR = {
					NOT = {
						exists = this
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
                portrait_afr_berber_clothing_trigger = yes
				has_fp2_dlc_trigger = yes				
            }
        }
    }

    fp2_maghreb_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = fp2_hairstyles_maghrebi_wavy_common
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
                portrait_afr_berber_clothing_trigger = yes
				has_fp2_dlc_trigger = yes				
            }
        }
    }

    fp2_maghreb_curly = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = fp2_hairstyles_maghrebi_curly_common
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
                portrait_afr_berber_clothing_trigger = yes
				has_fp2_dlc_trigger = yes				
            }
        }
    }	
	
	
    #######################
    ###### Iranian Muslim #######
    #######################
				
    islamic_iranian_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = iranian_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
				OR = {
					NOT = {
						exists = this
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				OR = {
					portrait_epe_islamic_iranian_clothing_trigger = yes	
					AND = {
					  portrait_epe_seljuk_clothing_trigger = yes
                         OR = {		
                            portrait_era3_trigger = yes  
                        }
					}						
				}				
            }
        }
    }

    islamic_iranian_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = iranian_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				OR = {
					portrait_epe_islamic_iranian_clothing_trigger = yes	
					AND = {
					  portrait_epe_seljuk_clothing_trigger = yes
                         OR = {		
                            portrait_era3_trigger = yes   
                        }
					}						
				}
            }
        }
    }

    islamic_iranian_curly = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = iranian_hairstyles_curly
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
				OR = {
					portrait_epe_islamic_iranian_clothing_trigger = yes	
					AND = {
					  portrait_epe_seljuk_clothing_trigger = yes
                         OR = {		
                            portrait_era3_trigger = yes  
                        }
					}
					portrait_chinese_clothing_trigger = yes
					portrait_japanese_clothing_trigger = yes
					portrait_malay_clothing_trigger = yes
					portrait_southeast_asian_clothing_trigger = yes
					portrait_ainu_clothing_trigger = yes
					
				}
            }
        }
    }

    iranian_afro = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = iranian_hairstyles_afro
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_afro
					}
					has_gene = {
						category = gene_hair_type
						template = hair_afro_no_beard
					}
				}
				OR = {
					portrait_epe_islamic_iranian_clothing_trigger = yes
					portrait_epe_non_islamic_iranian_clothing_trigger = yes
					portrait_epe_sino_iranian_clothing_trigger = yes					
					portrait_chinese_clothing_trigger = yes
					portrait_japanese_clothing_trigger = yes
					portrait_malay_clothing_trigger = yes
					portrait_southeast_asian_clothing_trigger = yes					
				}
            }
        }
    }
	
    #######################
    ###### Hindu Iranian non-muslim #######
    #######################
				
    hindu_iranian_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = eastern_iranian_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
				OR = {
					NOT = {
						exists = this
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				portrait_epe_hindu_iranian_clothing_trigger = yes	
				# NOT = {
				# 	portrait_epe_sino_iranian_clothing_trigger = yes
				# }					
            }
        }
    }

    hindu_iranian_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = eastern_iranian_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_epe_hindu_iranian_clothing_trigger = yes	
				# NOT = {
				# 	portrait_epe_sino_iranian_clothing_trigger = yes
				# }				
            }
        }
    }

    hindu_iranian_curly = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = eastern_iranian_hairstyles_curly
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}

				portrait_epe_hindu_iranian_clothing_trigger = yes									
				# NOT = {
				# 	portrait_epe_sino_iranian_clothing_trigger = yes
				# }				
            }
        }
    }	
	
	
    #######################
    ###### eastern Iranian non-muslim #######
    #######################
				
    eastern_non_islamic_iranian_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = eastern_iranian_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
				OR = {
					NOT = {
						exists = this
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				portrait_epe_non_islamic_iranian_clothing_trigger = yes				
				portrait_epe_eastern_non_islamic_iranian_clothing_trigger = yes		
				NOT = {
				 	portrait_epe_hindu_iranian_clothing_trigger = yes
				}
				# NOT = {
				# 	portrait_epe_sino_iranian_clothing_trigger = yes
				# }					
            }
        }
    }

    eastern_non_islamic_iranian_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = eastern_iranian_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_epe_non_islamic_iranian_clothing_trigger = yes				
				portrait_epe_eastern_non_islamic_iranian_clothing_trigger = yes		
				NOT = {
				 	portrait_epe_hindu_iranian_clothing_trigger = yes
				}
				# NOT = {
				# 	portrait_epe_sino_iranian_clothing_trigger = yes
				# }				
            }
        }
    }

    eastern_non_islamic_iranian_curly = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = eastern_iranian_hairstyles_curly
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}

				portrait_epe_non_islamic_iranian_clothing_trigger = yes				
				portrait_epe_eastern_non_islamic_iranian_clothing_trigger = yes		
				NOT = {
				 	portrait_epe_hindu_iranian_clothing_trigger = yes
				}				
				# NOT = {
				# 	portrait_epe_sino_iranian_clothing_trigger = yes
				# }				
            }
        }
    }
	
    #######################
    ###### Western Iranian non-muslim #######
    #######################
				
    western_non_islamic_iranian_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = western_iranian_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
				OR = {
					NOT = {
						exists = this
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				portrait_epe_non_islamic_iranian_clothing_trigger = yes				
				portrait_epe_western_non_islamic_iranian_clothing_trigger = yes		
				NOT = {
				 	portrait_epe_hindu_iranian_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_eastern_non_islamic_iranian_clothing_trigger = yes
				}				
				# NOT = {
				# 	portrait_epe_sino_iranian_clothing_trigger = yes
				# }					
            }
        }
    }

    western_non_islamic_iranian_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = western_iranian_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_epe_non_islamic_iranian_clothing_trigger = yes				
				portrait_epe_western_non_islamic_iranian_clothing_trigger = yes		
				NOT = {
				 	portrait_epe_hindu_iranian_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_eastern_non_islamic_iranian_clothing_trigger = yes
				}
				# NOT = {
				# 	portrait_epe_sino_iranian_clothing_trigger = yes
				# }				
            }
        }
    }

    western_non_islamic_iranian_curly = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = western_iranian_hairstyles_curly
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}

				portrait_epe_non_islamic_iranian_clothing_trigger = yes				
				portrait_epe_western_non_islamic_iranian_clothing_trigger = yes		
				NOT = {
				 	portrait_epe_hindu_iranian_clothing_trigger = yes
				}
				NOT = {
				 	portrait_epe_eastern_non_islamic_iranian_clothing_trigger = yes
				}			
				# NOT = {
				# 	portrait_epe_sino_iranian_clothing_trigger = yes
				# }				
            }
        }
    }	
	
    #######################
    ###### Han Chinese #######
    #######################
				
    han_chinese_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = han_hairstyles_straight_era1
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 120
				is_female = yes				
				OR = {
					NOT = {
						exists = this
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}					
				}
                portrait_chinese_clothing_trigger = yes	
				portrait_era1_tang_trigger = yes				
            }
        }
    }

	## TGP - Chinese ##

	tgp_hairstyles_chinese = { 
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = tgp_chinese_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 120
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_chinese_clothing_trigger = yes
			}
			modifier = {
				add = 70
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_epe_uyghur_clothing_trigger = yes
				has_tgp_dlc_trigger = no			
				
			}			
			modifier = {
				add = 70
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_epe_uyghur_clothing_trigger = yes
				NOT = {
					portrait_epe_gokalpbags_clothing_trigger = yes	
				}				
				has_tgp_dlc_trigger = yes				
                OR = {
                    portrait_era1_trigger = yes  					
                    portrait_era2_trigger = yes  				 
                }				
			}
			modifier = {
				add = 85
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				is_female = yes
				portrait_steppe_clothing_trigger = yes
				OR = {
					culture = culture:khitan
					culture = {
						any_parent_culture_or_above = {
							this = culture:khitan
						}
					}
				}				
			}			
		}
	}

	## TGP - Japanese ##

	tgp_hairstyles_japanese = { 
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = tgp_japanese_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 120
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_japanese_clothing_trigger = yes
				has_tgp_dlc_trigger = yes
				OR = {
					is_female = yes
					age > 16
				}
			}
		}
	}

	tgp_hairstyles_japanese_high_nobility = { 
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = tgp_japanese_high_nobility_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 240
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_high_nobles_trigger = { CULTURE_INPUT = japanese }
				has_tgp_dlc_trigger = yes
				OR = {
					is_female = yes
					age > 16
				}
			}
		}
	}

	tgp_hairstyles_japanese_royal = { 
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = tgp_japanese_royal_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 320
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				OR = {
					portrait_royalty_trigger = { CULTURE_INPUT = japanese }
					portrait_imperial_trigger = { CULTURE_INPUT = japanese }
				}
				has_tgp_dlc_trigger = yes
			}
		}
	}

	tgp_hairstyles_japanese_no_dlc = { 
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = tgp_japanese_hairstyles
				value = 0.51 # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 240
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_japanese_clothing_trigger = yes
				has_tgp_dlc_trigger = no
			}
		}
	}

	tgp_hairstyles_japanese_children = { 
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = tgp_japanese_children_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 120
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_japanese_clothing_trigger = yes
				age < 16
			}
		}
	}

	tgp_hairstyles_southeast = { 
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = tgp_southeast_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_southeast_asian_clothing_trigger = yes
			}
		}
	}

	tgp_hairstyles_ainu = { 
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = tgp_ainu_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 155
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
				portrait_ainu_clothing_trigger = yes
			}
		}
	}
	
	cp7_hairstyles_emishi_straight = {  # very similar to tgp ainu stuff above but checks for hair type genes - i made this before the gene tgp gene was added so i consolidated them together for cp7 --aj
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = cp7_emishi_ainu_hairstyles_straight_wavy
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 165
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
				}
				portrait_emishi_clothing_trigger = yes
			}
		}
	}
	cp7_hairstyles_emishi_curly = { 
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = cp7_emishi_ainu_hairstyles_curly_afro
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 165
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_afro
					}
				}
				portrait_emishi_clothing_trigger = yes
			}
		}
	}
	
	ccp9_uighur_hairstyles = { 
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = ccp9_uighur_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}					
				}
				portrait_epe_uyghur_clothing_trigger = yes
			}
		}
	}

	### SP5 Hair ###

	sp5_hairstyles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = sp5_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = { # Men
				add = 15
				is_female = no
				OR = {
					NOT = { exists = this }

					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}					
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}					
				}
				OR = {
					portrait_western_clothing_trigger = yes
					portrait_byzantine_clothing_trigger = yes
				}
				has_sp5_dlc_triggers = yes
			}
		}
	}
	
####################################################################################################
##################
###Norman-Sicilian era 2-4
##################
####################################################################################################

		ep3_epe_norman_sicilian_straight = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = ep3_byzantine_hairstyles_straight
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = { # Men
				add = 55
				is_female = no
				highest_held_title_tier > tier_county
				OR = {
					NOT = { exists = this }
					 has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				OR = {
					portrait_epe_norman_sicily_clothing_trigger = yes 
					portrait_epe_sicilian_clothing_trigger = yes
				}				
				has_ep3_dlc_trigger = yes
			}
			modifier = {
				add = -100
				exists = this
				OR = {
				    highest_held_title_tier < tier_county
					highest_held_title_tier = tier_county
				}
				OR = {
					is_from_ruler_designer = yes
					has_character_flag = has_scripted_appearance
				}
			}			
		}
	}
	
	
	ep3_epe_norman_sicilian_wavy = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = ep3_byzantine_hairstyles_wavy
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = { # Men
				add = 55
				is_female = no
				highest_held_title_tier > tier_county
				OR = {
					NOT = { exists = this }
					 has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}					
				}
				OR = {
					portrait_epe_norman_sicily_clothing_trigger = yes 
					portrait_epe_sicilian_clothing_trigger = yes
				}
				has_ep3_dlc_trigger = yes
			}
			modifier = {
				add = -100
				exists = this
				OR = {
				    highest_held_title_tier < tier_county
					highest_held_title_tier = tier_county
				} 
				OR = {
					is_from_ruler_designer = yes
					has_character_flag = has_scripted_appearance
				}
			}			
		}
	}

	ep3_epe_norman_sicilian_curly = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = ep3_byzantine_hairstyles_curly
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = { # Men
				add = 55
				is_female = no
				highest_held_title_tier > tier_county
				OR = {
					NOT = { exists = this }
					 has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}					
				}
				OR = {
					portrait_epe_norman_sicily_clothing_trigger = yes 
					portrait_epe_sicilian_clothing_trigger = yes
				}
				has_ep3_dlc_trigger = yes
			}
			modifier = {
				add = -201
				exists = this
				OR = {
				    highest_held_title_tier < tier_county
					highest_held_title_tier = tier_county
				} 
				OR = {
					is_from_ruler_designer = yes
					has_character_flag = has_scripted_appearance
				}
			}			
		}
	}
	
	ep2_western_straight_era1 = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = early_western_hairstyles_straight
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				portrait_western_clothing_trigger = yes
				has_ep2_dlc_trigger = yes
				portrait_era1_trigger = yes 				
			}
		}
	}

	ep2_western_wavy_era1 = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = early_western_hairstyles_wavy
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_western_clothing_trigger = yes
				has_ep2_dlc_trigger = yes
				portrait_era1_trigger = yes 				
			}
		}
	}	
	
	ep2_western_straight = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = western_hairstyles_straight
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				OR = {
					NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				portrait_western_clothing_trigger = yes
				has_ep2_dlc_trigger = yes
                OR = {
                	portrait_era2_trigger = yes  				
                	portrait_era3_trigger = yes   				
                	portrait_era4_trigger = yes  
                }				
			}
		}
	}

	ep2_western_wavy = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = western_hairstyles_wavy
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 55
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				portrait_western_clothing_trigger = yes
				has_ep2_dlc_trigger = yes
                OR = {
                	portrait_era2_trigger = yes  				
                	portrait_era3_trigger = yes   				
                	portrait_era4_trigger = yes  
                }				
			}
		}
	}	
	
	
	### SP4 - Crowns of the World ###

	sp4_hairstyles_mena = { 
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = sp4_mena_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 30
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
					
				}
				OR = {				
				    portrait_mena_clothing_trigger = yes
				    portrait_epe_islamic_iranian_clothing_trigger = yes
				    portrait_epe_non_islamic_iranian_clothing_trigger = yes		
				    portrait_fp3_iranian_clothing_trigger = yes
				}
				has_sp4_dlc_trigger = yes				
			}
			
			
			
			modifier = {
				add = 30
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
					
				}
				OR = {
					AND = {
					  portrait_epe_western_turk_clothing_trigger = yes
                         OR = {		
                            portrait_era3_trigger = yes  
                            portrait_era4_trigger = yes  
                        }
					}

					AND = {
					  portrait_epe_seljuk_clothing_trigger = yes
                         OR = {		
                            portrait_era3_trigger = yes  
                        }
					}						
				}
				has_sp4_dlc_trigger = yes				
			}	
		}
	}

	sp4_hairstyles_western_male = { # High/Late Medieval Style for men
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = sp4_western_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 20
				is_male = yes 
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
				portrait_western_clothing_trigger = yes
				has_sp4_dlc_trigger = yes
			}
			modifier = {
				factor = 0
				NOR = {
					portrait_era3_trigger = yes   
					portrait_era4_trigger = yes 
				}             
			}
		}
	}

	sp4_hairstyles_western_female = { 
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = sp4_western_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 20
				is_female = yes 
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
				portrait_western_clothing_trigger = yes
				has_sp4_dlc_trigger = yes
			}
		}
	}
	
	
	
####################################################################################################
##################
###Sino-Iranian
##################
####################################################################################################
				
    sino_iranian_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = eastern_iranian_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
				OR = {
					NOT = {
						exists = this
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				OR = {
					AND = {
						portrait_epe_sino_iranian_clothing_trigger = yes
						has_tgp_dlc_trigger = yes
						NOT = {
							portrait_epe_sino_iranian_chinese_clothing_trigger = yes	
						    }
                        OR = {
                            portrait_era1_trigger = yes  					
                            portrait_era2_trigger = yes  				 
                          }							
						}
					AND = {
						portrait_epe_sino_iranian_clothing_trigger = yes
						has_tgp_dlc_trigger = yes
                        OR = {					
                            portrait_era3_trigger = yes  
                            portrait_era4_trigger = yes   							 
                          }							
						}
					AND = {
						portrait_epe_uyghur_clothing_trigger = yes
						has_tgp_dlc_trigger = yes
                        OR = {					
                            portrait_era3_trigger = yes  
                            portrait_era4_trigger = yes   							 
                          }							
						}						
					AND = {
						portrait_epe_sino_iranian_clothing_trigger = yes
						has_tgp_dlc_trigger = no
						}
						
				}			
				
            }
        }
    }

    sino_iranian_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = eastern_iranian_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				OR = {
					AND = {
						portrait_epe_sino_iranian_clothing_trigger = yes
						has_tgp_dlc_trigger = yes
						NOT = {
							portrait_epe_sino_iranian_chinese_clothing_trigger = yes	
						    }
                        OR = {
                            portrait_era1_trigger = yes  					
                            portrait_era2_trigger = yes  				 
                          }							
						}
					AND = {
						portrait_epe_sino_iranian_clothing_trigger = yes
						has_tgp_dlc_trigger = yes
                        OR = {					
                            portrait_era3_trigger = yes  
                            portrait_era4_trigger = yes   							 
                          }							
						}
					AND = {
						portrait_epe_uyghur_clothing_trigger = yes
						has_tgp_dlc_trigger = yes
                        OR = {					
                            portrait_era3_trigger = yes  
                            portrait_era4_trigger = yes   							 
                          }							
						}						
					AND = {
						portrait_epe_sino_iranian_clothing_trigger = yes
						has_tgp_dlc_trigger = no
						}
						
				}
			
            }
        }
    }

    sino_iranian_curly = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = eastern_iranian_hairstyles_curly
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}

				OR = {
					AND = {
						portrait_epe_sino_iranian_clothing_trigger = yes
						has_tgp_dlc_trigger = yes
						
						}
					AND = {
						portrait_epe_uyghur_clothing_trigger = yes
						has_tgp_dlc_trigger = yes
                        OR = {					
                            portrait_era3_trigger = yes  
                            portrait_era4_trigger = yes   							 
                          }							
						}						
					AND = {
						portrait_epe_sino_iranian_clothing_trigger = yes
						has_tgp_dlc_trigger = no
						}
						
				}								
			
            }
        }
    }	
	
	
    sino_iranian_straight_commoners = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = eastern_iranian_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
								
				OR = {
					NOT = {
						exists = this
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				OR = {
					portrait_commoner_trigger = { CULTURE_INPUT = epe_sino_iranian }
                    is_lowborn = yes 
				}				
				portrait_epe_sino_iranian_clothing_trigger = yes					
				
            }
        }
    }

    sino_iranian_wavy_commoners = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = eastern_iranian_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
			
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				OR = {
					portrait_commoner_trigger = { CULTURE_INPUT = epe_sino_iranian }
                    is_lowborn = yes 
				}				
				portrait_epe_sino_iranian_clothing_trigger = yes					

			
            }
        }
    }


    sino_iranian_chinese_era1_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = han_hairstyles_straight_era1
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 115
				is_female = yes				
				OR = {
					NOT = {
						exists = this
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}					
				}
				portrait_era1_tang_trigger = yes	
				portrait_epe_sino_iranian_chinese_clothing_trigger = yes
				has_tgp_dlc_trigger = yes
				NOT = {
					portrait_commoner_trigger = { CULTURE_INPUT = epe_sino_iranian }
				}				
            }
            modifier = {
                add = 100
				is_female = no				
				OR = {
					NOT = {
						exists = this
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}					
				}
                OR = {
                    portrait_era1_trigger = yes  					
                    portrait_era2_trigger = yes  				 
                }
				portrait_epe_sino_iranian_chinese_clothing_trigger = yes
				has_tgp_dlc_trigger = yes
				NOT = {
					portrait_commoner_trigger = { CULTURE_INPUT = epe_sino_iranian }
				}				
            }			
        }
    }	
	
	
	tgp_hairstyles_sino_iranian_chinese = { 
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = tgp_chinese_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 120
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
					
				}
				portrait_epe_sino_iranian_chinese_clothing_trigger = yes
				has_tgp_dlc_trigger = yes
                OR = {
                    portrait_era1_trigger = yes  					
                    portrait_era2_trigger = yes  				 
                }				
				NOT = {
					portrait_commoner_trigger = { CULTURE_INPUT = epe_sino_iranian }
				}				
			}
		
		}
	}	
	
##########################################################################
####Ottoman Turk era4
##########################################################################	


				
    ottoman_straight_era4 = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = ottomans_hairstyles_era4
                range = { 0 0.35 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
				OR = {
					NOT = {
						exists = this
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
				OR = {							
					AND = {
					  	portrait_epe_seljuk_clothing_trigger = yes
                        OR = {		
                            portrait_era4_trigger = yes  	
                        }
					}					
				}				
            }
        }
    }

    ottoman_wavy_era4 = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = ottomans_hairstyles_era4
                range = { 0.36 0.78 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
				}
				OR = {							
					AND = {
					  	portrait_epe_seljuk_clothing_trigger = yes
                        OR = {		
                            portrait_era4_trigger = yes  	
                        }
					}					
				}
            }
        }
    }

    ottoman_curly_era4 = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = ottomans_hairstyles_era4
                range = { 0.79 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}
				}
				OR = {							
					AND = {
					  	portrait_epe_seljuk_clothing_trigger = yes
                        OR = {		
                            portrait_era4_trigger = yes  	
                        }
					}					
				}
            }
        }
    }



	western_warrior = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = epe_western_hairstyles_warrior
				range = { 0 1 } # For the randomness to work correctly
			}
		}   
		weight = {
			base = 0
			modifier = {
				add = 150
				exists = this
				OR = {
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_no_beard
					}						
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}				
					has_gene = {
						category = gene_hair_type
						template = hair_wavy
					}
					has_gene = {
						category = gene_hair_type
						template = hair_wavy_no_beard
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly
					}
					has_gene = {
						category = gene_hair_type
						template = hair_curly_no_beard
					}					
				}
				
				OR = {
					portrait_has_trait_trigger = { TRAIT = education_martial_4 }
					portrait_has_trait_trigger = { TRAIT = education_martial_5 }
					AND = {
					  	#is_ruler = yes
                        OR = {	
					        portrait_has_trait_trigger = { TRAIT = education_martial_1 }						
					        portrait_has_trait_trigger = { TRAIT = education_martial_2 }
					        portrait_has_trait_trigger = { TRAIT = education_martial_3 }
					        portrait_has_trait_trigger = { TRAIT = education_martial_4 }	
					        portrait_has_trait_trigger = { TRAIT = education_martial_5 }								
                        }						
                        OR = {		
				            has_realm_law = camp_purpose_mercenaries
				            has_realm_law = camp_purpose_brigands	
				            government_has_flag = government_is_mercenary								
                        }
					}						
				}
                OR = {
                    portrait_era3_trigger = yes  
                    portrait_era4_trigger = yes   				 
                }					
				is_female = yes	
				age > 16
                OR = {
				    portrait_western_clothing_trigger = yes				
					portrait_epe_norse_clothing_trigger = yes
				}				
			}
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                }
            }		
		}
	}
}
