Портирование контента из Goldsource в Source
This page either contains information that is only partially or incorrectly translated, or there isn't a translation yet.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article tries to comply with the alternate languages guide.
Перенос Goldsource моделей на Source движок является коротким процессом. Для достижения наилучших результатов, все файлы должны быть готовы оригинальный 3D-файл пакета, текстуры, и QC. файл. SMD файлы также могут быть полезны, если исходный файл 3d пакет недоступен.
По большей части, перенос моделей прост: установите свойство VPROJECT должным образом, преобразуйте старые текстуры в VTF формат, настройте QC файл, включив новый синтаксис иSource, а затем скомпилируйте содержание в модель Source.
Set VPROJECT
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
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.
First, convert all old texture files to .TGA format, using Photoshop or a similar image editing application.
- Create a shortcut to vtex.exe on your desktop. Vtex.exe is located in the SourceSDK\bin directory.
- Right-click the shortcut and select the "Properties" option.
- 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.
Export .SMD files
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
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 toC:\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 directoryC:\Program Files\Valve\Steam\SteamApps\SourceMods\MyMod\materials\models\player
.
Create a Collision Model (Physbox)
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.
The automatically generated collision hull would connect all the most extended parts directly.
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
The actual process of compiling hasn't changed outside of Studiomdl using VPROJECT. To associate .QC files with Studiomdl for double-click compiling:
- Open a Windows Explorer. (Windows Key + E)
- At the top of the window, click "Tools", then "Folder Options...".
- 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.
- Click the QC extension. It should become highlighted.
- In the "Details for 'QC' extension" area of the "Folder Options" panel, click the "Change..." button to the right of the text "Opens with:".
- Click the "Browse..." button at the bottom right of the "Open With" panel.
- Browse to the file "studiomdl.exe" in the SDK tools. Click the "Open" button.
- Make sure that "studiomdl.exe" is highlighted in the "Open With" panel. Click the "OK" button.
- 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
Альтернативный способ портировать старые модели в Source - использовать kHED .
- Для начала необходимо получить текстуры модели. Это можно сделать двумя способами:
- Откройте модель в Jed's Half-life Model Viewer
- перейдите на вкладку "textures"
- Выберите нужную текстуру и экспортируйте её при помощи функции "Export texture".
- Вы также можете получить текстуры, декомпилировав модель.
- Откройте модель в Jed's Half-life Model Viewer
- Откройте kHED и перейдите в File > Import > Half-life Model (.mdl)
- В открывшемся окне найдите свою модель и нажмите Открыть.
- теперь перейдите в File > Export и выберите подходящий формат для экспорта (Поддерживаемые для жкспорта форматы: .obj, .3ds, .ms3d , Half-life .smd и Half-life .mdl .
- Теперь просто откройте экспортированный файл в 3d-редакторе , текстурируйте и экспортируйте в Source.
Портирование карты GoldSRC в Source
Hammer поддерживает такие форматы файлов, как .rmf и .map , поэтому вам нужно лишь декомпилировать карту GolSRC или использовать исходный файл, если он есть. Однако, при использовании этого способа вам придётся вручную исправлять текстуры и сущности на уровне, но это можно сделать автоматически, использовав MapFool .
См. также
Портирование GoldSRC контента (карт, моделей и т.д.) в Source Engine