王国风云2
ParaWikis
最新百科
都市天际线2百科
英雄无敌3百科
维多利亚3百科
奇妙探险队2百科
罪恶帝国百科
英白拉多:罗马百科
热门百科
群星百科
欧陆风云4百科
十字军之王2百科
十字军之王3百科
钢铁雄心4百科
维多利亚2百科
ParaWikis
申请建站
ParaWikis
ParaCommons
最近更改
随机页面
加入QQ群
工具
链入页面
相关更改
特殊页面
页面信息
页面值
帮助
译名手册
字词转换
编辑指南
编辑规范
练手沙盒
资助我们
ParaTranz
资助我们
×
欢迎访问王国风云2百科!
注册一个账号
,一起参与编写吧!这里是
当前的工程
。
全站已采用新UI,任何使用上的问题请点击
这里
。欢迎所有对百科感兴趣的同学加入QQ群:
497888338
。
阅读
查看源代码
查看历史
讨论
查看“建筑模组制作”的源代码
←
建筑模组制作
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{version|2.8}} [[File:Castle.jpg|right|frame|Constructed buildings of a castle holding]] [[Building]]s are fairly simple to mod. Building definitions are located in ''common\buildings\'' folder. ==Structure== {| class="wikitable sortable" |- !Name !Type !Description !Example |- |potential |[[conditions]] (province scope) |Decides if the building shows up on the buildings list of a holding. FROM is the settlement holder (a character), FROMFROM is the holding (a barony title). |<pre>potential = { religion = catholic }</pre> |- |desc |Key |Localization key for building description, used in the tooltip of the building. Follows <building_name>_desc convention. |<pre>desc = shipyard_desc</pre> |- |add_number_to_name |bool |Makes the game use 1st level building name, and add number after it to name higher level buildings. |<pre>add_number_to_name = no</pre> |- |replaces |building |The replaced building will not be constructible, even if its <code>potential</code> would match. ''Warning'': don't replace a vanilla building that is part of a building chain ! prerequisites don't allow for the replaced building to be checked. |<pre>ca_steppe_barracks_1 = { replaces = ca_barracks_1 } </pre> |- |trigger |[[conditions]] (province scope) |Requirements to be able to build the building. |<pre>trigger = { TECH_CASTLE_CONSTRUCTION = 0 }</pre> |- |is_active_trigger |[[conditions]] (province scope) |The building will not apply its modifiers to the holding, unless the trigger conditions are satisfied. |<pre>is_active_trigger = { location = { OR = { port = yes borders_major_river = yes borders_lake = yes } } } </pre> |- |port |bool |Can only be built on coastal province. ''Warning'': This check fails if the county has no ruler, so beware if your mod relies on letting the game auto create rulers upon starting a new game. |<pre>port = yes</pre> |- |prerequisites |List<building> |Other buildings requirements |<pre>ca_steppe_barracks_2 = { prerequisites = { ca_wall_1 } }</pre> |- |not_if_x_exists |List<building> |Cannot build this building if another is (or others are) built. |<pre>not_if_x_exists = { ca_walls_1 ca_walls_2 }</pre> |- |upgrades_from |building |The building replaces the one it upgrades from, but the modifiers are cumulated. |<pre>upgrades_from = tb_training_grounds_1</pre> |- |gold_cost |int |Gold cost to build the building. Mutually exclusive with prestige and piety cost. |<pre>gold_cost = 150</pre> |- |prestige_cost |int |Prestige cost to build the building. Mutually exclusive with gold and piety cost. |<pre>prestige_cost = 300</pre> |- |piety_cost |int |Piety cost to build the building. Mutually exclusive with gold and prestige cost. |<pre>piety_cost = 100</pre> |- |build_time |int |Time to build, in days |<pre>build_time = 365</pre> |- |ai_creation_factor |int |Chances for the AI to chose constructing this building. |<pre>ai_creation_factor = 95</pre> |- |ai_feudal_modifier |int |Modifies the ai creation weight if the ai is feudal, or is tribal but strive to become feudal. |<pre>ai_feudal_modifier = -10</pre> |- |ai_republic_modifier |int |Modifies the ai creation weight if the ai is a republic, or is tribal but strive to become a republic. |<pre>ai_republic_modifier = 5</pre> |- |extra_tech_building_start |double |When starting a new game, a building will be pre-built if the province has higher technology than the trigger requirement(s) + the value of extra_building_start + a random number 0-1 |<pre>extra_tech_building_start = 0.4</pre> |- |scouting |bool |Determines if the building gives vision of the province where it was built, like a Merchant Republic trade post. |<pre>scouting = yes</pre> |- |convert_to_city |rowspan=4|building |rowspan=4|If the holding is converted to another type, the building gets converted to the equivalent building |<pre>convert_to_city = ct_wall_1</pre> |- |convert_to_castle |<pre>convert_to_castle = ca_keep_2</pre> |- |convert_to_temple |<pre>convert_to_temple = tp_town_1</pre> |- |convert_to_tribal |<pre>convert_to_tribal = tb_shipyard_1</pre> |- |''<modifier_name>'' |Building [[modifiers]] |Modifiers provided by the building, in case <code>is_active_trigger</code> is valid. Modifiers are cumulative for upgraded building, see <code>upgrades_from</code>. Notes: * a negative <code>tax_income</code> might be used to simulate an upkeep for the building. * holdings can only process one special unit for the entire holding, so once a holding already has a special unit defined (e.g. it has a building built that adds horse archers to the holding's levy), it will ignore all other special unit entries of this type. |<pre>fort_level = 0.5</pre> <pre>light_cavalry = 35 horse_archers = 20 knights = 10</pre> |- |} ==Example== Here is an example from common\buildings\00_Castle.txt: <pre> ca_keep_6 = { desc = ca_keep_1_desc trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 8 } upgrades_from = ca_keep_5 gold_cost = 500 build_time = 2190 #6y levy_size = 0.3 garrison_size = 0.2 ai_creation_factor = 97 extra_tech_building_start = 0.2 } </pre> == Localization == * '''<building_name>''': name of the building * '''<building_name>_desc''': description of the building * '''<building_name>_<religion_group>''': overridden name by religion group (at least for temple building) == Adding a new building == So lets assume you want to add a new building to the game. This guide will give basic instruction on how to create a basic working building. There are more polished and professional ways to attack this task, but they will all build upon the basic file structure and placement included below. There are several decisions that you have to make in order to create a building that will work correctly. In what type of settlement will the building be located, castle, city, or temple? What type of restrictions will be placed on where the building can be created? What will be the bonuses or traits that this building grants? First locate the "buildings" folder inside the CK2 file structure. Usually it is something like: C:\Program Files\Steam\SteamApps\common\buildings. Once you have located the "buildings" folder you will need to add an entry to the one of these files that corresponds with the type of building you wish to add. For this example I am going to add a simple statue to my castle that will provide some nice bonuses, so I will choose the 00_castle.txt file. '''It is highly recommended that you use Notepad++ to edit the file and make a backup of this file before you make any changes.''' Under the "castle = {" heading I am just going to copy the formatting of the first entry making minor changes to create my own building. My favorite starting location is Moray in Scotland, so I will restrict the building to only working in that province. I want the building to always be available for me to build, with modest costs, and some nice bonuses for my troops and income. It will look something like this: <pre> castle = { ca_statue = { desc = ca_statue_desc potential = { OR = { province_id = 40 #Moray } } trigger = { always = yes } build_cost = 150 build_time = 91 knights = 50 levy_size = 0.5 tax_income = 5 } } </pre> There are tons of different triggers and traits that can be added to buildings to make them unique and powerful! It may be worthwhile just looking at the other entries to learn how to personalize your building. This building will give my lord 50 heavy infantry, a 50% larger levy, and 5 as income! Once these lines have been added to the 00_castle.txt file, the description tags need to be created in the localisation directory, it should be in the same folder where you found the "common" folder. Using Notepad++ copy one of the .csv files and rename it for your own building. Open the file and delete all lines except for the top line (which only serves as a template and is not actually necessary). Follow the format that it explicitly outlines in the template on the top line, making sure not to miss any punctuation marks! If desired you can add these translations, just type the French description you wish to appear in place of the "FRENCH" on the appropriate line. I don't play the game in other languages, so I didn't add any translations. Mine looks something like this: <pre> #CODE;ENGLISH;FRENCH;GERMAN;;SPANISH;;;;;;;;;x ca_statue;Heroic Statue;FRENCH;GERMAN;;SPANISH;;;;;;;;;x ca_statue_desc;This heroic statue stands as a testament for the deeds of the great men who came before and that all men can achieve greatness.;FRENCH;GERMAN;;SPANISH;;;;;;;;;x </pre> After completing these steps you should have a Statue you can build in Moray. == Changing restrictions on holdings == It is not possible to add new [[Holding]] types, but you can define the conditions for being allowed to build each holding type. Definitions for those restrictions are located in the <code>common\holding_types\</code> folder. The only thing supported within a holding is <code>trigger</code>, which defines when it can be built. ROOT is the province, FROM is the builder. Some hardcoded restrictions also apply and cannot be overriden. For example, if you wanted to restrict building temples only to theocratic characters: <pre> temple = { trigger = { FROM = { is_theocracy = yes } } } </pre> [[Category:模组制作]] {{ModdingNavbox}} [[en:Building modding]]
本页使用的模板:
Template:Clear
(
查看源代码
)
Template:ModdingNavbox
(
查看源代码
)
Template:Navbox
(
查看源代码
)
Template:Navboxgroup
(
查看源代码
)
Template:Version
(
查看源代码
)
返回
建筑模组制作
。
×
登录
密码
记住登录
加入王国风云2百科
忘记密码?
其他方式登录