Namelist modding:修订间差异

本页面讲述的内容长期有效
(文本替换 - 替换“[[Category:”为“[[分类:”)
无编辑摘要
 
第1行: 第1行:
{{Version|Timeless}}
{{Version|Timeless}}
{{需要翻译|译者=霜泽图书馆}}
Units, both land and naval, obtain their names from either a set list of names.


Divisions get default names from a preset pool of historical names. All such name-pools are stored in {{path|Hearts of Iron IV/common/units/names_divisions}} in country-specific textfiles, e.g. "USA_names_divisions.txt" contains the division names for the United States.
== Divisions Names ==


Fortunately, every single file contains a good tutorial at the top and lots of existing name-pools to serve as your examples
Division names are defined in {{path|common/units/names_divisions}} in country specific text files. The name of the file does not matter, though generally follow the following format ''TAG_names_divisions.txt''.


Still keep the following in mind:
Once in the file, you want to start off with the name list set in your OOB found in {{path|history/units}}, for example NEP_MTN_01. You will want to follow the following formatting


* Don't forget to make a safety copy (e.g. "USA_names_divisions_original.txt")
<pre>NEP_MTN_01 = { # DIVISIONS_NAME_GROUP, set in your units folder
* Maybe consider to first create an empty template in excel in order to automate the numbering (1 = { "%dst ' ' Division" } , ... continue down to 100th), as typing everything manually can be nauseating.
name = "Mountain Divisions" # The name you want for your name list, can either be a string or in quotes.
* Don't forget to save the file.
for_countries = { NEP } # Sets what countries can use this name list, change NEP to your countries tag
can_use = { always = yes } # A country scope trigger that can lock or unlock a division name group given certain triggers
division_types = { "mountaineers" } # Sets what types of units can use this name list, replace mountaineers with whatever type of unit you are using
fallback_name = "%d Nepali Dibhijana" # This will be used if you run out of numbered divisions. Always use either %d for decimal numbers or %s for Roman numerals but you can change the rest
link_numbering_with = { NEP_INF_01 } # Alternative to fallback name, if you run out of numbers in this group you can use another list after it.
ordered = {
1 = { "%d Nepali Dibhijana" } # The first division.
2 = { "%d Nepali Dibhijana" } # Numbers must always start from 1 and go up
4 = { "%d Nepali Dibhijana" } # The numbers do not need to be sequential
}
}</pre>


== Naval Names ==
Naval names are defined in {{path|common/units/names_ships}} in country specific text files. The name of the file does not matter, though generally follow the following format ''TAG_ship_names.txt''.
In this file, it does not rely upon a set name within your OOB file like in division names, instead it is any ship. You will want to follow the following formatting
<pre>PAK_DD_HISTORICAL = { # Any name you want
name = NAME_THEME_HISTORICAL_DESTROYERS # The name you want to appear in the naval designer, can either be a string or in quotes.
for_countries = { PAK } # Sets what countries can use this name list, change PAK to your countries tag
type = ship # Do not change
ship_types = { ship_hull_light destroyer } # First one is MTG technology, second is non-MTG technology. Set it to the technology you are using
prefix = "PNS " # The name that comes before your ships
fallback_Name = "Destroyer %d" # This will be used if you run out of numbered divisions. Always use either %d for decimal numbers or %s for Roman numerals but you can change the rest
unique = {
"Shamsher" "Tippu Sultan" "Tariq" # List all of the custom ship names they could use, do not use commas
}
}</pre>
== Generic Names ==
Defined in {{path|common/units/names/*.txt}}, for countries that lack specific names for types of equipment, especially for custom equipment that not every nation will use.
<pre>generic = { # Makes it apply to all countries
submarine = { # Name of the equipment
prefix = "" # The name that comes before equipment
generic = { "Submarine" } # Sets the equipments name
unique = {  } # For generic equipment, do not put anything here
}
}</pre>
== Operative codenames ==
Stored in {{path|common/units/codenames_operatives}}, these codenames will be randomly assigned to operatives of the specified countries. An example definition looks like
<pre>codename_list_id = { # ID of the namelist
name = codename_list_name # Name of the namelist, can match ID
for_countries = { TAG1 TAG2 } # Countries using it
type = codename # To notify to the game that it's a codename list
fallback_name = "Agent %d" # In case uniques run out.
unique = { # Unique codenames, only 1 operative at a time can use them
"Codename 1"
"Codename 2"
}
}</pre>
{{Modding navbox}}
{{Modding navbox}}
[[分类:Modding]]
[[分类:Modding]]

2024年9月21日 (六) 19:56的最新版本

Units, both land and naval, obtain their names from either a set list of names.

Divisions Names

Division names are defined in /Hearts of Iron IV/common/units/names_divisions in country specific text files. The name of the file does not matter, though generally follow the following format TAG_names_divisions.txt.

Once in the file, you want to start off with the name list set in your OOB found in /Hearts of Iron IV/history/units, for example NEP_MTN_01. You will want to follow the following formatting

NEP_MTN_01 = { # DIVISIONS_NAME_GROUP, set in your units folder
	name = "Mountain Divisions" # The name you want for your name list, can either be a string or in quotes.
	for_countries = { NEP } # Sets what countries can use this name list, change NEP to your countries tag
	can_use = { always = yes } # A country scope trigger that can lock or unlock a division name group given certain triggers
	division_types = { "mountaineers" } # Sets what types of units can use this name list, replace mountaineers with whatever type of unit you are using
	fallback_name = "%d Nepali Dibhijana" # This will be used if you run out of numbered divisions. Always use either %d for decimal numbers or %s for Roman numerals but you can change the rest
	link_numbering_with = { NEP_INF_01 } # Alternative to fallback name, if you run out of numbers in this group you can use another list after it.
	ordered = {
		1 = { "%d Nepali Dibhijana" } # The first division.
		2 = { "%d Nepali Dibhijana" } # Numbers must always start from 1 and go up
		4 = { "%d Nepali Dibhijana" } # The numbers do not need to be sequential
	}
}

Naval Names

Naval names are defined in /Hearts of Iron IV/common/units/names_ships in country specific text files. The name of the file does not matter, though generally follow the following format TAG_ship_names.txt.

In this file, it does not rely upon a set name within your OOB file like in division names, instead it is any ship. You will want to follow the following formatting

PAK_DD_HISTORICAL = { # Any name you want
	name = NAME_THEME_HISTORICAL_DESTROYERS # The name you want to appear in the naval designer, can either be a string or in quotes.
	for_countries = { PAK } # Sets what countries can use this name list, change PAK to your countries tag
	type = ship # Do not change
	ship_types = { ship_hull_light destroyer } # First one is MTG technology, second is non-MTG technology. Set it to the technology you are using
	prefix = "PNS " # The name that comes before your ships
	fallback_Name = "Destroyer %d" # This will be used if you run out of numbered divisions. Always use either %d for decimal numbers or %s for Roman numerals but you can change the rest
	unique = {
		"Shamsher" "Tippu Sultan" "Tariq" # List all of the custom ship names they could use, do not use commas
	}
}

Generic Names

Defined in /Hearts of Iron IV/common/units/names/*.txt, for countries that lack specific names for types of equipment, especially for custom equipment that not every nation will use.

generic = { # Makes it apply to all countries
	submarine = { # Name of the equipment
		prefix = "" # The name that comes before equipment
		generic = { "Submarine" } # Sets the equipments name
		unique = {  } # For generic equipment, do not put anything here
	}
}

Operative codenames

Stored in /Hearts of Iron IV/common/units/codenames_operatives, these codenames will be randomly assigned to operatives of the specified countries. An example definition looks like

codename_list_id = {				# ID of the namelist
	name = codename_list_name		# Name of the namelist, can match ID

	for_countries = { TAG1 TAG2 }	# Countries using it

	type = codename					# To notify to the game that it's a codename list

	fallback_name = "Agent %d"		# In case uniques run out.

	unique = {						# Unique codenames, only 1 operative at a time can use them
		"Codename 1"
		"Codename 2"
	}
}