But we have a way around it.
Take a look a the blind trait already in the game
Code:
blind = {
type = health
finesse = -3
dna_modifiers = {
accessory = {
mode = replace #overwrite this gene in the dna with the specified template and value
gene = eye_accessory
template = blindfold_1
value = 1
}
}
}
It is a trait that modifies the dna of a person.
This works nicely if say you wanna change the skin color of a charter to blue and have a blue man group trait in you game.
However when you try and do
Code:
dna_modifiers = {
morph = {
mode = replace
gene = age
template = old_1
value = 0.5
}}
to turn your pop into a 50 year old. It will print out a error in the log that you are not allowed to modifiers this special gene.
so we need a work around.
Basically we need to make a new gene that disables or reverses the effects of aging.
And then we add that to the character.
There is a nice example already in the genes.txt. namely
Code:
special_genes = {
morph_genes={
gene_tags = {
no_hair = { index = 0 set_tags = "no_hair" }
}}
this gene is found at the bottom of _genes.txt. All it does is set a "tag" which will turn of or enable those other genes that required_tags = "no_hair".
This way you can very easily make a shame trait. so that you can shave all those people that failed the nation.
So we can make our own.
Code:
gene_tags = {
no_hair = { index = 0 set_tags = "no_hair" }
unaging ={ index = 1 set_tags = "unaging"}
This look like a simple solution but there is a problem.
When we go and add the required_tags = "not(unaging)" we run in to a problem.
Every sub_gene and every person type has 4 effects for aging.
- setting = { animation_curve = { ... } }
- a skin decal
- a hair hsv shift (grey hair)
- a skin hsv shift
We can only use required_tags = "not(unaging)" for the setting block and the Decal.
The hair_hsv_shift_curve function is not used anywhere else but the age gene and cant be affected by tags or wrapped in a settings block. So as far as I know you can only tweak the numbers and outright disable aging for everyone in the world. But not for specific people and groups.
So a another work around needs to be found.
because hair_hsv_shift_curve cant be on a disabled. We can do the next best thing.
And add another hair_hsv_shift_curve but with the negative values. this will Undo the effects of aging for only the characters with that new gene we add by trait.
Code:
gene_tags = {
no_hair = { index = 0 set_tags = "no_hair" }
# full_hair = { index = 1 set_tags = "full_hair" }
unaging ={
index = 1
set_tags = "unaging"
#set_tags = "test1,test3"
male = {
hair_hsv_shift_curve = {
#age {hsv change}
{ 0.35 { 0.0 0.0 0.0 } }
{ 0.6 { 0.0 0.5 -0.3 } }
}
skin_hsv_shift_curve = {
#age {hsv change}
{ 0.55 { 0.0 0.0 0.0 } }
{ 0.8 { 0.0 0.1 -0.02 } }
}
}
}
So now we make a trait that adds this gene.
Code:
unaging = {
type = health
dna_modifiers = {
morph = {
mode = add #add this gene in the dna with the specified template and value
gene = gene_tags
template = unaging
value = 0.5 #removes 50 years of aging. Max age is 100 so a 150 year will look like a 50 year old too
}
}
}
I have omitted the parts needed for females. I leave that as a exercise to the reader