Ru/Game directory: Difference between revisions

From Valve Developer Community
< Ru
Jump to navigation Jump to search
No edit summary
 
Line 2: Line 2:
<!-- О-о-очень криво, но у меня по-другому не получилось без существенного объема отсебятины. Setting up a proper game development environment is critically important when making MODs and content for the Source Engine. The most important aspect of the game environment is determining the location of the game directory. This document explains what the game directory is, and how it is used..-->  
<!-- О-о-очень криво, но у меня по-другому не получилось без существенного объема отсебятины. Setting up a proper game development environment is critically important when making MODs and content for the Source Engine. The most important aspect of the game environment is determining the location of the game directory. This document explains what the game directory is, and how it is used..-->  


=What is the game directory?=
=Что из себя представляет директория игры и зачем она нужна?=


The '''game directory''' is the folder that the tools refer to when they are looking for a game's content. For example, the Hammer Editor needs to know where it can find your materials so it can display them. <code>Studiomdl</code> will compile a model, but it needs to know where to place the compiled model files. <code>Vrad.exe</code> will light a map, but it needs to know where to find prop models so it can load them and determine how they block light. None of the SDK tools will run unless they can find your game directory.
'''Директория игры''' это та папка, к которой обращается инструментарий, когда ищет на компьютере контент игры. К примеру, Hammer Editor'у нужно знать, где искать ваши материалы, чтобы он мог их отобразить. <code>Studiomdl</code> скомпилирует вашу модель, но он должен знать, куда следует записать скомпилированные файлы. Программа <code>Vrad.exe</code> рассчитывает освещение уровня, а для этого она должен знать, где можно взять модели prop'ов, чтобы загрузить их и определить, как они заслоняют свет от источников на уровне. Ни один инструмент из SDK не запустится, если не найдет вашу директорию игры.


Examples of the game directory for the core Source games:
Примеры папок с игрой для основных Source-игр:


{|
{|
Line 16: Line 16:
|}
|}


In the following examples, we're going to refer to the game directory as <code>C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod\Blasters</code>. This would be the case if you selected '''Create a Mod''' in the SDK launcher, entered <code>C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod</code> as the directory, and entered <code>Blasters</code> as the mod name.
В последующих примерах мы будем упоминать игровую директорию как <code>C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod\Blasters</code> . Такой она будет, если выбрать в SDK-launcher'е опцию '''Create a Mod''', и вести в качестве директории <code>C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod</code>, а в качестве имени мода — <code>Blasters</code>.


One way to determine the game directory of your game is to look for a file called <code>GameInfo.txt</code>. If you find the GameInfo.txt file, then the directory it sits in is the game directory. In the example above, if you had created <code>C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod\Blasters</code>, there would be a file on your hard drive called <code>C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod\Blasters\GameInfo.txt</code>. Once you've found the game directory, you need to tell the SDK tools where that directory is.
Один из способов определить игровую директорию вашей игры  — найти файл  <code>GameInfo.txt</code>. Папка, в которой он лежит, и есть директория игры. В примере выше, если создать <code>C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod\Blasters</code>, в этой папке на вашем жестком диске будет файл <code>C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod\Blasters\GameInfo.txt</code> . Как только вы нашли директорию, нужно указать инструментам SDK, где она находится.


For information on how <code>GameInfo.txt</code> can be created for your own MOD, and how the contents are used, see [[The GameInfo.txt File Structure|GameInfo.txt File Structure]].
За информацией по поводу того, как можно создать <code>GameInfo.txt</code> для своего мода, и как используется содержимое этого файла, обратитесь к статье [[The GameInfo.txt File Structure:ru|Структура файла GameInfo.txt]].


=Setting the current game directory=
=Setting the current game directory=

Revision as of 14:38, 24 July 2008

Крайне важно создать перед работой над модификацией и контентом для движка Source подходящую среду для игровой разработки. В создании этой среды важнее всего определить расположение директории игры. Этот документ объясняет, что из себя представляет директория игры и как ее использовать.

Что из себя представляет директория игры и зачем она нужна?

Директория игры это та папка, к которой обращается инструментарий, когда ищет на компьютере контент игры. К примеру, Hammer Editor'у нужно знать, где искать ваши материалы, чтобы он мог их отобразить. Studiomdl скомпилирует вашу модель, но он должен знать, куда следует записать скомпилированные файлы. Программа Vrad.exe рассчитывает освещение уровня, а для этого она должен знать, где можно взять модели prop'ов, чтобы загрузить их и определить, как они заслоняют свет от источников на уровне. Ни один инструмент из SDK не запустится, если не найдет вашу директорию игры.

Примеры папок с игрой для основных Source-игр:

Half-Life 2 C:\Program Files\Valve\Steam\SteamApps\username\half-life 2\hl2
Counter-Strike: Source C:\Program Files\Valve\Steam\SteamApps\username\counter-strike source\cstrike
Half-Life 2: Deathmatch C:\Program Files\Valve\Steam\SteamApps\username\half-life 2 deathmatch\hl2mp

В последующих примерах мы будем упоминать игровую директорию как C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod\Blasters . Такой она будет, если выбрать в SDK-launcher'е опцию Create a Mod, и вести в качестве директории C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod, а в качестве имени мода — Blasters.

Один из способов определить игровую директорию вашей игры — найти файл GameInfo.txt. Папка, в которой он лежит, и есть директория игры. В примере выше, если создать C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod\Blasters, в этой папке на вашем жестком диске будет файл C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod\Blasters\GameInfo.txt . Как только вы нашли директорию, нужно указать инструментам SDK, где она находится.

За информацией по поводу того, как можно создать GameInfo.txt для своего мода, и как используется содержимое этого файла, обратитесь к статье Структура файла GameInfo.txt.

Setting the current game directory

The active game directory is set so that all the tools know how to find the game content without having to specify it each time. The Current Game drop-down list on the Source SDK Launcher is the primary way to set the active game directory.

Using the Source SDK Launcher to set the game directory

To set the active game directory with the Source SDK Launcher:

  1. Double-click Source SDK from the Steam Play Games Menu.
  2. Next you must choose the correct Current Game from the Source SDK Launcher.
  3. Now launch one of the SDK tools, such as the Hammer Editor, by double-clicking it.

Set the active game directory from the Source SDK Launcher.

Using VConfig to set the game directory

The VConfig application can also be used to set the active game directory. It provides a similar function to setting the Current Game in the SDK Launcher.

The vconfig.exe application is found in the \sourcesdk\bin directory.

For example, if you installed Steam at C:\Program Files\Valve\Steam, VConfig would be found here:

C:\Program Files\Valve\Steam\SteamApps\username\sourcesdk\bin\vconfig.exe

To set your active game directory with VConfig:

  1. Double-click the vconfig.exe application.
  2. Next you must choose the correct Current Game from the drop-down list.
  3. Click OK.
  4. Now launch one of the SDK tools, such as the Hammer Editor, by double-clicking it.

Set the active game directory using VConfig.

Alternately, you can specify the game directory you wish to use without launching VConfig and choosing from the menu. To do this, simply run VConfig with the command-line parameter -game [directory]. This can be especially useful for setting the game directory in a batch file or other automated process.

For example, the following command would set the game directory to the default Half-Life 2 install path without having to actually launch VConfig:

vconfig -game "C:\Program Files\Valve\Steam\SteamApps\username\half-life 2"

Specifying the game directory on the command line

An alternative method to set the current game directory is to directly specify the directory location on the command line when running each SDK tool. All of the SDK tools support the -game <directory> command line parameter. The advantage to specifying the game directory on the command line is that you are being explicit about where your game's content is to be found.

Here are some examples of running tools where you specify the game directory explicitly:

%sourcesdk%\bin\studiomdl -game C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod\Blasters mymodel.qc
%sourcesdk%\bin\vrad -game C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod\Blasters mymap
%sourcesdk%\bin\hammer -game C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod\Blasters
Note.pngПримечание:If you have spaces in your game directory path, you must use quotation marks around the game directory path:
%sourcesdk%\bin\hammer -game "C:\Program Files\Valve\Steam\SteamApps\username\counter-strike source\cstrike"
%sourcesdk%\bin\vrad -game "C:\Program Files\Valve\Steam\SteamApps\username\counter-strike source\cstrike" MyCstrikeMap

Using the -game command-line parameter to specify the current game directory gives you the advantage of being able to work on multiple games or MODs at once, and change you configurations for each. This can be easily done by making shortcuts to tools such as vtex with the -game parameter built-into the shortcut. When doing this, make sure to add quotes around the game directory path, if the path contains spaces.

Создание иконки инструмента с параметром -game, задающим директорию игры.

Template:Otherlang:ru Template:Otherlang:ru:en, Template:Otherlang:ru:es, Template:Otherlang:ru:pl