Namelist modding

本頁面講述的內容長期有效

陸軍和海軍單位的名稱都來自於一組預設的名稱列表。

師的名稱

師的名稱定義在 /Hearts of Iron IV/common/units/names_divisions的國家特定文本文件中。文件名無關緊要,但通常遵循以下格式: TAG_names_divisions.txt.

進入文件後,您需要從 /Hearts of Iron IV/history/units中 OOB 設置的名稱列表開始,例如 NEP_MTN_01。您將需要遵循以下格式

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

海軍單位名稱

海軍單位名稱定義在/Hearts of Iron IV/common/units/names_ships 的國家特定文本文件中。文件名無關緊要,但通常遵循以下格式: TAG_ship_names.txt.

在這個文件中,它不像師名稱那樣依賴於 OOB 文件中的預設名稱,而是適用於任何船隻。你需要遵循以下格式

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

通用名稱

定義在 /Hearts of Iron IV/common/units/names/*.txt中,適用於缺乏特定裝備名稱的國家,尤其是那些並非每個國家都會使用的自定義裝備。

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

特工代號

這些代號存儲在 /Hearts of Iron IV/common/units/codenames_operatives中,將被隨機分配給指定國家的特工。示例定義如下所示

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