头衔模组制作

本页面所适用的版本可能已经过时,最后更新于2.6
Pokewiz讨论 | 贡献2020年5月24日 (日) 03:12的版本 (文本替换 - 替换“Category:Modding”为“Category:模组制作”)

Titles are defined, as of 1.06b, in the files contained in the /common/landed_titles/ folder. However, the coat of arms is in /gfx/flags/ and the history is in /history/titles/.

Basic titular title

You can make a basic titular title in a really easy way. First you decide the tier and select the proper prefix. Remember that you can't create pure titular baronies:

Tier Prefix
Barony b_
County c_
Duchy d_
Kingdom k_
Empire e_

Then, you must select a color. Colors are defined in RGB. You can see a non-exhaustive list of colors on Wikipedia. Remember you must take the decimal code and not the hexadecimal one. The title can take two color modifiers color and color2, which is optional. The color2 modifier changes the secondary color of your border.[1]

For example, to create a kingdom-tier title which will be colored in yellow in the map, the following code may be used:

k_mytitle = {
    color={ 255 255 0 }
}

This can be added to the default landed_titles.txt or any other plain text file in the /common/landed_titles/ folder.

This is enough to add the title to the game, and it may now be granted to a character using console commands. However, the title's name will be k_mytitle and the coat of arms (CoA) will be the same as the rebels. (Others titles' CoAs will also be incorrectly assigned.)

Adding a coat of arms

The coat of arms of titles above barony level are not generated ingame like those of dynasties, but instead are premade and loaded from the /gfx/flags/ folder. Custom coats of arms must be saved as 24-bit 128×128 pixel TGA images and saved in that folder with the same name as the custom title. In our example, the file should be named k_mytitle.tga. If you don't want to create a coat of arms now, you can just copy another file. While the game will run if a title (above barony) has no coat of arms file, other coats of arms may behave unexpectedly and be assigned to the wrong titles.

Baronies

While baronial coats of arms are generally auto-generated by the game, custom arms may be applied to a barony title using the same system as dynasty coats of arms. A coat_of_arms tag is used within the title's tag, which may be defined in two ways. The first (explicit) system is formatted as follows:

coat_of_arms = {
	template = 0
	layer = {
		texture = 2
		texture_internal = 9
		emblem = 0
		color = 3
		color = 1
		color = 2
	}
	religion = "catholic"
}

A simple string of numbers in the following format may also be used:

coat_of_arms = {
	data = {
		#template texture emblem texture_internal color1 color2 color3
		0 2 0 9 3 1 2
	}
	religion = "catholic"
}

The order of these numbers is:

template, texture, emblem, texture_internal, color1, color2, color3

See Dynasty modding § Coat of Arms for details on what these values mean. The religion line defines which kind of Coat of Arms should be used.

Even if an image file matching a barony's name is present in the flags folder, baronies will not use it. However, full-color coats of arms similar to those used by higher tier titles can be achieved for baronies by using dedicated entries in Coats of arms.txt (using color = 0 to prevent it from assigning colors), in a similar manner to the dynasty arms included in the Dynasty Shields DLCs and the coats of arms for certain titles when held by pagan characters (see below).

Pagan coats of arms

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 much the same way as a normal coat_of_arms tag, and in a similar manner to barony arms. For example, the Duchy (Kingdom) of the Isles (d_western_isles) uses the following code:

d_western_isles = {
	color = { 6 42 127 }
	color2 = { 255 255 255 }
	capital = 35 # Inse Gall
	
	norwegian = "Søreyar"
	danish = "Søreyar"
	swedish = "Söröarna"
	norse = "Suðreyjar"
	pictish = "Insee Hilth"
	welsh = "Ynysoedd Heledd"
	irish = "Dál Riata"
			
	pagan_coa = {
		template = 0
		layer = {
			texture = 2
			texture_internal = 8
			emblem = 0
			color = 0
			color = 0
			color = 0
		}
		religion = "norse_pagan"
	}

	[sub-holdings go here]

}

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. The other values here are set to 0, since this is a full-color coat of arms rather than using the assigned colors. They may however be used in the same way as in normal coat_of_arms tags if so desired. (For more details, see Dynasty modding § Coat of Arms.)

Localisation

Probably, you want the title to be named other than Kingdom of k_mytitle, so we need to add some localisation. So create a new file in the /localisation/ folder. It must be a CSV file, so the name could be something like mymod.csv. Now you can add, for reference, a comment header so you know where is each language, and then the code and name of your new title as well as the adjetive for that title. In our example, we are creating the titular Kingdom of Paradox:

#CODE;ENGLISH;FRENCH;GERMAN;;SPANISH;;;;;;;;;x
k_mytitle;Paradox;Paradox;Paradox;;Paradox;;;;;;;;;x
k_mytitle_adj;Paradoxian;Paradoxien;Paradoxier;;Paradoxiano;;;;;;;;;x

And now you have a proper name for your title.

Title hierarchy

Landed titles are organized in a hierarchy, with each king title containing its de jure duchies, and so forth. Creating new counties requires modifying the map, but kingdoms may be split up or counties moved to different duchies easily. For example, suppose we want to make a de jure Kingdom of Northumbria containing northern England. Since we want our new kingdom to be part of the Empire of Britannia, we first find the beginning of that title in landed_titles.txt:

e_britannia = {
       ...
       k_england = {

We then insert our kingdom immediately before England, find the duchies in England that we want to be part of Northumbria, and cut and paste them to be in our kingdom instead of in England:

e_britannia = {
       ...
       k_northumbria = {
           capital = 57 #York 
           color = { 185 25 51 }
           d_northumbria = {
            ...
           }
           d_york = {
           ...
           }
           d_lancaster = {
           ...
           }
       }
       k_england = {
       [southern duchies]

Similarly, if we want to change the duchy that a county is in, we can cut that county's entry and put it under another duchy.

Special flags

There are many additional optional modifiers that can apply to a title. All are optional. Boolean modifiers (i.e. true/false values), which are abbreviated to bool, default to the opposite of the example given.

Name Value Effect Example
capital provinceID Listed province must be controlled to create a regular titular tilte. Affects ability to recruit mercenaries. Ruler can relocate their capital here without restriction. capital = 80 #Holland
has_top_de_jure_capital bool has_top_de_jure_capital = yes
top_de_jure_capital bool top_de_jure_capital = yes
allow conditions Special conditions to create a title, or to recruit a mercenary company. Cannot be used with baronies.
allow = {
  OR = {
    ai = no
    culture = dutch
  }
}
religion religion Randomly-generated holders will have this religion. For holy orders, employer religion must match to be able to recruit. religion = catholic
culture culture Randomly-generated holders will have this culture. For kingdoms, used as a condition for liberation revolts. culture = frankish
graphical_culture Used for theocracies in vanilla. graphical_culture = holygfx
landless bool Title will continue to exist if holder has no land landless = yes
primary bool Title will always display as primary title primary = yes
title key Gives localisation key for holder's title if non-standard (e.g. "Captain") title = "TITLEKEY"
title_female key Gives localisation key for holder's title if non-standard (e.g. "Captain") title_female = "QUEEN"
foa key Gives localization key for holder's form of address if non-standard (e.g. "My Captain") foa = "FOAKEY"
title_prefix key Gives localization key for prefix to title name if non-standard (e.g. "Grand Duchy of ...") title_prefix = "PREFIXKEY"
short_name bool Skips the title_prefix. Used for titles like Byzantine Empire, to avoid names like Empire of Byzantine Empire short_name = yes
name_tier tier Used so that empires can for instance be called kingdoms, etc name_tier = king
coat_of_arms 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
mercenary bool Flags title as mercenary company mercenary = yes
mercenary_type mercenaryType Links to the definition of troop composition of mercenary or holy order. mercenary_type = knights_templar_composition
independent bool This mercenary company can't be vassalized (Leave this line out, if you don't want this to be the case) independent = yes
holy_order bool Flags title as holy order holy_order = yes
modifier modifiers Links to modifier in common/static_modifiers.txt that gives troop types for mercenaries and holy orders. modifier = this_title_modifier
strength_growth_per_century double Mercenaries and holy orders increase in size by this percentage each century strength_growth_per_century = 0.25
[religion_group] int For landed kingdoms, weight for being targeted by AI crusade of given religion group. christian = 500
[religion] int For landed kingdoms, weight for being targeted by AI crusade of given religion. catholic = 500
male_names list<string> Randomly-generated rulers will take titles from this list instead of the usual list for their culture male_names = {name1 name2 ... }
female_names list<string> Randomly-generated rulers will take titles from this list instead of the usual list for their culture
controls_religion religion Titleholder is head of given religion controls_religion = catholic
tribe bool Flags title as tribal: it will be destroyed if non-tribal title of same rank is acquired. tribe = yes
creation_requires_capital bool Allows titular title to be created without holding set capital province creation_requires_capital = no
caliphate bool Flags title as caliphate caliphate = yes
dynasty_title_names bool Disables naming realm from the ruling dynasty dynasty_title_names = no
used_for_dynasty_names bool Disables naming dynasties based on this barony b_roma = { dynasty_title_names = no }
purple_born_heirs bool Activates Born in the purple.png mechanic purple_born_heirs = yes
[culture] string Gives alternate name if held by ruler of given culture german = "Zürich"
location_ruler_title bool Lists the capital province as part of the title (e.g. 'Pope in Rome') location_ruler_title = yes
dignity int Title is considered to have this many more provinces than actual for purpose of determining the relative prestige of the title. AI will always make most prestigious title primary. Can cause strange behavior regarding a ruler's tier if set to a very high or negative value. Cannot be used with counties and below. dignity = 200
holy_site religion Sets a location as a holy site of a religion holy_site = catholic
pentarchy bool/religion Sets the title (barony) to be a Pentarch seat either for ALL religion that use autocephaly or the specified religion.[2] Note that it can also be configured dynamically via the set_pentachy_title command. pentarchy = yes

or

b_jerusalem = {
    pentarchy = orthodox
    pentarchy = miaphysite
}
assimilate bool If no, stops title from assimilating or being assimilated assimilate = no
duchy_revokation bool The Emperor can revoke duchies at no prestige cost and no opinion penalty with other vassals duchy_revokation = yes
gain_effect commands
monthly_income int Used for holy orders in vanilla, must be an integer between 1 and 512. Extra income due to banking, etc
can_be_claimed bool Whether claims can be added on the title. If set to "no" (default "yes"), will block all claims, even claims via script. can_be_claimed = no
can_be_usurped bool Whether a title can be usurped. Defaults to "yes". can_be_usurped = no
extra_ai_eval_troops int How many more troops the AI should assume someone with this as their primary title has. Has no effect on anything except AI. Higher numbers means others are less willing to attack them, and they're more willing to attack others. extra_ai_eval_troops = 10000
hire_range int How far away a mercenary title can be hired. If not set, defaults to the MERCENARY_HIRE_DISTANCE_THRESHOLD define. hire_range = 1000

External links

References