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

From Valve Developer Community
Jump to: navigation, search
Line 37: Line 37:
; <code>type <singleplayer_only | multiplayer_only></code>
; <code>type <singleplayer_only | multiplayer_only></code>
: 这将决定在设置选项里是否会有单人和多人模式,多人模式可能会影响steam的下载速度,如果你的mod含有独立的单人和多人模式,请删除
: 这将决定在设置选项里是否会有单人和多人模式,多人模式可能会影响steam的下载速度,如果你的mod含有独立的单人和多人模式,请删除
; <code>nodifficulty <boolean></code>
; <code>nodifficulty <布朗值></code>
: 在设置面板中隐藏困难选项 (如果你的mod是多人游戏的mod的话,这将会自动生成 <code>multiplayer_only</code>)
: 在设置面板中隐藏困难选项 (如果你的mod是多人游戏的mod的话,这将会自动生成 <code>multiplayer_only</code>)
; {{EP2 添加|<code>hasportals <boolean></code>}}
; {{EP2 添加|<code>hasportals <布朗值></code>}}
: 显示入口选项在设置面板中
: 显示入口选项在设置面板中
; <code>nocrosshair <boolean></code>
; <code>nocrosshair <布朗值></code>
: 隐藏准星设置在多人游戏设置中
: 隐藏准星设置在多人游戏设置中
; <code>advcrosshair</code>
; <code>advcrosshair</code>
: 允许一些高级准星在多人游戏设置中出现. {{todo|如何实现.}}
: 允许一些高级准星在多人游戏设置中出现. {{todo|如何实现.}}
; <code>nomodels <boolean></code>
; <code>nomodels <布朗值></code>
: 隐藏多人游戏选项
: 隐藏多人游戏选项
; <code>nohimodel <boolean></code>
; <code>nohimodel <布朗值></code>
: Hides toggle checkbox for <code>cl_himodels</code>, which was used in [[GoldSrc]]. Only displayed properly if <code>cl_himodels</code> exists in the first place!
: Hides toggle checkbox for <code>cl_himodels</code>, which was used in [[GoldSrc]]. Only displayed properly if <code>cl_himodels</code> exists in the first place!
=== Steam games list ===
=== Steam游戏相关 ===
; <code>developer <[[string]]></code>
; <code>developer <[[字符]]></code>
: Your team's name (or just yours!)
: 你的团队名 (或者就是你的名字!)
; <code>developer_url <string></code>
; <code>developer_url <字符值></code>
: Your or the mod's website. Must start with <code><nowiki>http://</nowiki></code>.
: 你的或者你这个Mod的网站.必须以<code><nowiki>http://</nowiki></code>开头.
; <code>manual <string></code>
; <code>manual <字符值></code>
: URL to the mod's manual; can be a local file.
: 游戏手册相关,可以指向一个本地文件或者是一个URL.
; <code>icon <string></code>
; <code>icon <字符值></code>
: 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 <code>&lt;icon&gt;_big.tga</code>. {{note|For transparency to work, the TGA must be saved in 32-bit mode with active alpha channel.}}
: 由本地路径组成,有一个16x16像素的TGA文件组成这将成为你在steam显示的图标. '不要''包含文件扩展名.32位的图标是用来显示在Steam详细信息页面的,必须放在icon之后,并且声明<code>&lt;icon&gt;_big.tga</code>. {{note|如果是要保留透明度的话,TGA文件必须要使用32位并且保留alpha通道的储存方式.}}
=== Miscellaneous ===
=== 其他 ===
; <code>hidden_maps <subkey></code>
; <code>hidden_maps <subkey></code>
: Maps in the subkey do not appear in the "create server" dialogue (but can still be loaded from the console).
: 被指定的地图将不会成为在"创建服务器"所出现选取地图选项中(但是任然可以使用控制台来创建).
: Syntax is <code>mapname 1</code>, with one entry per line. Don't include <code>.bsp</code>. Remember to open and close the subkey with { and }.
: 具体的语法是<code>mapname 1</code>,每行只循序有一项.请不要包含<code>.bsp</code>.记得通过{ and }来关闭或者打开子键.
; {{EP2 add|<code>nodegraph <[[boolean]]></code>}}
; {{EP2 加入|<code>nodegraph <[[布朗值]]></code>}}
: When false, prevents the engine from creating [[nodegraph]]s.
: 当设置为false的时候组织引擎创建[[nodegraph|网点图]]s.
; {{EP2 add|<code>GameData <string></code>}}
; {{EP2 加入|<code>GameData <字符值></code>}}
: Path to a FGD, relative to Hammer's location. This is used by the compile tools, but not by Hammer.
: 指向FGD文件, 相对于Hammer的路径. 只有编译工具才会使用到,不包括Hammer.
; {{EP2 add|<code>InstancePath <string></code>}}
; {{EP2 加入|<code>InstancePath <字符值></code>}}
: The default location in which to look for [[instance]] VMFs.
: The default location in which to look for [[instance]] VMFs.
; {{L4D add|'''<code>SupportsDX8 <bool></code>'''}}
; {{L4D 加入|'''<code>SupportsDX8 <布朗值></code>'''}}
: Prevents the game from running under DirectX8, which does not support the full range of graphics effects.
: 防止游戏运行与DX8以下的版本,因为他不能支持许多游戏特效
== Mounting content ==
== 安装内容相关 ==
There are two stages to getting at a game's content:
There are two stages to getting at a game's content:

Revision as of 13:24, 3 February 2013

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

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

SDK会在你开始制作一个MOD时,自动生成一个gameinfo文件. 这将会使得你有一个很好的开头, 但是别以为你可以一劳永逸,你还需要在适当的时候编辑它


Warning: 如果一个数值含有空格或者制表,请使用 "引号"进行标注.



game <字符值>
请使用ASCII码来命名你的MOD名. MOD的名字显示在Steam库中或windows窗口上, 但是 不会在主菜单里(好吧除非你不想用title).
title <字符值>
title2 <字符值>
[请使用[Wikipedia:Unicode|Unicode]]码来编辑在主菜单里显示的标题. 由于字体的不同所以无法保证在Steam或者桌面上显示样式是一样.
title2 (还有 3, 4,等等)它允许你在不同的情况下显示不同的标题
Note:这有可能导致有些字符无法显示因为默认字体可能没有你所使用字符的样式,请通过编辑 ClientTitleFontresource\clientscheme.res 来改变默认字体. 默认的("HalfLife2")字体可以显示大多数的字符.
Template:EP2 加入的
不是显示你的标题title/title2在主菜单里面, 而是显示resource\GameLogo.res. 请查阅在菜单上添加你的logo.


type <singleplayer_only | multiplayer_only>
nodifficulty <布朗值>
在设置面板中隐藏困难选项 (如果你的mod是多人游戏的mod的话,这将会自动生成 multiplayer_only)
Template:EP2 添加
nocrosshair <布朗值>
允许一些高级准星在多人游戏设置中出现. To do: 如何实现.
nomodels <布朗值>
nohimodel <布朗值>
Hides toggle checkbox for cl_himodels, which was used in GoldSrc. Only displayed properly if cl_himodels exists in the first place!


developer <字符>
你的团队名 (或者就是你的名字!)
developer_url <字符值>
manual <字符值>
icon <字符值>
由本地路径组成,有一个16x16像素的TGA文件组成这将成为你在steam显示的图标. 请'不要包含文件扩展名.32位的图标是用来显示在Steam详细信息页面的,必须放在icon之后,并且声明<icon>_big.tga.


hidden_maps <subkey>
具体的语法是mapname 1,每行只循序有一项.请不要包含.bsp.记得通过{ and }来关闭或者打开子键.
Template:EP2 加入
Template:EP2 加入
指向FGD文件, 相对于Hammer的路径. 只有编译工具才会使用到,不包括Hammer.
Template:EP2 加入
The default location in which to look for instance VMFs.
Template:L4D 加入


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.