编辑“Coat of arms modding

警告:您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您登录创建一个账户,您的编辑将归属于您的用户名,且将享受其他好处。

该编辑可以被撤销。 请检查下面的对比以核实您想要撤销的内容,然后发布下面的更改以完成撤销。

最后版本 您的文本
第13行: 第13行:
}
}
</pre>
</pre>
如果 "coat_of_arms_name" 与称号、家族或王朝的键名相同(例如 "d_leon" ),游戏将在游戏开始时自动使用该纹章作为默认布局。这也适用于修改过的称号、家族或王朝。


== 有效键值 ==
== 有效键值 ==
第30行: 第28行:
|-
|-
| colspan="3" | <code>pattern</code>
| colspan="3" | <code>pattern</code>
| 背景图案文件的路径(通常位于 {{path|gfx/coat_of_arms/patterns/}}.<br /> )。应包含一个图案,以避免在使用纹理纹章时出现图形问题。.
| The path to the file for the background pattern (usually located in {{path|gfx/coat_of_arms/patterns/}}.<br />A pattern should be included to avoid graphical issues with the masking textures when using textured emblems.
| <pre>pattern = "pattern_vertical_split_01"</pre>
| <pre>pattern = "pattern_vertical_split_01"</pre>


第39行: 第37行:
color4
color4
color5</pre>
color5</pre>
| 指定一种颜色,用于图案或作为有色徽章中的颜色参考。 <br /> 通常是指在 {{path|common/named_colors}} <br /> 中定义的颜色。还可以显式定义RGB、HSV和8位十六进制值。
| Specifies a color, to be used in the pattern or as a color reference in colored_emblems.<br />Usually refers to a color defined in {{path|common/named_colors}}.<br />Can also explicitly define RGB, HSV and 8-Digit Hexadecimal values.
| <pre>color1 = "white"
| <pre>color1 = "white"
color2 = hsv { 1.0 1.0 1.0 }
color2 = hsv { 1.0 1.0 1.0 }
第49行: 第47行:
| rowspan="7" | <code>textured_emblem</code>
| rowspan="7" | <code>textured_emblem</code>
| colspan="2" | ---
| colspan="2" | ---
| 可以指定多个纹理标志。每个标志本身是一个脚本对象,具有以下有效关键字:
| Multiple textured emblems can be specified. Each is itself a scripting object with the following valid keywords:
| ---
| ---
|-
|-
| colspan="2" | <code>texture</code>
| colspan="2" | <code>texture</code>
| 徽章文件的路径(通常位于{{path|gfx/coat_of_arms/textured_emblems/}} 中)。
| The path to the file for the emblem (usually located in {{path|gfx/coat_of_arms/textured_emblems/}}).
| <pre>texture = "te_griffin_01.dds"</pre>
| <pre>texture = "te_griffin_01.dds"</pre>
|-
|-
| colspan="2" | <code>mask</code>
| colspan="2" | <code>mask</code>
| 徽章的背景图案可用作徽标的剪贴蒙版。
| The coat of arms' background pattern can be used as a clipping mask for emblems.
| <pre>mask = { 1 3 }</pre>
| <pre>mask = { 1 3 }</pre>
|-
|-
| rowspan="4" | <code>instance</code>
| rowspan="4" | <code>instance</code>
| <code>scale</code>
| <code>scale</code>
| 作为一个二维浮点数,具有默认值 { 1.0, 1.0 }
| Given as a 2-dim float, has default value { 1.0 1.0 }
| rowspan="4" | <pre>instance = { 
| rowspan="4" | <pre>instance = { 
scale = { 0.5 0.5 }  
scale = { 0.5 0.5 }  
第71行: 第69行:
|-
|-
| <code>position</code>
| <code>position</code>
| 给定一个二维浮点数,具有默认值 { 0.0, 0.0 }
| Given as a 2-dim float, has default value { 0.0 0.0 }
|-
|-
| <code>rotation</code>
| <code>rotation</code>
| 给定为浮点数值,具有默认值0.0
| Given as float value, has default value 0.0
|-
|-
| <code>depth</code>
| <code>depth</code>
| 用于指定渲染顺序的值,以浮点数表示,默认为0.0
| Used to order rendering, given as float value with default of 0.0


|-
|-
| rowspan="6" | <code>colored_emblem</code>
| rowspan="6" | <code>colored_emblem</code>
| colspan="2" | ---
| colspan="2" | ---
| 可以指定多个彩色标记。每个标记本身是一个带有以下关键字的脚本对象:
| Multiple colored emblems can be specified. Each is itself a scripting object with the following keywords:
| ---
| ---
|-
|-
| colspan="2" | <code>texture</code>
| colspan="2" | <code>texture</code>
| 徽章文件的路径(通常位于{{path|gfx/coat_of_arms/colored_emblems/}} )。
| The path to the file for the emblem (usually located in {{path|gfx/coat_of_arms/colored_emblems/}}).
| <pre>texture = "ce_crown.tga"</pre>
| <pre>texture = "ce_crown.tga"</pre>
|-
|-
| colspan="2" | "
| colspan="2" | "
| 所有来自 <code>textured_emblem</code> 的字段都是有效的。
| All fields from textured_emblem are valid
| ---
| ---
|-
|-
| colspan="2" | <code>color1</code>
| colspan="2" | <code>color1</code>
| 定义了徽章的基本颜色
| defines the base colour of the emblem
| rowspan="3" | <pre>color1 = color2
| rowspan="3" | <pre>color1 = color2
color2 = "white"
color2 = "white"
第100行: 第98行:
|-
|-
| colspan="2" | <code>color2</code>
| colspan="2" | <code>color2</code>
| 定义了徽标的辅助颜色(纹理中的绿色通道)
| defines the secondary color of the emblem (the Green channel in the texture)
|-
|-
| colspan="2" | <code>color3</code>
| colspan="2" | <code>color3</code>
| 目前不可用,将默认为白色。
| currently unavailable, will default to white


|-
|-
| rowspan="4" | <code>sub</code>
| rowspan="4" | <code>sub</code>
| colspan="2" | ---
| colspan="2" | ---
| 可以指定多个子对象,每个子对象本身都是一个完整的家族纹章脚本对象,允许设置除另一个子对象以外的所有字段,即不支持嵌套子对象。
| Multiple subs can be specified, each is itself a complete coat of arms scripting object, allowing all fields except another sub, i.e. no sub nesting.
| ---
| ---
|-
|-
| rowspan="3" | <code>instance</code>
| rowspan="3" | <code>instance</code>
| <code>scale</code>
| <code>scale</code>
| 作为一个二维浮点数,具有默认值 { 1.0, 1.0 }
| Given as a 2-dim float, has default value { 1.0 1.0 }
| ---
| ---
|-
|-
| <code>offset</code>
| <code>offset</code>
| 给定一个二维浮点数,具有默认值 { 0.0, 0.0 }
| Given as a 2-dim float, has default value { 0.0 0.0 }
| ---
| ---
|-
|-
| <code>depth</code>
| <code>depth</code>
| 用于指定渲染顺序的值,以浮点数表示,默认为0.0
| Used to order rendering, given as float value with default of 0.0
| ---
| ---
|}
|}
第166行: 第164行:
[[File:Emblem examples.png]]
[[File:Emblem examples.png]]


== 继承和子类 ==
== Inheritance and subs ==
这一部分主要关注继承问题,但为了促进讨论,首先谈论一下子类的两个要点:


第一个" 基本家族纹章" 是一个隐含的子类:
This section is largely dedicated towards inheritance, but to facilitate that discussion, first two points on subs:
 
The first "base coat of arms" is an implicit sub:
<pre>
<pre>
a = {
a = {
第186行: 第185行:
</pre>
</pre>


每个实例字段(家族纹章实例,而不是徽标实例)都被转化为一个独立的子级:
Each instance field (coat of arms instances, not emblem instances) is transformed into a separate sub:
<pre>
<pre>
a = {
a = {
第219行: 第218行:
</pre>
</pre>


说了这些,让我们深入探讨继承。
With that out of the way, let's dive into inheritance.


'''继承'''是通过父关键字实现的。它基本上表示“取出给定的家族纹章作为值,并用它来填充任何未明确设置的字段”。
Inheritance is achieved through the parent keyword. It basically says "Fetch the coat of arms given as value, and use it to populate any fields not explicitly set".


 举例:
 举例:
第245行: 第244行:
</pre>
</pre>


当谈到徽章时,继承是" 全有或全无" 的:如果至少指定一个徽章(任何类型),则不继承任何徽章,但如果没有指定徽章,则继承所有父级的徽章。
When it comes to emblems the inheritance is "all or nothing": if at least one emblem (of any type) is specified, no emblems are inherited, but if no emblem is specified, all the parent's emblems are inherited.


一旦涉及到子级,继承规则会稍微复杂一些。有两个指导规则:
The inheritance rules become slightly more complicated once subs are involved. The two guiding rules are:


当指定了一个父级时,所有值都从其第一个子级(通常是" 隐式" 子级)获取。
When a parent is specified, all values are fetched from its first sub (which many times will be an "implicit" sub).
 
If a sub doesn't specify a parent it will piggyback on the parent of its first sub. However, in this case all values will be fetched from the corresponding sub in the parent. Setting parent = "none" disables this automatic inheritance.
如果一个子级没有指定父级,它将依附于其第一个子级的父级。然而,在这种情况下,所有值将从父级中相应的子级获取。设置父级为"none" 将禁用此自动继承。
Example:
 
示例:
<pre>
<pre>
daddy = {
daddy = {
第274行: 第271行:
</pre>
</pre>


继承链(" 深度继承" )是以自下而上的方式解决的。必须小心,不要创建继承循环。
Inheritance chains ("deep inheritance") is resolved in a bottom up manner. Users must take care not to create inheritance loops.


<pre>
<pre>
第302行: 第299行:
</pre>
</pre>


最后,一个真实的例子:
And finally, a real example:
<pre>
<pre>
k_england_and_france = {
k_england_and_france = {
第317行: 第314行:
}
}
</pre>
</pre>
== 轻松使用游戏内设计器 ==
与皇家宫廷DLC一同,P社还开发了一款便捷的内置编辑器,可用于直接将创建的盾徽导出为有效的脚本代码。您只需使用设计器创建所需的盾徽,然后按下“复制到剪贴板”即可。游戏将在使用的计算机的临时存储器中创建完整且有效的盾徽所需代码。
然后,您可以使用CTRL+V键组合直接将其插入到相应的修改文件的文本中。您只需确保设置正确的名称(例如k_england)。
修改者还可以在此处使用一个小技巧,暂时删除本地化文件;这样,CK无法加载标题的名称,而是在游戏中显示标题对应的关键字。
玩家也可以通过盾徽设计师更改标题名称,或者在这种情况下,简单地复制关键字并将其粘贴到适当的文件中。通过这种方式,您可以避免后续可能导致盾徽未在游戏中显示的拼写错误。
在这一点上需要再次强调,由于动态盾徽,可能会存在多个盾徽,因此它们的名称可能不直接与标题密钥匹配。因此,CK解释器无法识别拼写错误,也不会发出错误消息。如果自制的盾徽未显示出来,应当再次明确检查其正确的字符精确拼写。
===进阶盾徽设计器===
默认情况下,CoA Designer仅显示原始游戏的徽章。然而,扩展列表非常简单。要做到这一点,只需将更多的dds文件添加到<code><mod_root>\gfx\coat_of_arms\colored_emblems\</code>文件夹中 - 如本页已描述。此外,您现在可以在同一位置创建一个文本文件(一如既往地采用UTF-8 BOM编码)。在文本文件中,您可以为每个您想在设计师中提供的徽章创建一个单独的行,使用以下语法:
<pre>
<pic_name>.dds = { colors = <1,2,3> category = <string> }
</pre>
图像的名称必须与同一文件夹中的图像文件完全匹配。
您可以将<1、2或3>指定为颜色选项。这指定了用户可以为所选纹章设置多少种颜色。对此,.dds 图像文件起决定性作用。
游戏会自动将
#颜色值 0x000084(蓝色)识别为颜色
#颜色值 0x00FF94(浅绿色)识别为颜色
#颜色值 0xFF0084(品红色)识别为颜色
#CK 具有一定的容差,并试图将其他不同的颜色匹配到这些颜色值之一。
然而,这种校正并不完美,不能完全依赖;制作模组的人应始终确保使用正确的颜色。如果您在相应的文件中设置的值大于实际使用的颜色数,用户将获得一个更多的颜色显示,但不会出错。然而,如果制作模组的人在文本文件中指定的颜色数过少,自动校正将尝试将太多的颜色减少到一种颜色(如果它们足够相似),或者简单地将未知颜色设置为红褐色调,这不能由设计人员用户更改。
游戏原本支持以下类别之一:动物、圆圈和螺旋、十字和纽结、信仰、人造、自然、图案、部落印章、文字和图形。如果使用其他字符串,游戏将为用户添加一个新的可选择类别。由于类别名称显示为文本,因此还应为新类别添加一个本地化条目(<code>COA_DESIGNER_CATEGORY_<your_category_string_here>:0 "<您想要在所选语言中显示的类别名称>"</code>)。
===设计器的缺点===
与手动编码一个纹章对应盾徽相比,设计器可能在直观上更容易使用,但设计师无法用于继承或细分纹章。如上所示的真实示例,将英国和法国的纹章放在一起,实际上无法使用设计器创建。甚至包含卡斯蒂利亚、莱昂、阿拉贡、纳瓦拉和西西里的欧陆风云4(EU4)中的西班牙国旗也无法使用设计师重新创建。然而,设计器中的一个可以帮助创建基础纹章,所以之后您只需要手动编写继承关系。
==动态盾徽==
除了为任何给定的头衔分配的正常纹章外,您还可以创建动态纹章定义,这些定义存储在 {{path|\common\coat_of_arms\dynamic_definitions\}} 中:
<pre>
# Name must match a landed title definition
title_name = {
item = { # One or more items
trigger = { # 触发条件,当应该选择此项时,选择第一个有效项, root = the title
<trigger> # 这可以是任何预定义的触发器,或者像正常情况下那样内联定义的触发器。
}
coat_of_arms = name # 作为纹章文件中定义的纹章名称使用
}
}
</pre>
为了更新纹章,您需要在头衔范围内调用<code>update_dynamic_coa = yes</code>。
在所有拥有的头衔中,这已经在<code>on_character_culture_change</code>和<code>on_character_faith_change</code>中被调用,但是如果您希望在其他任何情况下更新动态纹章,您需要根据[[事件模组制作#触发动作 (on_action)|on_actions]]。


{{Modding navbox}}
{{Modding navbox}}
[[Category:模组制作]]
[[Category:模组制作]]
[[en:Coat of arms modding]]
[[en:Coat of arms modding]]
请注意您对十字军之王3百科的所有贡献都被认为是在知识共享署名-非商业性使用-相同方式共享下发布,请查看在十字军之王3百科:版权的细节。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源。 未经许可,请勿提交受版权保护的作品!

为防止机器编辑,请完成下方验证

取消 编辑帮助(在新窗口中打开)