Fr/Compiling a model: Difference between revisions

From Valve Developer Community
< Fr
Jump to navigation Jump to search
Line 11: Line 11:


La seul étape que vous devez faire avant de compilé est de choisir le dossier [[VPROJECT]] actuel. Les modèles seront compiler dans le dossier du jeux choisie. Vous pouvez le configurez ainsi :
La seul étape que vous devez faire avant de compilé est de choisir le dossier [[VPROJECT]] actuel. Les modèles seront compiler dans le dossier du jeux choisie. Vous pouvez le configurez ainsi :


#Globalement, en selectionnant votre jeux\mod dans la liste de démarage du SDK.  
#Globalement, en selectionnant votre jeux\mod dans la liste de démarage du SDK.  

Revision as of 01:25, 9 June 2009

Les modèles ont besoins d'être compilées pour être utilisé dans Source. Trois éléments interviennent afin d'obtenir un modèle compilé :

  1. Plusieurs fichiers SMD decrivant le modèles. Voir Exporté un modèles pour plus d'informations.
  2. Un fichier texte QC qui définie comment sera interprété les fichiers SMD lors de la compilation.
  3. Studiomdl, le programme fournie avec le SDK pour compilé vos modèles.


Mise en place

La seul étape que vous devez faire avant de compilé est de choisir le dossier VPROJECT actuel. Les modèles seront compiler dans le dossier du jeux choisie. Vous pouvez le configurez ainsi :

  1. Globalement, en selectionnant votre jeux\mod dans la liste de démarage du SDK.
Icon-Bug.pngTemplate:Dictionary/Bug/fr:Ne fonctionne pas sous Sutdiomdl et les utilitaire en ligne de commandes à moins d'avoir les droits administrateurs.  [todo tested in ?]
  1. Pour Studiomdl seulement, en démarrant avec -game "<chemin complet vers le dossier de votre gameinfo.txt>"
Tip.pngAstuce:La plupart des outils SDK accepte -game.


Syntax highlighting

Editing a QC file becomes much easier when you use an advanced text editor with support for syntax highlighting. There are two editors with QC highlighting rules at the moment:

Creating a QC

A QC file is simply a text file with the extension .qc. You can create it anywhere and name it anything, but it's best to be organised and store it with your SMDs in a folder with the same name as the destination model file.

Inside it should be a list of commands that tell studiomdl about the location of the model's various SMDs, where the compiled files should be written to (relative to VPROJECT), how to process animations, and potentially much, much more. You will find all known commands listed at Category:QC Commands.

Example

File locations

The default location for SMDs is the same folder as the QC file. You can access other locations:

  • With an absolute path (e.g. C:\modelsrc\my_model\)
  • With a relative path (e.g. .\subfolder or ..\)
    Tip.pngAstuce:A single period is the current folder. Two periods is the one above it. ..\..\ goes two levels up.
  • With $pushd and $popd.

Here is a very simple QC file for a solid model without any animation or special properties (click on each command for details):

$modelname	"props_sdk\myfirstmodel.mdl"
$body mybody	"myfirstmodel-ref.smd"
$staticprop
$surfaceprop	combine_metal
$cdmaterials	"models\props_sdk"

$sequence idle	"myfirstmodel-idle.smd" loop fps 15

$collisionmodel	"myfirstmodel-phys.smd" { $concave }

You will be able to use this as a template to compile your own model, so swap in your own SMDs and see what happens.

Note.pngNote:All models must have at least one $sequence, even if they aren't actually animated.

Tutorials

Compiling

With your text editor

The easiest way to compile a model is with the built-in launch features of advanced text editors.

With a batch file

If you can't (or don't want to) use an advanced text editor, you will be compiling QCs by dragging them onto studiomdl in Windows. You can find the executable file in sourcesdk/bin/[orangebox|ep1]/bin/.

The process will be easier if you create a .cmd file somewhere more accessible to automate it. This is simply a renamed .txt file containing something like this:

"%sourcesdk%/bin/orangebox/bin/studiomdl" "%1"
pause

Drop your QC file onto the CMD as you would studiomdl itself; it's essentially a shortcut to the executable.

Common errors

SDK samples

The SDK has numerous sample models, including several fully-articulated characters and players. They can be found at sourcesdk_content\<game>\modelsrc\.

cstrike
"Urban CT" player model
Several static props
generic
A tweaked ValveBiped rig (no meshes)
hl2
Airboat and Buggy
Antlion Guard
Male citizen (only has a few animations)
Some CS stuff that is probably a duplicate of \cstrike's content
Viewmodels for all HL2 weapons
hl2mp
All with multiplayer animations only:
Combine soldier
Metrocop
Male rebel

See also

Template:Otherlang:en Template:Otherlang:en:ru