创建国家:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.8
(merge from offical wiki)
 
无编辑摘要
第1行: 第1行:
{{Version|1.8}}
{{Version|1.8}}
The Guide below presumes that you understand the basics of how to [[Mod_structure|create a mod]]. This page should also help modders understand how to change some more specific aspects of a country.
这个页面假设你掌握了[[Mod_structure| 创建一个模组]] 的基本知识。该页面主要聚焦于帮助模组作者更好地理解如何在某些特定方面编辑一个国家。


== Quick check-list ==
== 快速检查单 ==
{{SVersion|1.8}}
{{SVersion|1.8}}
*Define a unique 3-character country tag
如果你想在模组中创建一个新国家,可以参考以下快速检查单:
*Create a file in ''<yourmod>/common/countries''
* 定义一个独特的三字符国家tag。
*Create a file in ''<yourmod>/history/countries''
* ''<yourmod>/common/countries'' 中新建文件。
*Add localisation to ''<yourmod>/localisations''
* ''<yourmod>/history/countries'' 中新建文件。
*Add a large, medium and small flag for each ideology to ''<yourmod>/gfx/flags''
* ''<yourmod>/localisations'' 中增加本地化。
*Optional: Create an OOB file in ''<yourmod>/history/units''
* ''<yourmod>/gfx/flags'' 中为每一种意识形态添加一个大,中,小号的旗帜。
*Optional: Add the country to the game
* 可选:在''<yourmod>/history/units'' 中创建OOB文件。
* 可选:把国家加入到游戏中。


== Country tag ==
== 国家tag ==
{{SVersion|Timeless}}
{{SVersion|Timeless}}
Countries need a 3-character country tag. This is how a country is referred to in all of the game's script. All country tags must be unique. A country must not share a tag with any other country.
Countries need a 3-character country tag. This is how a country is referred to in all of the game's script. All country tags must be unique. A country must not share a tag with any other country.
第22行: 第23行:
is address of the country file that will be created/edited, located in ''<yourmod>/common/countries''
is address of the country file that will be created/edited, located in ''<yourmod>/common/countries''


== Country file ==
== 国家文件 ==
{{SVersion|1.8}}
{{SVersion|1.8}}


Create a new file in the ''<yourmod>/common/countries'' folder. It is recommended one copies the file of a very similar country, then rename and edit it.
Create a new file in the ''<yourmod>/common/countries'' folder. It is recommended one copies the file of a very similar country, then rename and edit it.


=== Graphical culture ===
=== 文化 ===


Defines the set of graphics used for units. For Scotland this would be:
Defines the set of graphics used for units. For Scotland this would be:
第34行: 第35行:
  graphical_culture_2d = commonwealth_2d
  graphical_culture_2d = commonwealth_2d


=== Color ===
=== 颜色 ===


This is the country's colour on the political map mode. It uses the [[Wikipedia:RGB color model|RGB color scale]].
This is the country's colour on the political map mode. It uses the [[Wikipedia:RGB color model|RGB color scale]].
第51行: 第52行:
`color_ui` usually is a more intense version of the normal color. It is used to render the borders of the country (If borders look ugly, make sure you have done this right). Colors may also be specified in [[Wikipedia:HSL and HSV|HSV format]].
`color_ui` usually is a more intense version of the normal color. It is used to render the borders of the country (If borders look ugly, make sure you have done this right). Colors may also be specified in [[Wikipedia:HSL and HSV|HSV format]].


==Country history==
== 国家历史==
{{SVersion|1.8}}
{{SVersion|1.8}}


Create a file in the <yourmod>/history/countries folder. Alternatively, copy, rename, and edit a similar file. The file name should be <country tag - country name>, e.g. "SCO - Scotland". This file contains information about the history and various other default attributes of the country.
Create a file in the <yourmod>/history/countries folder. Alternatively, copy, rename, and edit a similar file. The file name should be <country tag - country name>, e.g. "SCO - Scotland". This file contains information about the history and various other default attributes of the country.


===Capital city===
=== 首都===
Defines the capital city. Use the State ID of the state that contains the capital, not the province ID. In this case, 121 is Lothrian State, which contains Edinburgh.
Defines the capital city. Use the State ID of the state that contains the capital, not the province ID. In this case, 121 is Lothrian State, which contains Edinburgh.
  capital = 121
  capital = 121


===Order of battle===
=== 战斗顺序===
This line will link to the 'Order of Battle' (OoB) file which will define the amount and location of units, their experience and equipment level, and also Air Wings the country has at the start. Starting production and unit templates are also defined there. All countries need an OoB link, but if the country is to be released one doesn't need to add one later on.
This line will link to the 'Order of Battle' (OoB) file which will define the amount and location of units, their experience and equipment level, and also Air Wings the country has at the start. Starting production and unit templates are also defined there. All countries need an OoB link, but if the country is to be released one doesn't need to add one later on.
  oob = "SCO_1936"
  oob = "SCO_1936"
第73行: 第74行:
}
}
</pre>
</pre>
===Research slots===
=== 科研槽===
Defines the amount of research slots a country has access to at the start. Normally, major powers have 4 slots, minor countries in North America and Europe have 3 and minor countries in the rest of the world have 2. Defaults to 2 slots, if not specified.
Defines the amount of research slots a country has access to at the start. Normally, major powers have 4 slots, minor countries in North America and Europe have 3 and minor countries in the rest of the world have 2. Defaults to 2 slots, if not specified.
  set_research_slots = 3
  set_research_slots = 3


===Stability===
=== 稳定度===
Defines the stability percentage that a country will have at the start of the game. The number that is put here will be multiplied by 100 when applied to the country, so the max is 1 (100) and the minimum is 0 (0).
Defines the stability percentage that a country will have at the start of the game. The number that is put here will be multiplied by 100 when applied to the country, so the max is 1 (100) and the minimum is 0 (0).
  set_stability = 0.7
  set_stability = 0.7


===War support===
=== 战争支持度===
Defines the war support percentage that a country will have at the start of the game. Like stability, the number will be multiplied by 100 when applied to the country, with the max being 1 (100) and minimum being 0 (0).
Defines the war support percentage that a country will have at the start of the game. Like stability, the number will be multiplied by 100 when applied to the country, with the max being 1 (100) and minimum being 0 (0).
  set_war_support = 0.5
  set_war_support = 0.5


===Ideas===
=== 民族精神和内阁===
Sets Ideas country starts with (National Spirits, as well as advisors, companies & laws). A list of ideas can be found in {{path|common/ideas}}<br>
Sets Ideas country starts with (National Spirits, as well as advisors, companies & laws). A list of ideas can be found in {{path|common/ideas}}<br>


第99行: 第100行:
}
}
</pre>
</pre>
===Technology===
=== 科技===
Here the technology a country has from the start is declared. A list of technologies can be found in {{path|common/technologies}}.
Here the technology a country has from the start is declared. A list of technologies can be found in {{path|common/technologies}}.
<pre>
<pre>
第147行: 第148行:
}
}
</pre>
</pre>
===Miscellaneous (optional)===
=== 其他(可选)===
Add starting political power:
Add starting political power:
<pre>
<pre>
第189行: 第190行:
</pre>
</pre>
Modifiers have their effects defined in {{path|common/opinion_modifiers}}
Modifiers have their effects defined in {{path|common/opinion_modifiers}}
===Diplomacy===
=== 外交===
If the new country has any diplomatic relations, these can be declared here. It is recommended that one adds relations only in one file (not in both the faction leader's file and the minor ally's for instance).
If the new country has any diplomatic relations, these can be declared here. It is recommended that one adds relations only in one file (not in both the faction leader's file and the minor ally's for instance).


====Factions====
==== 阵营====
Factions are defined by adding the following line:
Factions are defined by adding the following line:
  create_faction = Clanintern
  create_faction = Clanintern
第200行: 第201行:
Puppets of members should always be added to the faction as well, to prevent bugs.
Puppets of members should always be added to the faction as well, to prevent bugs.


====Puppets====
==== 傀儡国====
Puppets are defined as follows if the player has the 'Together for Victory' Expansion:
Puppets are defined as follows if the player has the 'Together for Victory' Expansion:
  set_autonomy = {
  set_autonomy = {
第222行: 第223行:
  }
  }
If the player has 'Together for Victory', Great Britain will be an integrated puppet, if not, they will be a regular (the only type of) puppet.
If the player has 'Together for Victory', Great Britain will be an integrated puppet, if not, they will be a regular (the only type of) puppet.
====Other diplomatic actions====
==== 其他外交行动====
'''Guarantee Independence:'''<br>
'''Guarantee Independence:'''<br>
The country this file belongs to will guarantee the following TAG
The country this file belongs to will guarantee the following TAG
第245行: 第246行:
give_military_access = IRE
give_military_access = IRE
</pre>
</pre>
====Tech sharing====
==== 科技共享====
If the player has 'Together for Victory' one can add the country to a tech sharing group:
If the player has 'Together for Victory' one can add the country to a tech sharing group:
  add_to_tech_sharing_group = haggis_investigators
  add_to_tech_sharing_group = haggis_investigators
An if-statement as shown above will be required to limit it to 'Together for Victory' owners and to prevent bugs with those that don't own it.
An if-statement as shown above will be required to limit it to 'Together for Victory' owners and to prevent bugs with those that don't own it.


===Set popularities===
=== 设定党派支持度===
Defines the popularity of different parties in the country:
Defines the popularity of different parties in the country:
<pre>
<pre>
第260行: 第261行:
}
}
</pre>
</pre>
===Set politics===
=== 设定政治===
Defines the ruling party and how elections work in a country:
Defines the ruling party and how elections work in a country:
<pre>
<pre>
第272行: 第273行:
Note: Frequency is in months
Note: Frequency is in months


===Country leaders===
=== 国家领导人===
Defines the leaders a country has. In theory adding a leader for only the starting ideology would be enough, as the other ones will be randomly generated, it is possible however, to define the leaders of all parties.
Defines the leaders a country has. In theory adding a leader for only the starting ideology would be enough, as the other ones will be randomly generated, it is possible however, to define the leaders of all parties.
  create_country_leader = {
  create_country_leader = {
第288行: 第289行:
A list of traits can be found in {{path|common/country_leader}}. It is possible to add more there as well.
A list of traits can be found in {{path|common/country_leader}}. It is possible to add more there as well.


===Military leaders===
=== 将军===
Custom army leaders may be defined here:
Custom army leaders may be defined here:
<pre>
<pre>
第313行: 第314行:
}
}
</pre>
</pre>
===Variants (optional)===
=== 变种型号(可选)===
Special variants on equipment available for this country from the start can be defined as well:
Special variants on equipment available for this country from the start can be defined as well:
  create_equipment_variant = {
  create_equipment_variant = {
第348行: 第349行:
</pre>
</pre>


== Localization ==
== 本地化 ==
{{SVersion|Timeless}}
{{SVersion|Timeless}}
Add the localisation for your new country to the following file (it is generally recommended to always create a new, separate file, to avoid overwrites of vanilla files)
Add the localisation for your new country to the following file (it is generally recommended to always create a new, separate file, to avoid overwrites of vanilla files)
第362行: 第363行:
  SCO_ADJ: "Scottish"
  SCO_ADJ: "Scottish"
'''Note:''' Do not mistake the correct letter _l_ ( L ) with a letter i ( I ), or number 1 ( One ), it's a common mistake, causing localisations to not show up, without any evident cause.
'''Note:''' Do not mistake the correct letter _l_ ( L ) with a letter i ( I ), or number 1 ( One ), it's a common mistake, causing localisations to not show up, without any evident cause.
==Flag==
== 旗帜==
{{SVersion|Timeless}}
{{SVersion|Timeless}}
Each country need 12 flags: 4 flags, 1 for each ideology, including non-aligned, and 3 sizes for each: Standard, Medium, Small.
Each country need 12 flags: 4 flags, 1 for each ideology, including non-aligned, and 3 sizes for each: Standard, Medium, Small.
第382行: 第383行:
For the purpose of this mode, place them in ''<yourmod>/gfx/flags'', each flag size into the corresponding folder.
For the purpose of this mode, place them in ''<yourmod>/gfx/flags'', each flag size into the corresponding folder.


==Order of battle (optional)==
== 战斗顺序(可选)==
{{SVersion|1.8}}
{{SVersion|1.8}}
If the country will exist at the start, an order of battle is necessary for the country to have an army.
If the country will exist at the start, an order of battle is necessary for the country to have an army.
第388行: 第389行:
Specific names of different types of units and their support companies can be found in {{path|common/units}}.
Specific names of different types of units and their support companies can be found in {{path|common/units}}.


===Division template===
=== 师模板===
First the default division template will be defined, simply set up what regiments will fill the country's divisions:
First the default division template will be defined, simply set up what regiments will fill the country's divisions:
  division_template = {
  division_template = {
第431行: 第432行:
}
}
</pre>
</pre>
===Division placement===
=== 师位置===
Division can be placed as follows:
Division can be placed as follows:
  units = {
  units = {
第457行: 第458行:
}
}
</pre>
</pre>
===Air wings===
=== 空军联队===
Air wings are not placed into a specific province, but rather a State. 
Air wings are not placed into a specific province, but rather a State. 
<pre>
<pre>
第471行: 第472行:
''version_name'' defines a specific variant of that type of equipment to be used. It first needs to be defined in the same file.
''version_name'' defines a specific variant of that type of equipment to be used. It first needs to be defined in the same file.


== Adding history for other Bookmarks (optional) ==
== 添加其他剧本的历史(可选) ==
If you want to edit something about your country, but only want it applied after a specific date (as in 1939 bookmark for example), you have to add these lines to the history file:
If you want to edit something about your country, but only want it applied after a specific date (as in 1939 bookmark for example), you have to add these lines to the history file:
<pre>
<pre>
第484行: 第485行:
}
}
</pre>
</pre>
=== National Focus ===
=== 国策 ===
National Focuses can be completed in two ways:
National Focuses can be completed in two ways:
If you want the effects to apply, then use:
If you want the effects to apply, then use:
第494行: 第495行:
unlock_national_focus = GER_demand_sudetenland
unlock_national_focus = GER_demand_sudetenland
</pre>
</pre>
=== Specific cases ===
=== 具体案例 ===
Cancelling a relation that is activated earlier (like a guarantee to FRA used earlier):
Cancelling a relation that is activated earlier (like a guarantee to FRA used earlier):
<pre>
<pre>
第509行: 第510行:
}
}
</pre>
</pre>
=== Things to remember ===
=== 要记住的事情 ===
*The date used must be at least 1 day before the actual bookmark start date, multiple dates can be used
*The date used must be at least 1 day before the actual bookmark start date, multiple dates can be used
*Ideas are added, Laws are replaced by the latest loaded
*Ideas are added, Laws are replaced by the latest loaded
第516行: 第517行:
*Country leader is chosen based on corresponding ideology, if multiple are present, the one located lower in the file is chosen
*Country leader is chosen based on corresponding ideology, if multiple are present, the one located lower in the file is chosen


== Adding the country to the game ==
== 在游戏中增加国家 ==


There are three ways to implement the new country into the game.
There are three ways to implement the new country into the game.
第524行: 第525行:
*Editing state history
*Editing state history


=== Adding countries by event or national focus ===
=== 通过事件或国策增加国家 ===
{{main|Event Modding}}
{{main|Event Modding}}


第537行: 第538行:
This script will change both the ownership and control to the scoped state. If a third country occupies it it will go to the new country regardless of the state of relations between it and the occupying power.
This script will change both the ownership and control to the scoped state. If a third country occupies it it will go to the new country regardless of the state of relations between it and the occupying power.


=== Adding countries with state history ===
=== 通过地区历史添加国家 ===


Change the owner and cores in province history files so that they include the new country either by default or in defined bookmarks (for instance only in 1939)
Change the owner and cores in province history files so that they include the new country either by default or in defined bookmarks (for instance only in 1939)

2020年9月4日 (五) 17:43的版本

这个页面假设你掌握了创建一个模组的基本知识。该页面主要聚焦于帮助模组作者更好地理解如何在某些特定方面编辑一个国家。

快速检查单

如果你想在模组中创建一个新国家,可以参考以下快速检查单:

  • 定义一个独特的三字符国家tag。
  • <yourmod>/common/countries中新建文件。
  • <yourmod>/history/countries中新建文件。
  • <yourmod>/localisations中增加本地化。
  • <yourmod>/gfx/flags中为每一种意识形态添加一个大,中,小号的旗帜。
  • 可选:在<yourmod>/history/units中创建OOB文件。
  • 可选:把国家加入到游戏中。

国家tag

Countries need a 3-character country tag. This is how a country is referred to in all of the game's script. All country tags must be unique. A country must not share a tag with any other country.

To create a tag, add a new file to <yourmod>/common/country_tags (or edit an existing file) and add something like the following:

SCO = "countries/Scotland.txt"

where

countries/Scotland.txt

is address of the country file that will be created/edited, located in <yourmod>/common/countries

国家文件

Create a new file in the <yourmod>/common/countries folder. It is recommended one copies the file of a very similar country, then rename and edit it.

文化

Defines the set of graphics used for units. For Scotland this would be:

graphical_culture = commonwealth_gfx
graphical_culture_2d = commonwealth_2d

颜色

This is the country's colour on the political map mode. It uses the RGB color scale.

color = { 2  10  222 }

colors.txt

Also, make sure that you add the country's color to <yourmod>/common/countries/colors.txt:

SCO = {
  color = rgb { 2  10  222 }
  color_ui = rgb { 255 255 155}
}

`color_ui` usually is a more intense version of the normal color. It is used to render the borders of the country (If borders look ugly, make sure you have done this right). Colors may also be specified in HSV format.

国家历史

Create a file in the <yourmod>/history/countries folder. Alternatively, copy, rename, and edit a similar file. The file name should be <country tag - country name>, e.g. "SCO - Scotland". This file contains information about the history and various other default attributes of the country.

首都

Defines the capital city. Use the State ID of the state that contains the capital, not the province ID. In this case, 121 is Lothrian State, which contains Edinburgh.

capital = 121

战斗顺序

This line will link to the 'Order of Battle' (OoB) file which will define the amount and location of units, their experience and equipment level, and also Air Wings the country has at the start. Starting production and unit templates are also defined there. All countries need an OoB link, but if the country is to be released one doesn't need to add one later on.

oob = "SCO_1936"

For ease of use, naval units are normally put into separate OOB. Also, due to significant changes made to naval units in the 'Man the Guns' DLC, countries normally use 2 separate naval OOBs, one for owners of the mentioned DLC, and one for those who don't own it, and have to use the old ship system (OOB usually distinquished by a _legacy suffix)

if = {
	limit= { has_dlc = "Man the Guns" }
		set_naval_oob = "SCO_1936_naval_mtg"
	else = {
		set_naval_oob = "SCO_1936_naval_legacy"
	}
}

科研槽

Defines the amount of research slots a country has access to at the start. Normally, major powers have 4 slots, minor countries in North America and Europe have 3 and minor countries in the rest of the world have 2. Defaults to 2 slots, if not specified.

set_research_slots = 3

稳定度

Defines the stability percentage that a country will have at the start of the game. The number that is put here will be multiplied by 100 when applied to the country, so the max is 1 (100) and the minimum is 0 (0).

set_stability = 0.7

战争支持度

Defines the war support percentage that a country will have at the start of the game. Like stability, the number will be multiplied by 100 when applied to the country, with the max being 1 (100) and minimum being 0 (0).

set_war_support = 0.5

民族精神和内阁

Sets Ideas country starts with (National Spirits, as well as advisors, companies & laws). A list of ideas can be found in /Hearts of Iron IV/common/ideas

Note that you don't have to add any ideas. Country will then start with no advisors, Civilian Economy and Volunteer Only conscription. This is an example:

add_ideas = {
		henschel
		GER_autarky_idea
		#laws
		war_economy
		extensive_conscription
}

科技

Here the technology a country has from the start is declared. A list of technologies can be found in /Hearts of Iron IV/common/technologies.

set_technology = {
 	infantry_weapons = 1
	infantry_weapons1 = 1	
	tech_engineers = 1
	tech_mountaineers = 1
	motorised_infantry = 1
	gw_artillery = 1
	interwar_antiair = 1
	gwtank = 1
	basic_light_tank = 1
	basic_heavy_tank = 1
	early_fighter = 1
	fighter1 = 1
	early_bomber = 1
	tactical_bomber1 = 1
	strategic_bomber1 = 1
	CAS1 = 1
	naval_bomber1 = 1
}

Keep in mind that those who own 'Man the Guns' DLC will need to use a different set of technologies for ships, therefore you have to set technologies for ships twice, like this:

if = {
	limit = { not = { has_dlc = "Man the Guns" } }
	set_technology = {
		early_submarine = 1
		early_destroyer = 1
	}
	set_naval_oob = "SCO_1936_naval_legacy"
}
if = {
	limit = { has_dlc = "Man the Guns" }
	set_technology = {
		basic_naval_mines = 1
		submarine_mine_laying = 1
		early_ship_hull_light = 1
		early_ship_hull_submarine = 1
		basic_ship_hull_submarine = 1
		basic_battery = 1
		basic_torpedo = 1
		basic_depth_charges = 1
	}
	set_naval_oob = "SCO_1936_naval_mtg"
}

其他(可选)

Add starting political power:

add_political_power = 500

Adds this amount of trade convoys. Note: If present multiple times in the same file, these stack

set_convoys = 100

Add starting research bonus. Useful for example if you had to manually complete a complex National Focus that adds research bonus, and effects had to be applied individually. For example this is used in the Soviet history file.

add_tech_bonus = {
		bonus = 1.0
		uses = 2
		category = armor
}

Add wargoal:

create_wargoal = {
		type = take_state_focus
		target = POL
		generator = { 72 88 90 87 86 } # Zaolzie Krakow Kielce Lodz Poznan
}

Country and global flags:

set_global_flag = earhart_disappeared		#Global flags can be placed in any country's file
set_country_flag = sudetenland_acquired		#For Germany in 1939
USA = {		#country to which the event will happen
	country_event = { id = usa.50 days = 2 }	#triggers this event, 2 days from the start
	country_event = { id = usa.51 days = 2 }	
}

Opinion modifiers:

add_opinion_modifier = { target = POL modifier = refused_anti_comintern_pact_opinion }		

Modifiers have their effects defined in /Hearts of Iron IV/common/opinion_modifiers

外交

If the new country has any diplomatic relations, these can be declared here. It is recommended that one adds relations only in one file (not in both the faction leader's file and the minor ally's for instance).

阵营

Factions are defined by adding the following line:

create_faction = Clanintern

The country that belongs to the file this line is in will take the role of faction leader. Other countries may be added to the faction:

add_to_faction = IRE

Puppets of members should always be added to the faction as well, to prevent bugs.

傀儡国

Puppets are defined as follows if the player has the 'Together for Victory' Expansion:

set_autonomy = {
	target = ENG
	autonomous_state = autonomy_integrated_puppet
}

and as follows if they don't:

puppet = ENG

In order to make the mod useable for both types of players an if-statement should be used:

if = {
	limit = {
		has_dlc = "Together for Victory"
	}
	set_autonomy = {
		target = ENG
		autonomous_state = autonomy_integrated_puppet
	}
	else = {
		puppet = ENG
	}
}

If the player has 'Together for Victory', Great Britain will be an integrated puppet, if not, they will be a regular (the only type of) puppet.

其他外交行动

Guarantee Independence:
The country this file belongs to will guarantee the following TAG

give_guarantee = FRA

Non-aggression Pact:

diplomatic_relation = { country = USA relation = non_aggression_pact }

Starting trade:
The country this file belongs to will import preset amount of resource

create_import = {
		resource = tungsten
		factories = 1
		exporter = SWE
}

Military access:

give_military_access = IRE

科技共享

If the player has 'Together for Victory' one can add the country to a tech sharing group:

add_to_tech_sharing_group = haggis_investigators

An if-statement as shown above will be required to limit it to 'Together for Victory' owners and to prevent bugs with those that don't own it.

设定党派支持度

Defines the popularity of different parties in the country:

set_popularities = {
	democratic = 5
	communism = 80
	fascism = 10
	neutrality = 5
}

设定政治

Defines the ruling party and how elections work in a country:

set_politics = {
	ruling_party = communism
	last_election = "1932.11.8"
	election_frequency = 48
	elections_allowed = no
}

Note: Frequency is in months

国家领导人

Defines the leaders a country has. In theory adding a leader for only the starting ideology would be enough, as the other ones will be randomly generated, it is possible however, to define the leaders of all parties.

create_country_leader = {
	name = "Ronald McDonald"
	desc = "POLITICS_RONALD_MCDONALD_DESC"
	picture = "gfx/leaders/Europe/Portrait_Europe_Generic_land_3.dds"
	expire = "1965.1.1"
	ideology = fascism_ideology
	traits = {
		scary_clown
	}
}

One can add a custom portrait by adding it in in DDS-format, which may require Gimp or Paint.net to edit.

A list of traits can be found in /Hearts of Iron IV/common/country_leader. It is possible to add more there as well.

将军

Custom army leaders may be defined here:

create_corps_commander = {
 	name = "Sean McHaggis"
 	portrait_path = "gfx/leaders/Europe/Portrait_Europe_Generic_land_4.dds"
 	traits = { panzer_leader fortress_buster }
 	attack_skill = 4
	defense_skill = 2
	planning_skill = 1
	logistics_skill = 2
}

As well as naval leaders:

create_navy_leader = {
 	name = "James McSeafarer"
 	portrait_path = "gfx/leaders/Europe/Portrait_Europe_Generic_navy_1.dds"
 	traits = { blockade_runner superior_tactician }
 	attack_skill = 3
	defense_skill = 3
	maneuvering_skill = 5
	coordination_skill = 2
}

变种型号(可选)

Special variants on equipment available for this country from the start can be defined as well:

create_equipment_variant = {
	name = "Haggis Class"
	type = submarine_1
	upgrades = {
		sub_engine_upgrade = 3
		sub_stealth_upgrade = 2
		sub_torpedo_upgrade = 2
	}
}
create_equipment_variant = {
		name = "Scotfire"
		type = fighter_equipment_1
		upgrades = {
			plane_gun_upgrade = 3
			plane_range_upgrade = 0  
			plane_engine_upgrade = 3
			plane_reliability_upgrade = 3
		}
}
create_equipment_variant = {
		name = "Tanktoon 2"
		type = light_tank_equipment_2
		upgrades = {
			tank_gun_upgrade = 5
			tank_armor_upgrade = 1  
			tank_engine_upgrade = 2
			tank_reliability_upgrade = 0
		}
		obsolete = yes	#optional, marks the unit as obsolete and hides the unit from the UI
}

本地化

Add the localisation for your new country to the following file (it is generally recommended to always create a new, separate file, to avoid overwrites of vanilla files)

<yourmod>/localisation/mynewscotland_l_<language>.yml

where <language> can be either English, German, Spanish, French, Polish, Russian or Brazilian Portuguese. A file can be created for each language for better coverage across the supported languages.

Define the localisation for the country's name and its adjective as follows for every ideology:

SCO_communism: "People's Republic of Scotland"
SCO_communism_DEF: "The People's Republic of Scotland" #For events
SCO_ADJ: "Scottish"

Note: Do not mistake the correct letter _l_ ( L ) with a letter i ( I ), or number 1 ( One ), it's a common mistake, causing localisations to not show up, without any evident cause.

旗帜

Each country need 12 flags: 4 flags, 1 for each ideology, including non-aligned, and 3 sizes for each: Standard, Medium, Small. Each flag needs to be a TGA-file with the name of the country tag and the ideology the flag is meant for. The flag file format is 32-bits and uncompressed.

However, if you do not wish to make a flag for each ideology, it is also an option to create a single flag for each size and just name it the country tag without naming an ideology. For example, "SCO.tga" would appear as the flag of Scotland if there is not a particular flag for the current ideology.

Size-requirement
Standard 82x52 pixel
Medium 41x26 pixel
Small 10x7 pixel

All flags are located in /Hearts of Iron IV/gfx/flags. For the purpose of this mode, place them in <yourmod>/gfx/flags, each flag size into the corresponding folder.

战斗顺序(可选)

If the country will exist at the start, an order of battle is necessary for the country to have an army. Create a new file in /Hearts of Iron IV/history/units or copy one from a similar country. It must be named exactly the way it's linked in the country's history file. Specific names of different types of units and their support companies can be found in /Hearts of Iron IV/common/units.

师模板

First the default division template will be defined, simply set up what regiments will fill the country's divisions:

division_template = {
	name = "Blueskirt Division"

	regiments = {
		infantry = { x = 0 y = 0 }
		infantry = { x = 0 y = 1 }
		infantry = { x = 0 y = 2 }
		infantry = { x = 1 y = 0 }
		infantry = { x = 1 y = 1 }
		infantry = { x = 1 y = 2 }
		infantry = { x = 2 y = 0 }
		infantry = { x = 2 y = 1 }
		infantry = { x = 2 y = 2 }
		infantry = { x = 3 y = 0 }
		infantry = { x = 3 y = 1 }
	}
}

As can be seen, this division exists solely out of infantry. Example of more advanced unit template from Germany, which will use german infantry names:

division_template = {
	name = "Infanterie-Division"
	division_names_group = GER_Inf_01

	regiments = {
		infantry = { x = 0 y = 0 }
		infantry = { x = 0 y = 1 }
		infantry = { x = 0 y = 2 }
   		infantry = { x = 1 y = 0 }
		infantry = { x = 1 y = 1 }
		infantry = { x = 1 y = 2 }
  		infantry = { x = 2 y = 0 }
		infantry = { x = 2 y = 1 }
		infantry = { x = 2 y = 2 }
	}
	support = {
		engineer = { x = 0 y = 0 }
		artillery = { x = 0 y = 1 }
	}
}

师位置

Division can be placed as follows:

units = {
	division= {	
		name = "1st Blueskirt Division"
		location = 9392 # Edinburgh
		division_template = "Blueskirt Division"
		start_experience_factor = 0.2   #optional, otherwise starts with 0 expereince
		start_equipment_factor = 0.3    #optional, otherwise starts with equipment factor of 1 (maximum)

	}
}

The name is simply the name the game shows for the division, the location is where the division is on the map, the template links to the template defined above and start_experience_ and _equipment_factors define how much experience and equipment the division has. Alternatevely you can use the automatic naming using a predefined list of names.

         division= {
		division_name = {
				is_name_ordered = yes
				name_order = 35
		}
		location = 6488
		division_template = "Infanterie-Division"
		start_experience_factor = 0.1                                                 #optional, otherwise starts with 0 expereince
		force_equipment_variants = { infantry_equipment_0 = { owner = "GER" } }       #optional, replaces equipment with a specific variant (for example to give obsolete equipment to garrison units)
	}

空军联队

Air wings are not placed into a specific province, but rather a State.

air_wings = {
	121 = { 	# Edinburgh
		tac_bomber_equipment_0 = { owner = "SCO" amount = 72 }
			start_experience_factor = 0.2	#optional, otherwise starts with 0 expereince
		fighter_equipment_1 = { owner = "SCO"  version_name = "Scotfire" amount = 150 }		#version_name is optional
			start_experience_factor = 0.5			
	}
}

version_name defines a specific variant of that type of equipment to be used. It first needs to be defined in the same file.

添加其他剧本的历史(可选)

If you want to edit something about your country, but only want it applied after a specific date (as in 1939 bookmark for example), you have to add these lines to the history file:

1939.1.1 = {
#There you can add anything, in the same format as described earlier
	oob = "SCO_1939"	#Usually another oob is used for later bookmarks, only the latest one will be loaded
	set_technology = {
		atomic_research = 1 
		nuclear_reactor = 1 
		nukes = 1
	}	
}

国策

National Focuses can be completed in two ways: If you want the effects to apply, then use:

complete_national_focus = army_effort

If you want to just bypass the focus (often used for more complex focuses, like 'Demand Sudetenland', and apply effect manually, without triggering all the associated events), use:

unlock_national_focus = GER_demand_sudetenland

具体案例

Cancelling a relation that is activated earlier (like a guarantee to FRA used earlier):

diplomatic_relation = {
	country = FRA
	relation = guarantee
	active = no
}

Removing previously used idea:

remove_ideas = {
	great_depression	
}

要记住的事情

  • The date used must be at least 1 day before the actual bookmark start date, multiple dates can be used
  • Ideas are added, Laws are replaced by the latest loaded
  • Technologies only have to be applied once, add only extra technologies to the later bookmarks
  • If a National Focus triggers an event, or adds effect, completing it by history file does not apply these, they have to be triggered separately
  • Country leader is chosen based on corresponding ideology, if multiple are present, the one located lower in the file is chosen

在游戏中增加国家

There are three ways to implement the new country into the game.

  • Using events
  • By national focus
  • Editing state history

通过事件或国策增加国家

主条目:Event Modding

There are multiple ways to add a country's presence by event or national focus. Here are two:

set_state_owner = 119

Using this script in an event option or national focus reward, when scoped to the new country, will cause the province to be owned by the new country. If it is occupied by a third power and the new country is at war with them however, the region will remain occupied.

transfer_state = 119

This script will change both the ownership and control to the scoped state. If a third country occupies it it will go to the new country regardless of the state of relations between it and the occupying power.

通过地区历史添加国家

Change the owner and cores in province history files so that they include the new country either by default or in defined bookmarks (for instance only in 1939)