Cosmetic tag modding:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.7
无编辑摘要
无编辑摘要
第4行: 第4行:
 制作一个装饰性tag要比制作一个完备的国家tag要简单得多 
 制作一个装饰性tag要比制作一个完备的国家tag要简单得多 


Whereas a complete country requires the chosen tag to be declared in the vanilla file in {{path|common/country_tags}}, a cosmetic tag is completely dynamic in this sense and scripting the tag is not required. The tag is also not required to be of 3 characters, but spaces should not be used in the tag as the game will not recognize it as one tag (the tag is not what you see in-game though once you add in localisation).
装饰性tag的用处:改变国名、地图颜色,也可以将装饰性tag将意识形态绑定,增加代入感和完善程度


 不会 英文也能 的教程: 打开 :/common/countries 中的cosmetic.txt 文件 (没有 自建一个)
  完整的国家tag需要在/Hearts of Iron IV/common/country_tags中使得countries中的文件被识别,而装饰性tag在这个意义上是完全动态的,不需要编写tag脚本。tag也不要求是3个字符,但tag中不应该使用空格,因为游戏'''<big> 不会</big>'''将其识别为<big>'''一个'''</big>tag(一旦您添加了本地化,代码里的tag就不是您在游戏中 到的tag)。
 
===== 添加一个装饰性tag 的教 程流 程: =====
1在common\countries\cosmetic.txt (没有自建一个) 中编写装饰性tag-地图颜色
 
2本地化
 
3加入游戏


== 装饰性tag-旗帜 ==
== 装饰性tag-旗帜 ==


Flags are added in for cosmetic countries the same way as one would for regular countries:
为装饰性tag添加旗帜的方式与为常规国家添加旗帜的方式相同: 需要添加三种旗帜:
*大的(82x52) in {{path|gfx/flags}}
*中的 (41x26) in {{path|gfx/flags/medium}}
*小的 (10x7) in {{path|gfx/flags/small}}


Three flags need to be added:
命名原则:
*A large one (82x52 pixel) in {{path|gfx/flags}}
*A medium one (41x26 pixel) in {{path|gfx/flags/medium}}
*A small one (10x7 pixel) in {{path|gfx/flags/small}}
 
All three should be in [[wikipedia:Truevision TGA|TGA-file]] format and named as follows:
  <your dynamic tag>_<ideology>.tga
  <your dynamic tag>_<ideology>.tga
So for instance:
就像这样
  GCA_democratic.tga
  GCA_democratic.tga
It is recommended that add in flags for all 4 ideologies (_neutrality, _communism, _democratic and _fascism) are added in, as it is not possible to use only your cosmetic tag as a fallback; the flag would not change. It is possible however to use the same flags for different ideologies, as long as all 4 flags are there.
建议添加所有4种意识形态的旗帜( 中立,共产主义,民主和法西斯主义) ,因为你不可能一个国家只有一个意识形态;旗帜不会改变。然而,对于不同的意识形态使用相同的标志是可能的,反过来也行,只要所有4个tag都有


== 装饰性tag-地图颜色 ==
== 装饰性tag-地图颜色 ==


The color of a cosmetic tag can be changed by adding an entry to the game's common\countries\cosmetic.txt file:
可以通过在游戏的common\countries\cosmetic.txt 文件中添加一个条目来更改cosmetic标签的颜色:
  <your cosmetic tag> = {
  <your cosmetic tag> = {
   color = rgb { 201 56 93 }
   color = rgb { 201 56 93 }
第46行: 第51行:
  GCA_democratic_DEF:0 "Gran Colombia" #Gran Colombia doesn't need 'the'
  GCA_democratic_DEF:0 "Gran Colombia" #Gran Colombia doesn't need 'the'


=== By using your own file ===
=== 装饰性tag-文本本地化_3 ===
For compatibility-purposes, it may be wise to add in your own file.
出于兼容性的考虑,添加您自己的文件可能是个好的选择。↵It不在乎您的本地化文件选择什么名称,但它必须以“_l_<language >.yml ' 结尾,其中< language > 是您的本地化语言。至少得个有英语本地化,因为当使用不支持的语言时,游戏将默认为英语,而不是根据你选取的本地化。
It does not matter what name for your localisation file is chosen, but it has to end in '_l_<language>.yml', with <language> being the language your localisation is in. It is important to have at least english as the game will then default to that instead of the keys used by the game data when an unsupported language is used.


Once inside the file, it should be set up as follows:
就像这样:
  l_<language>: #Should be the same as your file name's l_<language>
  l_<language>: #Should be the same as your file name's l_<language>
   <your dynamic tag>_<ideology>:0 "<your desired name>"
   <your dynamic tag>_<ideology>:0 "<your desired name>"


From here on one can follow the vanilla file guide.
我们现在可以照着上面编写了


== Adding the cosmetic tag into the game ==
== 装饰性tag-加入游戏 ==
There are four ways to implement your cosmetic tag into the game:
游戏中添加装饰性tag的四种方法
*By events
* 事件
*Through national focuses
* 国策
*By adding it to a country's history file
* 国家历史文件
*By decisions
* 决议


=== 通过事件实现装饰性tag修改 ===
=== 通过事件实现装饰性tag修改 ===
第67行: 第71行:
 能被如下命令触发:
 能被如下命令触发:
  set_cosmetic_tag = <your cosmetic tag>
  set_cosmetic_tag = <your cosmetic tag>
Using this command as an effect in your event is sufficient to see results in-game. It is possible to create new leaders or portraits here for your new country as well.
 在你的事件中使用这个命令作为效果足以在游戏中看到结果。你也可以在这里为你的新国家创造新的领袖或肖像。你可以通过锁定非玩家国家的标签来改变其装饰性标签,如下所示:
You can alter the cosmetic tag of a non-player country by targeting its TAG, as follows:
 
  机翻: 在你的事件中使用这个命令作为效果足以在游戏中看到结果。你也可以在这里为你的新国家创造新的领袖或肖像。你可以通过锁定非玩家国家的标签来改变其装饰性标签,如下所示:
  TAG = { set_cosmetic_tag = <your cosmetic tag> }
  TAG = { set_cosmetic_tag = <your cosmetic tag> }


第79行: 第80行:


=== 通过历史文件实现装饰性tag修改 ===
=== 通过历史文件实现装饰性tag修改 ===
The easiest way to do this is by simply adding the command anywhere outside any scope inside a country's history file in {{path|history/countries/}}.
最简单的方法是在/Hearts of Iron IV/history/countries/ 中的一个国家的历史文件中的任何范围之外的任何地方添加'''<big>该命令</big>'''。也可以限定执行装饰性tag命令的日期,以便将标签限制在某些剧本上。
It is also possible to declare a date at which point the cosmetic tag is implemented, in order to restrict the tag to certain bookmarks.


=== Implementing a cosmetic tag through decision ===
=== 用决议实现装饰性tag ===
To implement cosmetic tags via decision, just add the set_cosmetic_tag command within the decision's effects.
要通过decision实现装饰性tag,只需在decision的效果中添加set_cosmetic_tag命令
   
   
{{Modding navbox}}
{{Modding navbox}}
[[Category:Modding]]
[[Category:Modding]]

2022年5月20日 (五) 01:07的版本

装饰性 tag

制作一个装饰性tag要比制作一个完备的国家tag要简单得多

装饰性tag的用处:改变国名、地图颜色,也可以将装饰性tag将意识形态绑定,增加代入感和完善程度

完整的国家tag需要在/Hearts of Iron IV/common/country_tags中使得countries中的文件被识别,而装饰性tag在这个意义上是完全动态的,不需要编写tag脚本。tag也不要求是3个字符,但tag中不应该使用空格,因为游戏不会将其识别为一个tag(一旦您添加了本地化,代码里的tag就不是您在游戏中看到的tag)。

添加一个装饰性tag的教程流程:

1在common\countries\cosmetic.txt (没有自建一个)中编写装饰性tag-地图颜色

2本地化

3加入游戏

装饰性tag-旗帜

为装饰性tag添加旗帜的方式与为常规国家添加旗帜的方式相同: 需要添加三种旗帜:

  • 大的(82x52) in /Hearts of Iron IV/gfx/flags
  • 中的 (41x26) in /Hearts of Iron IV/gfx/flags/medium
  • 小的 (10x7) in /Hearts of Iron IV/gfx/flags/small

命名原则:

<your dynamic tag>_<ideology>.tga

就像这样

GCA_democratic.tga

建议添加所有4种意识形态的旗帜(中立,共产主义,民主和法西斯主义),因为你不可能一个国家只有一个意识形态;旗帜不会改变。然而,对于不同的意识形态使用相同的标志是可能的,反过来也行,只要所有4个tag都有

装饰性tag-地图颜色

可以通过在游戏的common\countries\cosmetic.txt文件中添加一个条目来更改cosmetic标签的颜色:

<your cosmetic tag> = {
 color = rgb { 201 56 93 }
 color_ui = rgb { 255 73 121 }
}

装饰性tag-文本本地化_1

为了使你的装饰性tag的国名也发生改变 你要向自由奔去 作如下修改, 去 /Hearts of Iron IV/localisation/. 建议用或其他的什么编程软件 Notepad++

装饰性tag-文本本地化_2

如果只按普通的本地化方法/Hearts of Iron IV/localisation/countries_cosmetic_l_<language>.yml, 那么很简单,只需要"入乡随俗"

<your cosmetic tag>_<ideology>:0 "<your desired name>"
<your cosmetic tag>_<ideology>_ADJ:0 "<your desired name's adjective>"
<your cosmetic tag>_<ideology>_DEF:0 "<your desired name as used in events>" #'the United States of America' instead of 'United States of America'

For instance:

GCA_democratic:0 "Gran Colombia"
GCA_democratic_ADJ:0 "Gran Colombian"
GCA_democratic_DEF:0 "Gran Colombia" #Gran Colombia doesn't need 'the'

装饰性tag-文本本地化_3

出于兼容性的考虑,添加您自己的文件可能是个好的选择。↵It不在乎您的本地化文件选择什么名称,但它必须以“_l_<language >.yml '结尾,其中< language >是您的本地化语言。至少得个有英语本地化,因为当使用不支持的语言时,游戏将默认为英语,而不是根据你选取的本地化。

就像这样:

l_<language>: #Should be the same as your file name's l_<language>
 <your dynamic tag>_<ideology>:0 "<your desired name>"

我们现在可以照着上面编写了

装饰性tag-加入游戏

游戏中添加装饰性tag的四种方法

  • 事件
  • 国策
  • 国家历史文件
  • 决议

通过事件实现装饰性tag修改

主条目:Event Modding

能被如下命令触发:

set_cosmetic_tag = <your cosmetic tag>

在你的事件中使用这个命令作为效果足以在游戏中看到结果。你也可以在这里为你的新国家创造新的领袖或肖像。你可以通过锁定非玩家国家的标签来改变其装饰性标签,如下所示:

TAG = { set_cosmetic_tag = <your cosmetic tag> }

用国策实现装饰性tag修改

和事件一样,只需将上面的命令添加到完成国策的效果里就可以了

国策树可以在 /Hearts of Iron IV/common/national_focus 找到

通过历史文件实现装饰性tag修改

最简单的方法是在/Hearts of Iron IV/history/countries/中的一个国家的历史文件中的任何范围之外的任何地方添加该命令。也可以限定执行装饰性tag命令的日期,以便将标签限制在某些剧本上。

用决议实现装饰性tag

要通过decision实现装饰性tag,只需在decision的效果中添加set_cosmetic_tag命令