Talk:Compiling a model: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Nesciuse moved page Talk:Multipage Base Pages Temp Storage/Compiling a model to Talk:Compiling a model without leaving a redirect: Moving back to proper place)
 
(23 intermediate revisions by 9 users not shown)
Line 1: Line 1:
==Article Structure ==
== Proposal: Second qc example ==
Compiling a model is a huge subject, too much to do justice to in a single article. May I suggest splitting up this article into a series of tutorials; something like:
Since there are almost two basic (most used) types of models (prop_static / prop_physics) in Source I think it would be helpful to add just a second example qc which handles a prop_physics. [[User:Swot|Swot]] 03:21, 8 June 2012 (PDT)
* '''Compiling a model'''
** section 1 : Welcome to [[studiomdl|StudioMDL]] ... (and mention 3rd-party interfaces to StudioMDL: [[studiocompiler|StudioCompiler]], [[GUIStudioMDL]]).
** section 2 : Workspace filestructure (note : this should correspond with [[Model Creation Overview]] Workflow & Workspace  ... ?)
** section 3 : Intro to QC syntax : where to use "quotes", {curly brackets}, linebreaks, filepaths, etc, etc. (plus mention recommended [[text editor]]s.)
** section 4 : Examples : list of links to annotated example QCs (preferably from Valve GCF) chosen to illustrate/template common cases, or specific features eg:
*** "QC example: simple static_prop"
*** "QC example: simple physics_prop"
*** "QC example: exploding physics_prop"
*** "QC example: viewmodel" (animated)
*** "QC example: skybox model"
*** "QC example: ragdoll model"
*** etc.
** section 5 : Troubleshooting : where to find the StudioMDL compile log ''plus'' link(s?) to article/category: '''StudioMDL error messages''' (what they mean and what to do about them)
(updated --[[User:Beeswax|Beeswax]] 05:38, 26 Apr 2008 (PDT))


:Separate articles for compiling more complex models is my intention, but that doesn't mean that the fundamentals explained in this one should be moved away. --[[user:TomEdwards|TomEdwards]] 10:13, 25 Apr 2008 (PDT)
== Programmer's Notepad use ==
:: How about just using some annotated examples of common types of QC that can be used as templates. The nice thing is to document a new or "advanced"  feature, just create a new example QC to illustrate it, and add it to the link-list on this page. IMO alot of people get bogged down trying to write comprehensive tutorials, when a well chosen (and helpfully annotated) example is easier all round. The more I think about it, the more I like the idea. --[[User:Beeswax|Beeswax]] 19:32, 25 Apr 2008 (PDT)
:::That, too, is my intention. --[[user:TomEdwards|TomEdwards]] 00:14, 26 Apr 2008 (PDT)


:"Intro to QC syntax" should IMO be handled with a combination of a generic "Intro to VDF" article and the individual QC command articles. --[[user:TomEdwards|TomEdwards]] 10:13, 25 Apr 2008 (PDT)
Is there any way to use Programmer's Notepad (http://www.pnotepad.org/) for work with .qc-files? Meaning, is it possible without really great efforts. I checked it's profiles ("schemes") already and - they are not compatible with those of Notepad++ (so if one wants to use PN, then creating a scheme is necessary).


:: I was thinking of a brief "Intro to QC Syntax" as a way to help prevent silly compile errors from the outset ;-) It would probably make sense to include a brief QC example - such as the current example - with handy tips on filepath issues (eg [[$cd]]). It might be worth considering building the "Intro to VDF" as templates, so they can be easily reused locally ? --[[User:Beeswax|Beeswax]] 19:32, 25 Apr 2008 (PDT)
== model and material path issues? ==
:::Maybe that would be good for the category page? --[[user:TomEdwards|TomEdwards]] 00:14, 26 Apr 2008 (PDT)
I've been following the directions here to make a model, but I can only get the model to load directly from the models/ directory, and the texture to load from the materials/ directory. (cdmaterials and all subdirectory commands don't work)
:::: Hmm good point, but the category:QC Commands is a reference list of StudioMDL parameters, whereas this article is more of a "getting started" guide - now I'm hesitating to use the word "tutorial" ! :-) I think "Intro to QC Syntax" should not be very far from (a) "StudioMDL error messages" page/category, (b) QC Tutorial Examples, (c) QC Filepaths explanation. If "Compiling a model" is a basic orientation guide, containing general info which applies to all specific (eg phys-prop, static-prop) tutorials, I think it would be the best place to have "QC Filepaths" and "QC Syntax" info. --[[User:Beeswax|Beeswax]] 05:38, 26 Apr 2008 (PDT)
Anyone else having these kinds of issues?


: I also intend to deck out the QC commands category with the table layout found in the top-level cats. This evening's and tomorrow's job, incidentally, is getting animation export and compile written up. :-) --[[user:TomEdwards|TomEdwards]] 10:42, 25 Apr 2008 (PDT)
== Glitchy Model ==


=== HLMV-generated QC blocks ===
I created a model, you know, modelled it, exported SMD's, compiled, etc., but when I try to put it in hammer as a prop_static it just doesn't show up, and when I place it as a prop_physics (which it really shouldn't be) it won't let me pick it up. In addition, when I touch it so as to "wake" it, the game crashes. I'm stunped as to what's going on. Please help!
This is not something I've ever used, but it seems like a pretty handy, and frequently recommended "QC Wizard" ;-) I guess any introduction to "Compiling a model" should mention this, and other GUIStudioMDL packages. --[[User:Beeswax|Beeswax]] 09:40, 6 May 2008 (PDT)


=== StudioMDL error messages ===
Below is my qc file in case it helps:
In order to make error message info easily available to the site search engine (so you just copy whatever error message you got into the search box and click go) we could either:
* break out each error message to its own article - although it must be said that some "fixes" will benefit from a common context, or
* create a #REDIRECT article for each error message, which points to the relevant article such as this one. --[[User:Beeswax|Beeswax]] 07:12, 25 Apr 2008 (PDT)


== File Paths ==
<code>
:What happens if you want to make a model for your own mod? This article says nothing about making models for your own models in your own mod except for models in cstrike or hl2mp etc.
//
--[[User:Mflux|Mflux]] 22:23, 13 Jul 2006 (PDT)
$modelname Elevator_Button/Elevator_Button.mdl
$cdmaterials models/Elevator_Button
$staticprop
$scale 2.0
$body studio "Elevator_button_ref.smd"
$texturegroup "Elevator_button"
{
    { "Elevator_button" }
    { "Elevator_button_skin_01" }
    { "Elevator_button_skin_02" }
    { "Elevator_button_skin_03" }
    { "Elevator_button_skin_04" }
    { "Elevator_button_skin_05" }
    { "Elevator_button_skin_06" }
    { "Elevator_button_skin_07" }
    { "Elevator_button_skin_08" }
    { "Elevator_button_skin_09" }
    { "Elevator_button_skin_10" }
    { "Elevator_button_skin_11" }
    { "Elevator_button_skin_12" }
    { "Elevator_button_skin_13" }
    { "Elevator_button_skin_14" }
    { "Elevator_button_skin_15" }
    { "Elevator_button_skin_16" }
}
$sequence idle "Elevator_button_idle.smd"  fps 15
</code>
:First thing I'd try is removing $texturegroup there. I've never seen a model with that many. --[[user:TomEdwards|TomEdwards]] 14:32, 5 May 2009 (UTC)
::Well, I need all of them because it's an elevator button, and I want a specific one for each floor, with on and off skins. It would take too long to make an individual model for each, and I have no idea if there's a way other than skinning to make them appear "on." [[User:Subject15837|Subject15837]] 20:00, 5 May 2009 (UTC)
:::Can't you run a test compile just to see what happens? --[[user:TomEdwards|TomEdwards]] 14:27, 6 May 2009 (UTC)
::::A test compile? Of the map, or the model? Because if you mean the model, then my problem is not that I don't want to compile it, it's that I don't know qc commands well enough to find a way to do it.
:::::Make a new QC and paste this into it:
<pre>$modelname Elevator_Button/Elevator_Button.mdl
$cdmaterials models/Elevator_Button
$staticprop
$scale 2.0
$body studio "Elevator_button_ref.smd"
$sequence idle "Elevator_button_idle.smd"  fps 15</pre>
:::::Then see if that works. --[[user:TomEdwards|TomEdwards]] 13:23, 7 May 2009 (UTC)


:: If you want to follow the 'file structure etiquette' (see [[Source SDK Files and Directory Structure]].) you would use <code>C:\Program Files\Valve\Steam\SteamApps\SourceMods\mod_game_directory\modelsrc</code> ... if there isn't a <code>modelsrc</code> folder there already, just create one. So what you should have is:
==NoGameDir error==
When I try to compile my model with the studiomdl.exe it just gives this error:


SteamApps\SourceMods\mod_game_directory\modelsrc\your.SMD
''Unable to find gameinfo.txt. Solutions:
            "          "              "        \your.QC
SteamApps\SourceMods\mod_game_directory\materialsrc\models\your.TGA
            "          "              "          "      \your.VMT
SteamApps\username\sourcesdk\bin\ep1\bin\Studiomdl
            "          "            "  \Vtex
SteamApps\username\sourcesdk\bin\orangebox\bin\Studiomdl
            "          "              "      \Vtex


:: However, to me it seems more convenient to use a single desktop folder for 'temporary' files (TGA, SMD, QC) and Shortcuts to the compilers (Studiomdl & [[Vtex]], or [[Studiocompiler]]) instead of spreading them all over. e.g.
1. Read http://www.valve-erc.com/srcsdk/faq.html#NoGameDir
2. Run vconfig to specify which game you're working on.
3. Add -game <path> on the command line where <path> is the directory that gameinfo.txt is in.''


Desktop\Source1Modelling\your.SMD
Samekind of error comes with [[Studiocompiler]].  
    "      "      "    \your.QC
Please can anyone help me?
    "      "      "    \your.TGA
--[[User:Nom1nator|nom1nator]] 16:56, 11 June 2009 (UTC)
    "      "      "    \your.VMT
:When did you last run the SDK launcher, and is it set to the correct game?
    "      "      "    \Shortcut_to_ep1_Studiomdl
:: Hmm, I have just runned SDK from steam, not the launcher. What I should do? --[[User:Nom1nator|nom1nator]] 17:18, 11 June 2009 (UTC)
    "      "      "    \Shortcut_to_ep1_Vtex
::: Now I got it work, but how I get the textures work? --[[User:Nom1nator|nom1nator]] 19:01, 13 June 2009 (UTC)


::The important thing is that the final, compiled MDL, VMT and VTFs go in the correct <code>game_directory</code> folders, which the compilers will do automatically if your '''SDK Tools -> Current Game''' is set to whichever game you're compiling for. [[User:Beeswax|Beeswax]] 07:34, 11 Nov 2007 (PST)
==plz help==
i got this error:
Error opening c:\program files (x86)\steam\steamapps\alooy6\sourcesdk_content\hl
2\(x86)\steam\steamapps\alooy6\sourcesdk_content\hl2\flufy.qc


What are important -
what do i do? --[[User:Lazy genius|Lazy genius]] 01:25, 13 June 2009 (UTC)
* Put .smd files and .qc files in a same directory.
:As you can probably see, <code>(x86)\steam\steamapps\alooy6\sourcesdk_content\hl2\</code> repeats itself. Try moving the QC to a location without a space in it. --[[user:TomEdwards|TomEdwards]] 10:22, 13 June 2009 (UTC)
* To write .mdl into your mod directory, set Current Game to your mod, or use -game option pointing to your game directory.


::Note you have made your Mod using '''Mod Wizard''', you'll get your mod source directory with modelsrc and a .bat invoking studiomdl for your mod. I usually use this studiomdl.bat(which has -game option) to compile my mod models. I export .smd files from XSI, write the .qc in the same directory, then drag .qc into the .bat file - then I can get my .mdl. (If there is no error present!) --[[User:N-neko|n-neko]] 01:43, 1 Dec 2006 (PST)
== Unable to find the .smd file ==


Are you sure studiomdl.exe is supposed to be in the sourcesdk\bin directory. That .exe isn't in that folder for me, I had my friend check, same thing. Whats going on? --[[User:BlackCow|BlackCow]]
When i try to compile the model, he don't want because he do not find the smd. But I've put in the models folders
:In the [[Source SDK Release Notes|latest version]] (actually, in ''both'' '''beta''' or '''non-beta''' versions) of the Source SDK, there are two sets of tools (one of which is studiomdl.exe): one for Episode 1 engine games, and another for "Orange Box" (the most recent) engine games.
:For each of those sets of tools, you can find studiomdl.exe at: <code>...\sourcesdk\bin\'''engine'''\bin\studiomdl.exe</code>, '''engine''' is either '''ep1''' (for episode 1 engine-compatible tools) or with '''orangebox''' (for "Orange Box" engine-compatible tools). --[[User:Etset|Etset]] 04:02, 28 Jan 2008 (PST)


::Well I found the tools but when I go to compile I get this error,
<pre>
::"The procedure entry point ?LockForRead@CThreadSpinRWLock@@QAEXXZ could not be located in the dynamic link libary tier0.dll"  
C:\>"c:\program
::A lot of people are getting this problem I hear, no solutions that seem to work. People just tell me to wait for the next update --[[User:Blackcow|Blackcow]] 22:02, 3 Feb 2008 (PST)
files\steam\steamapps\[username]\sourcesdk\bin\orangebox\bin\studio
:::First thing would be to check if you're using the latest version of the SDK (and if you're using the [[Source SDK Release Notes|'''beta''' version]] of SDK or not). If you're using the beta version you should remove all '-nop4' run parameters you might have added in your shortcuts.
mdl" "C:\MurDroit.qc"
:::I [http://www.google.pt/search?q=%3FLockForRead%40CThreadSpinRWLock&btnG searched google] and found [http://www.interlopers.net/forum/viewtopic.php?f=14&t=21577 this forum thread (@ interlopers]], check if it relates to your problem. --[[User:Etset|Etset]] 11:47, 4 Feb 2008 (PST)
WARNING: AppFramework : Unable to load module p4lib.dll!
qdir:   "c:\"
gamedir: "c:\program files\steam\steamapps\[username]\half-life 2 deathmatch\hl2mp\
"
g_path: "C:\MurDroit.qc"
Building binary model files...
Working on "MurDroit.qc"
ERROR: c:\MurDroit.qc(14): - could not load file 'mur\MurDroit.smd'
ERROR: Aborted Processing on 'mur\MurDroit.mdl'
WARNING: Leaking 1 elements
</pre>


::::'''Huzzah! I got it to compile.'''
:It's looking for <code>C:\mur\MurDroit.smd</code>. Take a look at the "File locations" sidebar in the article. --[[user:TomEdwards|TomEdwards]] 17:48, 15 November 2009 (UTC)
::::My solution,


::::1) Right click Source SDK, in steam, and delete local content.
-Thanks, he compiled the model. it was because i have sometime problem to understand english (i am non-english)
::::2) Install the Source SDK.
::::3) Run the SDK, Select HL2 as your current game.
::::4) Double click, "Refresh SDK content"
::::5) Open the Model Viewer.
::::6) Finally compile your model.
 
::::Some of these steps may be redundant but its exactly what I did to get it to compile. --[[User:Blackcow|Blackcow]] 14:31, 10 Feb 2008 (PST)
 
:::::'''I just want to confrim that:'''
 
:::::1) Right click Source SDK, in steam, and delete local content.
:::::2) Install the Source SDK.
:::::3) Run the SDK, Select HL2 as your current game.
:::::4) Double click, "Refresh SDK content"
:::::5) Open the Model Viewer.
:::::6) Finally compile your model.  
 
:::::'''DOES WORK!!!''' Make sure you have "-engine ep1 -nop4" in your launch options --[[User:-7-t-h-|-7-t-h-]] 18:05, 27 Feb 2008 (PST)
 
I'm having some trouble with this. No matter what I do, I get an error, and studiomdl closes instantly. I don't have time to explain my problems right now, but here's the files. I would greatly appreciate help.
.QC: [http://www.mediafire.com/?f1h43dg1zmq Brick2x4]
.SMD: [http://www.mediafire.com/?73rznrjwbdq Brick2x4]
Someone fix this for me, for I barely have time to make the model. --[[User:Sigfig|Sig]] 16:02, 4 Feb 2008 (PST)
 
==EXCEPTION_ACCESS_VIOLATION==
EXCEPTION_ACCESS_VIOLATION I suspect that message has nothing to do with shadowlod. It' doesn't matter how I write the shadowlod line and it's brackets, or if I delete it entirely, the message does not go away. [[User:Camaron|Camaron]] 07:24, 10 Jun 2007 (PDT)
::I also have this problem. I'm not sure if it's related to the recent SDK update for me or not. I was never using shadowlod to begin with.--[[User:TheDistur|TheDistur]] 12:20, 10 Nov 2007 (PST)
::: For EXCEPTION_ACCESS_VIOLATION, try compiling with the hlmv.exe running --[[User:Xteven.xenderson|Steve Henderson]] 07:01, 24 Dec 2007 (PST)

Latest revision as of 16:09, 15 July 2024

Proposal: Second qc example

Since there are almost two basic (most used) types of models (prop_static / prop_physics) in Source I think it would be helpful to add just a second example qc which handles a prop_physics. Swot 03:21, 8 June 2012 (PDT)

Programmer's Notepad use

Is there any way to use Programmer's Notepad (http://www.pnotepad.org/) for work with .qc-files? Meaning, is it possible without really great efforts. I checked it's profiles ("schemes") already and - they are not compatible with those of Notepad++ (so if one wants to use PN, then creating a scheme is necessary).

model and material path issues?

I've been following the directions here to make a model, but I can only get the model to load directly from the models/ directory, and the texture to load from the materials/ directory. (cdmaterials and all subdirectory commands don't work) Anyone else having these kinds of issues?

Glitchy Model

I created a model, you know, modelled it, exported SMD's, compiled, etc., but when I try to put it in hammer as a prop_static it just doesn't show up, and when I place it as a prop_physics (which it really shouldn't be) it won't let me pick it up. In addition, when I touch it so as to "wake" it, the game crashes. I'm stunped as to what's going on. Please help!

Below is my qc file in case it helps:

//
$modelname Elevator_Button/Elevator_Button.mdl
$cdmaterials models/Elevator_Button
$staticprop
$scale 2.0
$body studio "Elevator_button_ref.smd"
$texturegroup "Elevator_button"
{
   { "Elevator_button" }
   { "Elevator_button_skin_01" }
   { "Elevator_button_skin_02" }
   { "Elevator_button_skin_03" }
   { "Elevator_button_skin_04" }
   { "Elevator_button_skin_05" }
   { "Elevator_button_skin_06" }
   { "Elevator_button_skin_07" }
   { "Elevator_button_skin_08" }
   { "Elevator_button_skin_09" }
   { "Elevator_button_skin_10" }
   { "Elevator_button_skin_11" }
   { "Elevator_button_skin_12" }
   { "Elevator_button_skin_13" }
   { "Elevator_button_skin_14" }
   { "Elevator_button_skin_15" }
   { "Elevator_button_skin_16" }
}
$sequence idle "Elevator_button_idle.smd"  fps 15

First thing I'd try is removing $texturegroup there. I've never seen a model with that many. --TomEdwards 14:32, 5 May 2009 (UTC)
Well, I need all of them because it's an elevator button, and I want a specific one for each floor, with on and off skins. It would take too long to make an individual model for each, and I have no idea if there's a way other than skinning to make them appear "on." Subject15837 20:00, 5 May 2009 (UTC)
Can't you run a test compile just to see what happens? --TomEdwards 14:27, 6 May 2009 (UTC)
A test compile? Of the map, or the model? Because if you mean the model, then my problem is not that I don't want to compile it, it's that I don't know qc commands well enough to find a way to do it.
Make a new QC and paste this into it:
$modelname Elevator_Button/Elevator_Button.mdl
$cdmaterials models/Elevator_Button
$staticprop
$scale 2.0
$body studio "Elevator_button_ref.smd"
$sequence idle "Elevator_button_idle.smd"  fps 15
Then see if that works. --TomEdwards 13:23, 7 May 2009 (UTC)

NoGameDir error

When I try to compile my model with the studiomdl.exe it just gives this error:

Unable to find gameinfo.txt. Solutions:

1. Read http://www.valve-erc.com/srcsdk/faq.html#NoGameDir 2. Run vconfig to specify which game you're working on. 3. Add -game <path> on the command line where <path> is the directory that gameinfo.txt is in.

Samekind of error comes with Studiocompiler. Please can anyone help me? --nom1nator 16:56, 11 June 2009 (UTC)

When did you last run the SDK launcher, and is it set to the correct game?
Hmm, I have just runned SDK from steam, not the launcher. What I should do? --nom1nator 17:18, 11 June 2009 (UTC)
Now I got it work, but how I get the textures work? --nom1nator 19:01, 13 June 2009 (UTC)

plz help

i got this error: Error opening c:\program files (x86)\steam\steamapps\alooy6\sourcesdk_content\hl 2\(x86)\steam\steamapps\alooy6\sourcesdk_content\hl2\flufy.qc

what do i do? --Lazy genius 01:25, 13 June 2009 (UTC)

As you can probably see, (x86)\steam\steamapps\alooy6\sourcesdk_content\hl2\ repeats itself. Try moving the QC to a location without a space in it. --TomEdwards 10:22, 13 June 2009 (UTC)

Unable to find the .smd file

When i try to compile the model, he don't want because he do not find the smd. But I've put in the models folders

C:\>"c:\program
files\steam\steamapps\[username]\sourcesdk\bin\orangebox\bin\studio
mdl" "C:\MurDroit.qc"
WARNING: AppFramework : Unable to load module p4lib.dll!
qdir:    "c:\"
gamedir: "c:\program files\steam\steamapps\[username]\half-life 2 deathmatch\hl2mp\
"
g_path:  "C:\MurDroit.qc"
Building binary model files...
Working on "MurDroit.qc"
ERROR: c:\MurDroit.qc(14): - could not load file 'mur\MurDroit.smd'
ERROR: Aborted Processing on 'mur\MurDroit.mdl'
WARNING: Leaking 1 elements
It's looking for C:\mur\MurDroit.smd. Take a look at the "File locations" sidebar in the article. --TomEdwards 17:48, 15 November 2009 (UTC)

-Thanks, he compiled the model. it was because i have sometime problem to understand english (i am non-english)