Thanks Sauron. I used the ages to avoid selecting elderly people, but I guess with the decaying prowess with increased age it might work just as well.
geographical_region
trigger (so outdoor event backgrounds could still fire for regions that don't get winter), but realizing I absolutely lack the knowledge to know whether that's the case for many regions on the map, I did some digging and found map_data/climate.txt
, which lists which provinces have mild, normal, or extreme winters. Brilliant, except that these don't seem to be referenced from anywhere in script, so I have no idea how to use them, or even if they can be used.map_data/climate.txt
, but that sounds kind of insane.Incidentally you could useThanks Sauron. I used the ages to avoid selecting elderly people, but I guess with the decaying prowess with increased age it might work just as well.
can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
instead of the is_female
check if you want it to work better for non-male-dominated faiths.In vanilla game files I regularly find text which is capitalized. I first thought it had to do with localization, but that is not always the case. Example:
<$INTERCOURSE_CHARACTER$ > in the triggered effects folder ) Does anyone know what these parts of files signify/do?
intercourse_with_character_effect = {
INTERCOURSE_CHARACTER = scope:some_character
}
had_sex_with_effect
.)some_simple_effect = yes
.Is there any way to check climatic data for a given province? I want to condition my event background so it only uses an outdoor option if it's not winter.
My initial thought was to cross-reference the date with thegeographical_region
trigger (so outdoor event backgrounds could still fire for regions that don't get winter), but realizing I absolutely lack the knowledge to know whether that's the case for many regions on the map, I did some digging and foundmap_data/climate.txt
, which lists which provinces have mild, normal, or extreme winters. Brilliant, except that these don't seem to be referenced from anywhere in script, so I have no idea how to use them, or even if they can be used.
Fallback is to check against all the provinces inmap_data/climate.txt
, but that sounds kind of insane.
map_data/climate.txt
, which I then checked against time_of_year
. Unfortunately, it seems like the only way to make custom regions is to overwrite the vanilla regions file, but I doubt many people are doing this anyway, so my hope is collisions with other mods should be rare, and it beats having to check each province ID individually.same_culture_opinion
, but same_culture_group_opinion
does nothing. In CKII you could even add opinions for specific cultures and culture groups, so unless I'm missing something, this is extremely lame...Hello,
i have a question. Where is the gender of a character defined ? (Ionly found the type=male/female in the _dna file or the _bookmark file) I set the type of my custom character on both to type = female, but when i start a game the character is male. Can y help me ?
history/characters
. For example, Duchess Matilda of Tuscany is defined as female in history/characters/italian.txt
:—7757 = {
name = "Matilda" # Matilda di Canossa, Duchess of Toscana, MVP
dna = 7757_duchess_matilda
female = yes
# …
}
create_character
using a number of different parameters:—create_character = {
# Choose one
gender = female
gender = character:7757 # Will have the same gender as the specified character
opposite_gender = character:7757 # …or the opposite gender of the specified character
gender_female_chance = 50 # or a script value between 0 and 100
# …
}
if = {
limit = {
Character.GetAge < 25
}
set_immortal_age = 25
}
else = {
set_immortal_age = Character.GetAge
}
Hi,
I need your help again.
He has a trait with no prowess loss from age = yes but he still looses prowess ???
For inheritable immortality, how would you write the immortal age so that it doesn't keep babies looking like babies forever but locks at a predetermined age when they grow up, while also letting people who only just attained immortality keep looking how they looked when they got the trait?
I think it would include something like:
but the if block needs something more. As it is right now, babies born with the immortality trait would just look 25.Code:if = { limit = { Character.GetAge < 25 } set_immortal_age = 25 } else = { set_immortal_age = Character.GetAge }
How do you allow them to age naturally until age 25?
# common/on_action/immortality_on_actions.txt
immortality_age_update = {
effect = {
if = {
limit = { NOT = { exists = scope:child } }
save_scope_as = child # Just to make sure the scope is what is expected by on_birth_child
}
scope:child = {
if = {
limit = {
has_trait = immortal
age <= 25
}
set_immortal_age = age
}
}
}
}
on_birthday = {
# Using first_valid_on_action simply to avoid overwriting the vanilla on_actions
first_valid_on_action = { immortality_age_update }
}
on_birth_child = {
on_actions = { immortality_age_update }
}
option = {
name = faith_province.1
trigger = { }
capital_county = {
set_county_faith = root.faith
}
}
option = {
name = faith_province.1
trigger = { }
every_directly_owned_province = {
limit = { }
set_county_faith = root.faith
}
How do I apply this to all directly owned provinces, not just capital county?
Code:option = { name = faith_province.1 trigger = { } capital_county = { set_county_faith = root.faith } }
This is what I've got so far, but I couldn't get this to work.
Code:option = { name = faith_province.1 trigger = { } every_directly_owned_province = { limit = { } set_county_faith = root.faith }
option = {
name = faith_province.1
trigger = { }
every_sub_realm_county = {
limit = { holder = root }
set_county_faith = root.faith
}
every_directly_owned_province
iterates through provinces, i.e. baronies, rather than counties, so I think this is the way to go about this. The one thing I'm unsure about is whether or not you need to use every_sub_realm_county
, as I have, or every_realm_county
—I'm honestly confounded by the difference, so I'd try the latter if the former fails you.Unfortunately that's beyond my competency. My guess is that the 'no prowess loss from age' modifier might not be coded to work with normal traits (since the only place I know of it existing in-game is with dynasty legacies), but I could very well be wrong.
I'm not sure if it's the best way, but one option that comes to mind here is, in place of all this code, simply let the player's immortal age be set to the default (which will be the age when they get the trait). Then you can pair this behavior with a yearly pulse effect that updates the immortality age to the current age every year until 25. Something like this, maybe?
Code:# common/on_action/immortality_on_actions.txt immortality_age_update = { effect = { if = { limit = { NOT = { exists = scope:child } } save_scope_as = child # Just to make sure the scope is what is expected by on_birth_child } scope:child = { if = { limit = { has_trait = immortal age <= 25 } set_immortal_age = age } } } } on_birthday = { # Using first_valid_on_action simply to avoid overwriting the vanilla on_actions first_valid_on_action = { immortality_age_update } } on_birth_child = { on_actions = { immortality_age_update } }
Try this?
Code:option = { name = faith_province.1 trigger = { } every_sub_realm_county = { limit = { holder = root } set_county_faith = root.faith }
every_directly_owned_province
iterates through provinces, i.e. baronies, rather than counties, so I think this is the way to go about this. The one thing I'm unsure about is whether or not you need to useevery_sub_realm_county
, as I have, orevery_realm_county
—I'm honestly confounded by the difference, so I'd try the latter if the former fails you.
Couldn't there just be an event that fires for everybody in his dynasty where it gives them the immortality trait once they reach the age of 25 or something?