Cosmetic tag modding

本页面所适用的版本可能已经过时,最后更新于1.7
Hstar讨论 | 贡献2020年8月15日 (六) 16:45的版本 (merge from offical wiki)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

Cosmetic tag

Creating cosmetic tags is much easier than creating a complete country.

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).

Flag

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.

Map color

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

Localisation

In order to change the name of your country when your scripted cosmetic tag becomes in use, one should add in localisation. To do so, go to /Hearts of Iron IV/localisation/. It is recommended to use a hex-editor such as Notepad++

By using vanilla files

If one uses the vanilla file /Hearts of Iron IV/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:

<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

Implementing a cosmetic tag through event

主条目:Event Modding

The dynamic tag is enabled by the following command:

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

Implementing a cosmetic tag through national focus

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 /Hearts of Iron IV/common/national_focus

Implementing a cosmetic tag through history

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.