Gameinfo.txt

From Valve Developer Community
< Zh
Revision as of 03:40, 28 December 2021 by 123wer55 (talk | contribs)
Jump to navigation Jump to search
English (en)Deutsch (de)Español (es)Français (fr)日本語 (ja)한국어 (ko)Polski (pl)Русский (ru)中文 (zh)Translate (Translate)
Info content.png
This translated page needs to be updated.
You can help by updating the translation.
Also, please make sure the article complies with the alternate languages guide.(en)
This notice is put here by LanguageBar template and if you want to remove it after updating the translation you can do so on this page.


关于HL1/GoldSrc,请查阅liblist.gam.

gameinfo.txt是一个描述起源游戏的配置文件。除了包含诸如模组名称或开发者网站链接之类的元数据外,它还定义了它所依赖的游戏/工具以及引擎用来读取资源的SearchPaths。它位于在MOD的根文件夹中。引擎、SDK工具和Steam都依赖于它。

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

Template:Warning:zh-cn

Note.png注意:布尔值表示为0或1。
Note.png注意:如果一个数值含有空格或者制表,请使用 "引号"进行标注。

界面设置

名字

Game <字符串(en)>
ASCII编码下Mod的名字。用于Steam和游戏窗口标题。只有当Title没有被指定时才用作主界面标题
Title <字符串(en)>
显示在你mod主界面的一串Unicode字符串。你也可以通过添加另一个同名的Title键来换行菜单文本,但要在其上附加2或更高的数字。Template:Note:zh-cn
GameLogo <布尔值(en)> (存在于自 半衰期2:第二章 以来)
在主界面显示resource\GameLogo.res里指定的图标而不是Title里的内容,详见在菜单上添加你的logo


设置

Type <字符串(en)>
这将决定在设置选项里是否会有单人和多人模式,该值一般为MSingleplayer_OnlyMultiplayer_Only。如果您的模组同时具有单人和多人模式,请忽略此键值。
NoDifficulty <布尔值(en)>
隐藏难度设置(如果你的mod是多人游戏的话,该键值将自动生成。)
HasPortals <布尔值(en)> (存在于自 半衰期2:第二章 以来)
显示传送门漏斗选项
NoCrosshair <布尔值(en)>
隐藏多人游戏中的准星设置界面
AdvCrosshair <布尔值(en)>
启用特殊的高级准星设置。Template:Todo:zh-cn
NoModels <布尔值(en)>
隐藏多人游戏的玩家模型设置界面
NoHIModel <布尔值(en)>
隐藏在金源中使用的cl_himodels 切换复选框。只有在cl_himodels首先存在的情况下才会正常显示
Hidden_Maps <subkey(en)>
子键值中的地图名不会出现在“创建服务器”界面中。不过这并不阻止玩家通过控制台读取地图。语法为地图名 1,每行一个条目。不需要包括扩展名,请记住使用 { 和 } 开始和结束子键值。
CommandLine <subkey(en)> (仅存在于 Mapbase 中)
mod的启动参数列表。语法为-launchoption "value",每行一个参数。请记住使用 { 和 } 开始和结束子键值。

Steam游戏相关

影响你的游戏或MOD在Steam库上的显示方式的键值


Developer <字符串(en)> Obsolete
已弃用。 已过时。MOD的开发者。通常是MOD团队的名字,或者作者的名字。在当前的Steam版本上不起作用。
Developer_URL <字符串(en)> Obsolete
已弃用。 Your or the mod's URL. Must start with http://. Doesn't work on current Steam version.
Manual <字符串(en)> Obsolete
已弃用。 URL to the mod's manual; can also be a local file. Doesn't work on current Steam version.
Icon <字符串(en)>
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.png注意:For transparency to work, the TGA must be saved in 32-bit mode with active alpha channel.

其他

hidden_maps <subkey>
被指定的地图将不会成为在"创建服务器"所出现选取地图选项中(但是任然可以使用控制台来创建).
具体的语法是mapname 1,每行只循序有一项.请不要包含.bsp.记得通过{ and }来关闭或者打开子键.
Template:EP2 add
当设置为false的时候组织引擎创建网点图s.
Template:EP2 add
指向FGD文件, 相对于Hammer的路径. 只有编译工具才会使用到,不包括Hammer.
Template:EP2 add
The default location in which to look for instance VMFs.
Template:L4D add
防止游戏运行与DX8以下的版本,因为他不能支持许多游戏特效

安装内容相关

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.png警告:Your mod will not be protected by VAC if it is based on a single-player game.

Commands

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.png提示: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.png警告: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.
Icon-Bug.png错误: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.  [todo tested in ?]
ToolsAppId <int>
This is the AppID of the SDK currently in use. Currently, the only valid ID is 211 (the Source SDK).
待完善: What about the L4D Authoring Tools?

SearchPaths

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:

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

Localization

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.

待完善: Does this also apply for the mod folder?

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

Example

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

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

	SearchPaths
	{
		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.

Editing the game info with XBLAH's Modding Tool

The mod information can be edited with XBLAH's Modding Tool through a comprehensive UI without requiring the modder to mess with text files. It includes all the major keys of Source SDK 2013 Single-player and Source SDK 2013 Multi-player, more than enough for the majority of Source modders.

This can be accessed within the tool through Modding > Game info.

External links