盾徽模组制作

本页面所适用的版本可能已经过时,最后更新于2.7
(重定向自Coats of arms modding

Coats of arms (CoA) are heraldic designs to uniquely identify a title or a dynasty.

They are composed of a shield inside a frame, and may be displayed in 2D (character screen) or 3D (map).

Shield

There are various systems used to determine the shield of a CoA

Type Predefined Random
Title (county and above) Default, uses gfx/flags/<title>.tga If religion group has has_coa_on_barony_only = no
Title (barony) If coat_of_arms = {} is specified in /common/landed_titles/ Default
Dynasty If coat_of_arms = {} is specified in /common/dynasties/ Default

Flags

Landed titles use pre-defined flags in /gfx/flags/ folder, with hardcoded name <title_code>.tga.

This is the default for titles with tier above baron, but may be disabled by setting has_coa_on_barony_only = no at religion group level.

Notes:

  • due to the way flags are cached into sprites when the game is loaded, one missing flag for a title will cause a shift of ALL flags after the missing one.
  • baronies cannot use this system: even if an image file matching a barony's name is present in the flags folder, it won't be used.

coat_of_arms

Titles and dynasties can use a coat_of_arms = {} block in their definition.

In vanilla, this system is used for Dynasty Shields graphical DLCs, and titles above baron tier for Christians and Pagans.

46= {
	name="Kantakouzenos"
	culture="greek"
	religion="orthodox"
	coat_of_arms = {
		template = 0
		layer = {
			texture = 8
			texture_internal = 45
			emblem = 0
			color = 0
			color = 0
			color = 0
		}
	}
}
d_york = {
	(...)
	pagan_coa = {
		template = 0
		layer = {
			texture = 2
			texture_internal = 12
			emblem = 0
			color = 0
			color = 0
			color = 0
		}
		religion = "norse_pagan"
	}
	(...)
}

A shorter but less readable alternative is to group all parameters using data = { }.

The order determines the meaning of each value: template, (texture, emblem, texture_internal, color1, color2, color3)+

In case the template is composed by more than one layer, it is repeated for each layer.

In vanilla this is used for b_cluny barony title, and few dynasties.

43= {
	name="Bagratuni"
	culture="armenian"
	coat_of_arms= {
		data= { 0 0 0 14 5 3 3 }
		religion=orthodox
	}
}
b_cluny = {
	coat_of_arms = {
		data = { 0 4 12 45 2 2 2 0 0 19 2 1 3 0 0 19 2 1 3 0 0 19 2 1 3 }
		religion="catholic"
	}
}

pagan_coa

Titles can have a special coat of arms set which is used instead of the main arms when held by a pagan character. These are defined using the pagan_coa tag in the same way as coat_of_arms tag.

For example:

d_western_isles = {
	pagan_coa = {
		template = 0
		layer = {
			texture = 2
			texture_internal = 8
			emblem = 0
			color = 0
			color = 0
			color = 0
		}
		religion = "norse_pagan"
	}
}

This tells the game that when a pagan ruler holds the title, rather than displaying the normal coat of arms, arms number 8 (i.e. the 9th image; counting starts at 0) in norse_pagan arms texture number 2 will be displayed instead.

Random

Random CoA, are based on religion restrictions on patterns, emblems and colors combinations, configured via coats of arms.txt.

This is the default for dynasties and baron tier titles. For titles above baron tier, it can be activated at religion group level by setting has_coa_on_barony_only = no.

In vanilla, this is used for most dynasties, baron tier titles for Christians and Pagans, and all tier titles for Muslims.

Frame

3D

If displayed on the map, the frame is based on the graphical_culture of the religion of the liege, and looking for a EMFXActorType 3D gfx named <graphical_culture>_<tier>_shield:

EMFXActorType = {
	name = "westerngfx_count_shield"
	actorfile = "gfx\models\Shields\count_shield.xac"
	scale = 0.5f
	use_animation = no
}

2D

When displayed on other screens, the frame is based on coats of arms.txt, by matching religion of the liege [or dynasty head for dynasties].

Frame may be overridden in the definition of the dynasty via forced_coa_religiongroup [{{{1}}}].

Coats_of_arms.gfx

This file is used to define the graphics used for drawing a Coat of Arms. Note that new definitions can be added to any separate .gfx file inside interface/ folder, not only in vanilla coats_of_arms.gfx

It contains a series of a spriteType and CoatOfArmsType, inside a spriteTypes group.

spriteType

The spriteType seems to be used internally by CKII, and not in the Coat of Arms data. In the vanilla file there is only spriteType, which is as follows:

spriteType = {
    name = "GFX_coa_size"
    texturefile = "gfx\\coats_of_arms\\coa_size.tga"
    noOfFrames = 1
}

CoatOfArmsType

The CoatOfArmsType defines the templates used for drawing templates, using the following attributes:

Attribute Description Data Type Example
name The name of the template String name = "coa_plain"
frame The frame used for drawing the CoA String frame = "gfx\\coats_of_arms\\frame.tga"
mask The mask used for the CoA seal String mask = "gfx\\interface\\seal_mask_CoA.tga"
seal_overlay The graphic used for the seal String seal_overlay = "gfx\\interface\\seal_overlay_CoA.dds"
effect The file containing the draw shaders String effect = "gfx/FX/coa_shield.lua"
layer One or more layer definitions Group See below

Layers

The layer groups define how many layers, and which masks they should use, using the following attributes:

Attribute Description Data Type Example
mask The visibility mask used for the layer. String mask = "gfx\\coats_of_arms\\plain.tga"
center The center coordinates of where the emblem is drawn on the layer Group center = { x= 0.25 y = 0.07 }
scale The scale which the emblem is drawn at Float scale = 0.5

Example

spriteTypes = {

   spriteType = {
        name = "GFX_coa_size"
        texturefile = "gfx\\coats_of_arms\\coa_size.tga"
        noOfFrames = 1
    }

    CoatOfArmsType = {
        name = "coa_plain"
        frame = "gfx\\coats_of_arms\\frame.tga"
        mask = "gfx\\interface\\seal_mask_CoA.tga"
        seal_overlay = "gfx\\interface\\seal_overlay_CoA.dds"
        effect = "gfx/FX/coa_shield.lua"

        layer = {
            mask = "gfx\\coats_of_arms\\plain.tga"
            center = { x= 0 y = 0 }
            scale = 1
        }
    }
}

Coats_of_arms.txt

This file is used to define the templates, colors, emblems, and pattern textures for a Coat of Arms.

culture

This is the root tag in the file, within which are the following tags:

Attribute Description Data Type Example
religion_group Used to specify a separate Coat of Arms set for a religion group String religion_group = "christian"
templates The list of templates used by the definition Group See below
color The list of colors that can be used for drawing Group See below
banned_colors A list of color combinations that cannot be used Group See below
emblem The path of the texture containing the emblems String emblem = "gfx\\coats_of_arms\\emblem.tga"
noOfEmblem The number of emblems in the texture defined in the emblem tag Integer noOfEmblem = 25
textures A list of texture tags defining the patterns Group See below

templates

A template (as defined in Coats of arms.gfx) is added to the definition by enclosing the name and layer count of the template inside a template tag. For example:

templates = {
    "coa_plain:1"
    "coa_party_per_pale:2"
    "coa_party_per_fess:2"
    "coa_party_per_cross:4"
    "coa_party_per_triangle:3"
}

color

The colors are defined using the RGB format with a range of 0-255 inside a pair of curly braces. Because these are stored as a series of numbers, it would be wise to comment the list with the name of the color. Colors are referred to by other sections by ID, starting from 0. An example colors definition:

color = {
    { 255 149 0 }     #0 Or (Gold)
    { 245 245 245 }   #1 Argent (White )
    { 48 92 164 }     #2 Azure ( Blue)
    { 201 43 43 }     #3 Gules (Red)
    { 131 192 114 }   #4 Vert (Light Green)
    { 20 20 20 }      #5 Sable (Black)
}

banned_colors

This is a list of color combinations not to be used, with the colors listed by ID. To ban the colours Or and Argent (from the above example) from being used together, you would put them together in a group like so: { 0 1 }. An example banned_colors definition:

banned_colors = 
{ 
    { 0 1 }                     #0        
    { 0 1 9}                    #1        
    { 2 3 4 6 7 8 9 12 14 }     #2        
    { 2 3 4 7 9 10  }           #3        
    { 2 4 6 7 9 10 13 14}       #4        
    { 5 10 14 15}               #5        
    { 2 4 6 10 11 12 }          #6
}

textures

The textures tag defines the pattern textures in a group of texture tags.

texture

The texture tag defines the patterns used when drawing a Coat of Arms. Each pattern texture typically contains multiple individual pattens. It contains the following options:

Attribute Description Data Type Example
file The file path to the pattern texture String file = "gfx\\coats_of_arms\\pattern.tga"
size The number of patterns on the X and Y axes. Group size = { x = 10 y = 3 }
noOfFrames The total number of patterns in the texture. This may be different from the X count multiplied by the Y count. Integer noOfFrames = 27
color The number of colors that can be used for drawing this pattern. Integer color = 2
max_emblems How many emblems the AI is allowed to use at most (default value is 1).
Also ensures only templates with at most this many slots get used by the AI. No effect if "emblem = no" is set. Added in Patch 2.8.X.
Integer max_emblems = 2
emblem_chance The chance that an emblem will be used at all by the AI (default value is 50). Added in Patch 2.8.X. Integer emblem_chance = 30
random If "no", then will not be used for random CoAs Bool random = no

See also

External links