角色模组制作

咯咯炀讨论 | 贡献2020年9月14日 (一) 19:34的版本 (同步到官方百科15:28, 11 September 2020‎ WeirdMatter)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

Modding characters involves changing their appearance, data and behaviour. This can vary from small tweaks like adding gold or piety, to complex changes like scripting new visual effects and more.

Changing Appearance through Scripts

In Crusader Kings 3, there is a complicated system involving 'DNA' to define a character's appearance, which has changed from Crusader Kings 2. These changes allow for more specific and realistic appearances.

You can change a character's DNA through dna_modifiers. Create a file in gfx/portraits/portrait_modifiers with any filename and add this:

dna_change_example_modifier = {
    usage = game
    dna_change_example_modifier = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = headgear
                template = western_imperial
                value = 1.0
            }
            color = {
                mode = modify
                gene = hair_color
                x = 0.5
                y = -0.5
            }
        }
        weight = {
            base = 0
            modifier = {
                add = 100
                has_character_flag = dna_change_example_modifier
            }
        }
    }
}

This will add the western_imperial headgear and change the hair color of any character with the "dna_change_example_modifier" flag. You can add a flag to a character with the add_character_flag command, like this:

add_character_flag = {
    flag = dna_change_example_modifier
}

If you encounter any issues, check the error.log of the game for any specific error messages and correct your script accordingly.