Difference between revisions of "The GameInfo.txt File Structure:zh-cn"

From Valve Developer Community
Jump to: navigation, search
(Created page with "{{otherlang2 |fr=The_GameInfo.txt_File_Structure:fr |ru=The_GameInfo.txt_File_Structure:ru |pl=The_GameInfo.txt_File_Structure:pl |jp=The_GameInfo.txt_File_Structure:jp |zh-cn=Th...")
Line 1: Line 1:
{{DISPLAYTITLE:GameInfo.txt 文件的结构}}
{{DISPLAYTITLE:GameInfo.txt 文件的结构}}

Revision as of 10:34, 25 January 2013

English Français Polski Русский 日本語

gameinfo.txt是用来描述你的mod.就如同它名字所表达的那样,就如同一个网站的指导手册一样,并且制定游戏的内容数据哪些可以被访问. 它存在于你的根目录下别且就像是Steam用来标记那样, Source和SDK工具也需要它的存在.

The SDK launcher generates a gameinfo.txt when you run the Create a Mod Wizard. This will work fine for development, but before release you will want to edit it and add new data.

Note:Boolean values are represented as integers.

Warning: If a value has any spaces or tabs in it, wrap it in "quote marks".

UI settings


game <string>
The name of your mod in ASCII. Displayed in Steam and on the Windows task bar, but not on the main menu (unless you don't define a title).
title <string>
title2 <string>
These are the Unicode strings displayed in the main menu of your mod. They might be different from the strings displayed in Steam and on the desktop if you are using a fancy font.
title2 (and 3, 4, etc.) are to enable you to apply different styles to different parts of your title.
Note:It's likely your title won't display right until you edit ClientTitleFont in resource\clientscheme.res to change its font. The default ("HalfLife2") only has a specific set of characters and won't display most text properly.
gamelogo <boolean> (New with Half-Life 2: Episode Two / Source 2007)
Rather than displaying the title/title2 text on the main menu, display the content in resource\GameLogo.res. See Adding Your Logo to the Menu.


type <singleplayer_only | multiplayer_only>
Affects which tabs appear in which order the Options panel. May also affect Steam's download speed. Omit if your mod has both SP and MP modes.
nodifficulty <boolean>
Hides the difficulty tab (this happens automatically if your mod is multiplayer_only)
hasportals <boolean> (New with Half-Life 2: Episode Two / Source 2007)
Shows the Portal options tab
nocrosshair <boolean>
Hides the multiplayer crosshair selection menu
Enables special advanced crosshair options. To do: How to implement.
nomodels <boolean>
Hides the multiplayer model selection menu
nohimodel <boolean>
Hides toggle checkbox for cl_himodels, which was used in GoldSrc. Only displayed properly if cl_himodels exists in the first place!

Steam games list

developer <string>
Your team's name (or just yours!)
developer_url <string>
Your or the mod's website. Must start with http://.
manual <string>
URL to the mod's manual; can be a local file.
icon <string>
Local path, relative to gameinfo.txt, to an uncompressed 16x16 TGA that will appear as your mod's icon in Steam. Do not include the file extension. The larger 32px pixel icon that appears in Steam's Detail View should be placed next to the 16px one and called <icon>_big.tga.
Note:For transparency to work, the TGA must be saved in 32-bit mode with active alpha channel.


hidden_maps <subkey>
Maps in the subkey do not appear in the "create server" dialogue (but can still be loaded from the console).
Syntax is mapname 1, with one entry per line. Don't include .bsp. Remember to open and close the subkey with { and }.
nodegraph <boolean> (New with Half-Life 2: Episode Two / Source 2007)
When false, prevents the engine from creating nodegraphs.
GameData <string> (New with Half-Life 2: Episode Two / Source 2007)
Path to a FGD, relative to Hammer's location. This is used by the compile tools, but not by Hammer.
InstancePath <string> (New with Half-Life 2: Episode Two / Source 2007)
The default location in which to look for instance VMFs.
SupportsDX8 <bool> (New with Left 4 Dead)
Prevents the game from running under DirectX8, which does not support the full range of graphics effects.

Mounting content

There are two stages to getting at a game's content:

  1. Mount its AppID
  2. Mount its folder as a searchpath

This all happens within the filesystem key. See this example.

Warning: Your mod will not be protected by VAC if it is based on a single-player game.


SteamAppID <int>
The AppID of the game the mod is to be based on. The mod will have access to all of this game's content, and will not be playable unless it is installed.
Tip:For most mods this will be either 215 (Ep1) or 218 (OB), both of which point to different versions of the Source SDK Base.
AdditionalContentId <int> (MODS ONLY)
Another AppID that the mod has access to. This feature was added to the SDK source code but somehow never made it to Valve's other games; you will have to build your own binaries to use it. If you need to mount multiple apps, make these changes. Warning: Your mod will run regardless of whether or not the user owns the game that you mount content for. If the game isn't owned the content will not be mounted, and error signs will appear everywhere instead.
Bug: The engine understands this command, but the SDK tools unfortunately do not. The best solution, currently, is to copy the content of the game to a location on your hard drive and add an absolute SearchPath to it (see below). Remember to delete the SearchPath before you release.
ToolsAppId <int>
This is the AppID of the SDK currently in use. Currently, the only valid ID is 211 (the Source SDK). To do: What about the L4D Authoring Tools?


SearchPaths is a subkey within FileSystem. It contains a list of folders (in the form Game <path>, once per line) that the engine will look for files in.

The engine starts looking for a file in the first path. If it finds it there it stops, but otherwise it looks in the second. This means that the order in which you provide search paths is important: files in a higher path override those in a lower one.

A search path is normally either relative to the SteamAppID's root directory (i.e. where hl2.exe is located) or absolute (e.g. C:\SomeFolder\). Thankfully there are two "magic words" which are more useful:

Root folders of both the SteamAppID game and any AdditionalContentId games you have mounted
Folder containing your mod's gameinfo.txt


Source automatically creates localised search paths. If you mount hl2, then when your mod runs in French hl2_french is automatically mounted just above it. To do: Does this also apply for the mod folder?

(Different languages can have different AppIDs, but don't worry. Steam handles all that internally.)


The following code would mount the content of both Episode Two and Portal:

	SteamAppId	420	// Ep2
	ToolsAppId	211
	AdditionalContentId	400	// Portal

		Game	|gameinfo_path|.	// Your mod folder should always come first
		Game	|all_source_engine_paths|ep2
		Game	|all_source_engine_paths|episodic	// Ep2 also uses some Ep1 content
		Game	|all_source_engine_paths|portal
		Game	|all_source_engine_paths|hl2	// HL2 should always come last

Episode Two comes first and so has priority. This means that you won't be able to use portals, as the Ep2 binaries will be loaded - but you could pitch GLaDOS against a pack of Hunters!

If you did want to use Portal's binaries, you would simply promote its search path above Ep2's. But if there are custom binaries in |gameinfo_path| (your mod's folder) then they will be loaded in both cases.