Cosmetic tag modding:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.7
(merge from offical wiki)
 
无编辑摘要
第1行: 第1行:
{{version|1.7}}
{{version|1.7}}
== Cosmetic tag ==
== 装饰性 tag ==


Creating cosmetic tags is much easier than creating a complete country.
制作一个装饰性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).
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).


== Flag ==
不会英文也能看懂的教程:打开 :/common/countries 中的cosmetic.txt 文件 (没有就自建一个)
 
== 装饰性tag-旗帜 ==


Flags are added in for cosmetic countries the same way as one would for regular countries:
Flags are added in for cosmetic countries the same way as one would for regular countries:
第21行: 第23行:
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.
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.


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


The color of a cosmetic tag can be changed by adding an entry to the game's common\countries\cosmetic.txt file:
The color of a cosmetic tag can be changed by adding an entry to the game's common\countries\cosmetic.txt file:
第29行: 第31行:
  }
  }


== Localisation ==
== 装饰性tag-文本本地化_1 ==


In order to change the name of your country when your scripted cosmetic tag becomes in use, one should add in localisation.
为了使你的装饰性tag的国名也发生改变
To do so, go to {{path|localisation/}}. It is recommended to use a hex-editor such as [https://notepad-plus-plus.org/ Notepad++]
你要<s><small>向自由奔去</small></s> <small>作如下修改</small>, {{path|localisation/}}. 建议用或其他的什么编程软件 [https://notepad-plus-plus.org/ Notepad++]


=== By using vanilla files ===
=== 装饰性tag-文本本地化_2 ===
If one uses the vanilla file {{path|localisation/countries_cosmetic_l_<language>.yml}}, the process is fairly straightforward; one should simply add their localisation the same way the others are set up:
如果只按普通的本地化方法{{path|localisation/countries_cosmetic_l_<language>.yml}}, 那么很简单,只需要"入乡随俗"
  <your cosmetic tag>_<ideology>:0 "<your desired name>"
  <your cosmetic tag>_<ideology>:0 "<your desired name>"
  <your cosmetic tag>_<ideology>_ADJ:0 "<your desired name's adjective>"
  <your cosmetic tag>_<ideology>_ADJ:0 "<your desired name's adjective>"
第61行: 第63行:
*By decisions
*By decisions


=== Implementing a cosmetic tag through event ===
=== 通过事件实现装饰性tag修改 ===
{{main|Event Modding}}
{{main|Event Modding}}
The dynamic tag is enabled by the following command:
能被如下命令触发:
  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.
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:
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> }


=== Implementing a cosmetic tag through national focus ===
=== 用国策实现装饰性tag修改 ===
Implementing a cosmetic tag is very similar to implementing the tag through event; the only difference is that the command has to be added to the completion reward rather than the effect of the event.
和事件一样,只需将上面的命令添加到完成国策的效果里就可以了


The focus-trees can be found in {{path|common/national_focus}}
国策树可以在 {{path|common/national_focus}} 找到


=== Implementing a cosmetic tag through history ===
=== 通过历史文件实现装饰性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/}}.
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/}}.
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.
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.

2022年5月20日 (五) 00:38的版本

装饰性 tag

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

Whereas a complete country requires the chosen tag to be declared in the vanilla file in /Hearts of Iron IV/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).

不会英文也能看懂的教程:打开 :/common/countries 中的cosmetic.txt 文件 (没有就自建一个)

装饰性tag-旗帜

Flags are added in for cosmetic countries the same way as one would for regular countries:

Three flags need to be added:

  • A large one (82x52 pixel) in /Hearts of Iron IV/gfx/flags
  • A medium one (41x26 pixel) in /Hearts of Iron IV/gfx/flags/medium
  • A small one (10x7 pixel) in /Hearts of Iron IV/gfx/flags/small

All three should be in TGA-file format and named as follows:

<your dynamic tag>_<ideology>.tga

So for instance:

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.

装饰性tag-地图颜色

The color of a cosmetic tag can be changed by adding an entry to the game's common\countries\cosmetic.txt file:

<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'

By using your own file

For compatibility-purposes, it may be wise to add in your own file. 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>
 <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

There are four ways to implement your cosmetic tag into the game:

  • By events
  • Through national focuses
  • By adding it to a country's history file
  • By decisions

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

主条目:Event Modding

能被如下命令触发:

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修改

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

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

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

The easiest way to do this is by simply adding the command anywhere outside any scope inside a country's history file in /Hearts of Iron IV/history/countries/. 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

To implement cosmetic tags via decision, just add the set_cosmetic_tag command within the decision's effects.