Bookmark modding

From Hearts of Iron 4 Wiki
Jump to navigation Jump to search

A bookmark is a selectable date chosen by the player at the start of the game.

The bookmarks used by the game are found at /Hearts of Iron IV/common/bookmarks/*.txt.

Bookmark[edit]

Here is a generic example of a bookmark:

bookmarks = {
	bookmark = {
		name = <localized string>		# The title of the bookmark
		desc = <localized string>		# The description for the bookmark
		date = <year>.<month>.<day>.<hour>
		picture = <string>			# The GFX reference for the picture used by the bookmark
		
		# Defaults the bookmark selection to this bookmark
		default = yes
		
		# Defaults the selection to the specified tag
		default_country = <tag>
		
		# Adds a country to the selection
		<tag> = {
			history = <localized string>	# Description of the history for the country
			ideology = <ideology>		# The initial ideology of the country
			minor = yes			# Makes this country a minor in the selection screen (If it is a minor country, it must not use the default focus, otherwise it will not appear on the selection screen)
			
			# Hides this selection if the triggers are not met
			available = {
				<triggers>
			}
			
			# Ideas the country to display on the country's selection. (Max 3)
			ideas = {
				<idea>
				<idea>
				<idea>
			}
			
			# National focuses to display on the country's selection. (Max 3)
			focuses = {
				<focus>
				<focus>
				<focus>
			}
		}
		
		# Required to allow the player to enter the free selection screen
		"---" = {
			history = <localized string>
		}
		
		# Effects to execute when the bookmark is selected
		effect = {
			randomize_weather = 12345   # Required
			<effects>
		}
	}
}

Note that the country is not required to start with the ideas or focuses you put in the bookmark.

Interface[edit]

Here is a generic example of the GFX definition needed for the bookmark picture:

spriteType = {
    name = "GFX_select_date_<name>"
    texturefile = "gfx/interface/<image>.dds"
}

The image itself should be 180 pixels wide and 104 pixels high.

If there is only one bookmark defined, the game automatically skips past the bookmark selection screen towards the country selection screen. If you wish to make it so that the screen is not skipped, you can create a dummy second bookmark, but make it unselectable by changing the size of a slot in the gridbox of the bookmark selections. The bookmark selection screen is defined in /Hearts of Iron IV/interface/frontendgamesetupview.gui in the gamesetup_scenario_window containerWindowType. More information on how to edit these files can be seen in the Interface modding article.