• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
I created some new sea provinces. I defined them as sea_zones in default.map.

And for some reason my new sea has the lake color, and not the sea color like I want it to have. I really need to fix this but can't figure out how. Help!


1605646604804.png
 
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 the 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.

Fallback is to check against all the provinces in map_data/climate.txt, but that sounds kind of insane.
 
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. :)
Incidentally you could use 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.
 
  • 1
  • 1Like
Reactions:
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?
 
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?

The strings surrounded by dollar signs like that are variables that are passed into the effect. For example, that one is called as such:

Code:
intercourse_with_character_effect = {
    INTERCOURSE_CHARACTER = scope:some_character
}

(Though for what it's worth, that particular effect is only used a few times in the whole game, and I'm not sure what it's purpose is; it looks like it's left over test code that's been replaced with had_sex_with_effect.)

These contrast with effects that don't take variables, which are usually just called as 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 the 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.

Fallback is to check against all the provinces in map_data/climate.txt, but that sounds kind of insane.

The way I ended up solving this is by creating custom regions based on the data in 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.
 
Wait, is there no way to add an opinion modifier for same culture group to a trait? Some traits have 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...
 
Update RE: my question about sea water colors: I just had to edit gfx/map/water/watercolor_rgb_waterspec_a.dds! Thanks to UlfDerDritte from the CK3 discord.
 
  • 1
  • 1Like
Reactions:
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 ?
 
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 ?

For historical characters (i.e., characters that exist at game start), gender is defined in their character entry in history/characters. For example, Duchess Matilda of Tuscany is defined as female in history/characters/italian.txt:—

Code:
7757 = {
    name = "Matilda" # Matilda di Canossa, Duchess of Toscana, MVP
    dna = 7757_duchess_matilda
    female = yes

    # …
}

For characters created on-the-fly, you can determine gender in create_character using a number of different parameters:—

Code:
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

    # …
}
 
Hi,
I need your help again.
He has a trait with no prowess loss from age = yes but he still looses prowess ???
 

Attachments

  • 2020-11-18 19_58_43-Crusader Kings III.png
    2020-11-18 19_58_43-Crusader Kings III.png
    710,6 KB · Views: 0
  • 2020-11-18 19_59_00-Crusader Kings III.png
    2020-11-18 19_59_00-Crusader Kings III.png
    386,9 KB · Views: 0
  • 2020-11-18 19_59_10-Crusader Kings III.png
    2020-11-18 19_59_10-Crusader Kings III.png
    50,9 KB · Views: 0
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:
Code:
 if = {

        limit = {

            Character.GetAge < 25

        }

        set_immortal_age = 25

    }

    else = {

        set_immortal_age = Character.GetAge

    }
but the if block needs something more. As it is right now, babies born with the immortality trait would just look 25.

How do you allow them to age naturally until age 25?
 
Hi,
I need your help again.
He has a trait with no prowess loss from age = yes but he still looses prowess ???

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.

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:
Code:
 if = {

        limit = {

            Character.GetAge < 25

        }

        set_immortal_age = 25

    }

    else = {

        set_immortal_age = Character.GetAge

    }
but the if block needs something more. As it is right now, babies born with the immortality trait would just look 25.

How do you allow them to age naturally until age 25?

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 }
}
 
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
        }
 
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
        }

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 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 }
}

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?
 
  • 1Like
Reactions:
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 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.

It works, thanks for the help.
 
  • 1Like
Reactions:
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?

You could if it has a 100% inheritance rate, but things get trickier otherwise, and at any rate, you'd also have to traverse down the family tree of women whose children are born into other dynasties, which sounds more taxing than my solution, though I grant it may not actually be in practice.