Porting GoldSrc content to Source/ru

From Valve Developer Community
Jump to: navigation, search
Info content.png
This page needs to be translated.

Данная страница содержит информацию, которая частично либо некорректно переведена, или здесь вообще нет перевода.

Кроме того, не забудьте использовать русский статье об альтернативных языках.


Кроме того, не забудьте использовать русский словарь переводчика.

Перенос Goldsource моделей на Source движок является коротким процессом. Для достижения наилучших результатов, все файлы должны быть готовы оригинальный 3D-файл пакета, текстуры, и QC. файл. SMD файлы также могут быть полезны, если исходный файл 3d пакет недоступен.

По большей части, перенос моделей прост: установите свойство VPROJECT должным образом, преобразуйте старые текстуры в VTF формат, настройте QC файл, включив новый синтаксис иSource, а затем скомпилируйте содержание в модель Source.

Set VPROJECT

Основная статья:  Game Directory

The VPROJECT variable is referenced by several Source SDK tools: basically, it directs applications where to find or place compiled models (.MDL) and materials (.VTF). Studiomdl and Vtex both use VPROJECT to place compiled models and materials in the correct directory. Half-Life Model Viewer (HLMV) uses VPROJECT to find model materials. To set the VPROJECT (Current Game), use the Source SDK launcher or VConfig.exe.

Convert old textures to new materials

См. также: Material system

In the Goldsource engine, .BMP textures were compiled into the .MDL file. However in the Source engine, developers export textures as .VTF files, which are simply referenced and not actually compiled into the .MDL file.

Originally, in the preliminary release of the Source SDK, developers were confined to using the included command-line exporter Vtex to compile materials. Since then, a variety of community produced tools provide Windows-friendly GUIs and interfaces, batch conversions, and texture previewing. VTFEdit is highly recommended; though there are also other tools available. This tutorial will assume that the user is using Vtex.

Основная статья:  Creating a Material

First, convert all old texture files to .TGA format, using Photoshop or a similar image editing application.

  1. Create a shortcut to vtex.exe on your desktop. Vtex.exe is located in the SourceSDK\bin directory.
  2. Right-click the shortcut and select the "Properties" option.
  3. In the "Target" box, add -mkdir -shader vertexlitgeneric after vtex.exe with a space between them. Click OK.

Use this shortcut when converting new materials by dragging each .TGA file onto the desktop shortcut itself. The argument "-mkdir" will automatically create the materialsrc directory. The argument -shader VertexLitGeneric tells Vtex to automatically make a new .VMT that points to the .VTF as the diffuse texture.

Note.pngПримечание:The VertexLitGeneric shader is only used for models; it should not be used for sprites or brushes. Check the Materials documentation for more info.

Export .SMD files

См. также: Model Creation Overview

If the original 3D model file is lost, use an SMD plug-in (e.g. Valve Addon for Softimage|XSI) and import the .smd directly for editing.

Modify .QC file

Основная статья:  Qc

While old .QC files will work with the new Studiomdl, there have been syntax changes for Source models to compile correctly.

  • $modelname now works in conjunction with VPROJECT and automatically assumes a directory output location of VPROJECT + a 'models' directory. For example: C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod\models. So if $modelname were set to "player\myplayer.mdl", Studiomdl will compile the model and write it to C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod\models\player\myplayer.mdl.
  • Replace $cdtexture with $cdmaterials. $cdmaterials also uses VPROJECT and assumes the output directory to be VPROJECT + 'materials' directory. For example: C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod\materials. Break the material directory tree up based on context - in this case, a model. Keeping the same example as in the $modelname step above, set $cdmaterials to "models\player" so that the model will look for materials in the directory C:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod\materials\models\player.

Create a Collision Model (Physbox)

См. также: Physics and Ragdolls

A "collision model" is the simplified mesh that defines how the model will interact with the world when it is being physically simulated. This document will not cover the details of creating a physbox. While Studiomdl will create a physics hull if one is not specified, the result will be extremely simple. It will not "vacuum seal" the model; it will simply connect all the furthest points of the model together directly. To demonstrate, imagine looking down on a model and that it is shaped like a plus sign.

The most correct collision hull would resemble the plus sign.

Phys demo2.jpg

The automatically generated collision hull would connect all the most extended parts directly.

Phys demo3.jpg

In some cases, it is acceptable if the object is insignificant or does not interact with the player or the game world. However, if the example object were a revolving door, then this physbox would be unacceptable.

Compile the Model

Основная статья:  Compiling Models

The actual process of compiling hasn't changed outside of Studiomdl using VPROJECT. To associate .QC files with Studiomdl for double-click compiling:

  1. Open a Windows Explorer. (Windows Key + E)
  2. At the top of the window, click "Tools", then "Folder Options...".
  3. Click the "File Types" tab then scroll down to QC. If you do not have a QC extension in your list, you can add it by hitting the "New" button below the list, and enter "QC" in the box. Hit "OK" to enter the extension into the list.
  4. Click the QC extension. It should become highlighted.
  5. In the "Details for 'QC' extension" area of the "Folder Options" panel, click the "Change..." button to the right of the text "Opens with:".
  6. Click the "Browse..." button at the bottom right of the "Open With" panel.
  7. Browse to the file "studiomdl.exe" in the SDK tools. Click the "Open" button.
  8. Make sure that "studiomdl.exe" is highlighted in the "Open With" panel. Click the "OK" button.
  9. Close the "Folder Options" panel with the "Close button.

Check the Model with the Half-Life Model Viewer

Find the Half-Life Model Viewer in the "Bin" directory with the rest of the Source SDK tools, and open the model. Some common problems:

  • A black and pink checkerboard texture: the materials are not in the location specified by the .QC file or the materials did not compile correctly (you can check that with hammer for example).
  • Incorrect collision hull: select the "Render" tab and click the "Physics Model" checkbox to view the model's collision hull.

Портирование моделей через kHED

Icon-Bug.pngОшибка:В настоящее время kHED не поддерживает анимацию, поэтому все анимации будут утеряны.

Альтернативный способ портировать старые модели в Source - использовать kHED.

  1. Для начала необходимо получить текстуры модели. Это можно сделать двумя способами:
    1. Откройте модель в Jed's Half-life Model Viewer
      1. перейдите на вкладку "textures"
      2. Выберите нужную текстуру и экспортируйте её при помощи функции "Export texture".
    2. Вы также можете получить текстуры, декомпилировав модель.
  2. Откройте kHED и перейдите в File > Import > Half-life Model (.mdl)
  3. В открывшемся окне найдите свою модель и нажмите Открыть.
  4. теперь перейдите в File > Export и выберите подходящий формат для экспорта (Поддерживаемые для жкспорта форматы: .obj, .3ds, .ms3d, Half-life .smd и Half-life .mdl.
  5. Теперь просто откройте экспортированный файл в 3d-редакторе, текстурируйте и экспортируйте в Source.

Портирование карты GoldSRC в Source

Основная статья:  Porting GoldSRC maps to Source

Hammer поддерживает такие форматы файлов, как .rmf и .map, поэтому вам нужно лишь декомпилировать карту GolSRC или использовать исходный файл, если он есть. Однако, при использовании этого способа вам придётся вручную исправлять текстуры и сущности на уровне, но это можно сделать автоматически, использовав MapFool.

См. также

Портирование GoldSRC контента (карт, моделей и т.д.) в Source Engine