Es/Gameinfo.txt

From Valve Developer Community
< Es
Revision as of 16:18, 16 October 2008 by Nihilistik (talk | contribs)
Jump to navigation Jump to search

El archivo GameInfo.txt describe las herramientas SDK y el Source Engine cuyo contenido es necesario para un mod particular o un juego. Es a través de el como las herramientas y el motor saben cargar contenido Half-Life 2, Counter-Strike, o Half-Life 2: Deathmatch cuando están funcionando en el directorio de juego del mod. También es un marcador que las herramientas usan para encontrar tu directorio de juego.

Note.pngNota:Para Half-Life 1 (GoldSrc), ver The liblist.gam File Structure.

Solo un programador configurando un proyecto de mod correctamente muy al comienzo necesitará alguna vez necesitara editar este archivo. En la mayoría de casos, no necesitarás hacerlo, pero si quieres que tu juego esté basado en otro contenido que Half-Life 2, entonces necesitarás modificarlo. Una vez este archivo esté configurado para tu mod, debería ser usado con el resto del contenido del mod. El mismo archivo gameinfo.txt debe ubicarse en el directorio de juego de todos los desarrolladores que trabajan en el mod.

Configuraciones UI

Muchas configuraciones UI, incluyendo el título de tu juego, estan identificadas por gameinfo.txt. Claves incluidas:


Note.pngNota:Valores Booleanos están representados como enteros.
//Informacion General 
game		"Game Title"		// Esto es lo que se presenta en el menú de Steam.
gamelogo	boolean			// En lugar de mostrar el texto title/title2, 
					// el cambio esta en que mostrar el contenido en
					// resource/GameLogo.res donde está el texto.
					// Los controles están cargados en el VGUI del motor, asi que
					// solo puede ser soft-modded usando el archivo gamelogo.

title		"Game Title"		// Esto es lo que normalmente se presenta en el menu del juego.
title2		"..."			// Omitible.
type		singleplayer_only	// También puede ser multiplayer_only. Ayuda a GameUI a saber
					// que elementos UI crear en el panel de Opciones. Omitir 
					// para mods con ambos modos de juego MP y SP.
					// Si lo estableces amultiplayer_only, la 
					// pestaña multiplayer se añadirá primero, de lop contrario 
					// será añadida al final sino singleplayer_only.
nodifficulty	boolean			// Oculta la pestaña de dificultad en el Panel de Opciones.
hasportals	boolean			// Muestra la pestaña Portal en el Panel de Opciones.

//Pestaña Multiplayer en el Panel de Opciones.
nocrosshair	boolean			// Oculta el panel de selección de crosshair.
nohimodel	boolean			// Oculta el checkbox toggles cvar para cl_himodels
					// Solo es presentada correctamente si cl_himodels esta registrada
nomodels	boolean			// Oculta el menú de selección de modelo en la
					// Pestaña Multiplayes del Panel de Opciones.

//Lista de Juegos Steam
developer	"Team name"		// El nombre de tu equipo(o el tuyo!)
developer_url	"Web address"		// La web de tu equipo. Debe empezar con http://.

manual		"URL"			// La URL al manual del juego; pede ser local.
					// Un instalador puede ser diseñado para establecer este 
					// valor al directorio correcto tras la instalación.

icon		"path/to/icon"		// El icono debe ser un TGA de 16x16px no comprimido.
					// Por razones de transparencia al trabajo, el TGA se deben guardar en modo 32-bit 
					// con un canal activo de alpha. La ruta es relativa al 
					// directorio de instalación del mod. (i.e. La ubicación de gameinfo.txt)
					// y no debe incluir la extensión del archivo TGA.

//Cuadro de dialogo de "Crear Server"
hidden_maps				// Los mapas entre los parentesis no aparecerán en 
{					// la intefaz, pero todavía son accesibles accessible 
		"mapname" 1		// via la lista autocomplete 
		"mapname" 1		// y los comandos changelevel.
}

nodegraph	boolean			// Permite al motor sabes si generar i no nodegraphs para mapas.

Cuando hagas por primera vez un nuevo mod, en el gameinfo.txt falta el título ("title") y los tipos de clave ("type keys"), asi que asegurate de añadirlos.

Note.pngNota:Es probable que su título no se presente correctamente hasta que no edite el archivo resource/clientscheme.res para cambiar la fuente del título. Half-Life 2 usa una fuente especialmente realizada ("HalfLife2") que solo tiene un conjunto específico de caracteres; Esta fuente no mostrará la mayoría de textos correctamente. Cambia la fuente listada bajo ClientTitleFont en clientscheme.res para arreglar este problema.

SteamAppId

La principal cosa relevante en el archivo GameInfo.txt es la variable SteamAppId. Si miras dentro de GameInfo.txt, verás una sección que parece algo así:

SteamAppId 215 //ESto montará todos los CFG's que necesites (240=CS:S, 220=HL2).

El valor SteamAppId especifica que contenido de juego (i.e. archivos GCF) es accesible al juego.

Note.pngNota:All mods should use the mod-dedicated 215 AppId unless there is a specific need for another, such as 218 to load the Orange Box Source Engine.
Warning.pngAviso:Be careful when choosing which games on which to base your mod. You will not be able to rely on unshared content from other games.
Warning.pngAviso:To VAC-protect your multiplayer mod, be sure to base it on a multiplayer game. HL2DM is usually a good choice.

The SteamAppId values for the core Source games can be found at Steam Application IDs. Shared GCFs will have 'shared' in their filename and can always be accessed; everything else is private to the game in question.

FileSystem

This section describes various components of FileSystem in detail

ToolsAppId

All GameInfo.txt files should contain a line like this:

ToolsAppId 211	//Tools will load this (ie: source SDK caches) to get
		//things like materials\debug, materials\editor, etc.

This is a special case that tools use so they can load special content that is used by the tools, but is not used by the games.

SearchPaths

The SearchPaths section of the GameInfo.txt file describes where the content is to be found, either on your hard drive or inside Steam cache files. To understand this part, we must take a detour into how programmers using the Source engine access the game's files. All files that a programmer accesses in code must exist under a path ID. A path ID describes one or more locations on your hard drive or inside virtual Steam file systems.

As an example, most of your game's resources like scripts, sounds, model files, and materials are accessed under the "Game" path ID. A programmer might say, "open a file called scripts\weapon_m4a1.txt inside the 'Game' path ID". If you were running a mod in C:\MyMod\Blasters, and you used SteamAppId 240 which would load in the Counter-Strike: Source content, then it would look for the file in these locations:

  • C:\MyMod\Blasters\scripts\weapon_m4a1.txt
  • <Steam install directory>\Steam\SteamApps\username\Counter-Strike Source\cstrike\scripts\weapon_m4a1.txt
  • <inside the virtual Steam file system>\cstrike\scripts\weapon_m4a1.txt

Using path IDs to describe where the files are saves the programmer and artist from having to worry about all these different directories. They can use names relative to the game directory (like scripts\weapon_m4a1.txt or materials\brick\brickwall001a.vmt) and the engine and tools will find the full path to the file wherever it exists, as long as GameInfo.txt describes what the "Game" path ID means.

Inside the GameInfo.txt file, there is a section called "SearchPaths", which describes the path IDs. Most mods will never need to modify the way these are setup from the way they are created when you run Create a Mod from the SDK launcher.

The first part of each line is the name of the path ID, and the second part is where to look for files when this path ID is used. A simple example, which is illustrative, but you would never use (because it uses absolute paths including drive letters, which you can never assume exist on a user's machine) is this:

SearchPaths
{
	TestPathID	C:\TestMod1
	TestPathID	C:\TestMod2
	TestPathID	C:\TestMod3
}

If a programmer were to write code that asked for scripts\weapon_m4a1.txt and specify "TestPathID" as the path ID in code, then the engine would look for the file in these locations:

  • C:\TestMod1\scripts\weapon_m4a1.txt
  • C:\TestMod2\scripts\weapon_m4a1.txt
  • C:\TestMod3\scripts\weapon_m4a1.txt

Since the Source games access most of their content in the "Game" path ID, they do some things for you automatically if you have a path ID called "Game". For each entry with a path ID of "Game":

  1. It adds a "GameBin" path ID, in <dir>\bin
  2. It adds another "Game" path in front of it with _<language> at the end. For example: c:\hl2\cstrike would get a c:\hl2\cstrike_french path added to it if you were running on a French-localized machine.

For the first "Game" search path:

  1. It adds a search path called "MOD" under the same folder.
  2. It adds a search path called "DEFAULT_WRITE_PATH".

The default SearchPaths that would be used in most mods are like this:

SearchPaths
{
	Game        |gameinfo_path|.
	Game        hl2
}

Normally, a path specifier (the part on the right side) is relative to the base directory --The directory where hl2.exe is found. If |gameinfo_path| precedes the path, then it is relative to the directory where GameInfo.txt file instead. For example, if the GameInfo.txt file were in C:\MyMod\Blasters, and it had a path like |gameinfo_path|SomeTestDirectory, then the path ID you were creating would refer to:

C:\MyMod\Blasters\SomeTestDirectory

For Counter-Strike: Source, the GameInfo.txt file has a SearchPaths section that looks like the one above. If your Counter-Strike directory was:

C:\Program Files\Valve\Steam\SteamApps\username\Counter-Strike Source

then it would be saying to look in these two directories:

  • C:\Program Files\Valve\Steam\SteamApps\username\Counter-Strike Source\cstrike

because GameInfo.txt exists here.

  • C:\Program Files\Valve\Steam\SteamApps\username\Counter-Strike Source\hl2

which only exists inside a virtual Steam file system. Template:Otherlang:es Template:Otherlang:en, Template:Otherlang:es:ru,Template:Otherlang:es:pl,Template:Otherlang:es:jp