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)
 
(30 intermediate revisions by 10 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 : Workflow overview & Workspace filestructure (note : this should correspond with [[Model Creation Overview]] ... ?)
** section 3 : Recommended [[text editor]] tools (Notepad++ etc)
** section 4 : Intro to QC syntax : where to use "quotes", {curly brackets}, linebreaks, filepaths, etc, etc.


* link to tutorial : '''Compiling a basic static model''' (eg see [[Modeling props with Blender]])
== Programmer's Notepad use ==
* link to tutorial : '''Compiling a basic physics model''' (eg see [[Modeling props with Blender]])
* link to tutorial : '''Compiling a basic Viewmodel'''
* etc.
* link to article/category: '''StudioMDL error messages''' (what they mean and what to do about them)


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).


=== Error Messages ===
== model and material path issues? ==
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:
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)
* break out each error message to its own article - although it must be said that some "fixes" will benefit from a common context, or
Anyone else having these kinds of issues?
* 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 ==
== Glitchy Model ==
: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)


:: 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:
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!


SteamApps\SourceMods\mod_game_directory\modelsrc\your.SMD
Below is my qc file in case it helps:
            "          "              "        \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.
<code>
//
$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)


Desktop\Source1Modelling\your.SMD
==NoGameDir error==
    "      "      "    \your.QC
When I try to compile my model with the studiomdl.exe it just gives this error:
    "      "      "    \your.TGA
    "      "      "    \your.VMT
    "      "      "    \Shortcut_to_ep1_Studiomdl
    "      "      "    \Shortcut_to_ep1_Vtex


::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)
''Unable to find gameinfo.txt. Solutions:


What are important -
1. Read http://www.valve-erc.com/srcsdk/faq.html#NoGameDir
* Put .smd files and .qc files in a same directory.
2. Run vconfig to specify which game you're working on.  
* To write .mdl into your mod directory, set Current Game to your mod, or use -game option pointing to your game directory.
3. Add -game <path> on the command line where <path> is the directory that gameinfo.txt is in.''


::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)
Samekind of error comes with [[Studiocompiler]].
Please can anyone help me?
--[[User:Nom1nator|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? --[[User:Nom1nator|nom1nator]] 17:18, 11 June 2009 (UTC)
::: Now I got it work, but how I get the textures work? --[[User:Nom1nator|nom1nator]] 19:01, 13 June 2009 (UTC)


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]]
==plz help==
: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.
i got this error:
: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)
Error opening c:\program files (x86)\steam\steamapps\alooy6\sourcesdk_content\hl
2\(x86)\steam\steamapps\alooy6\sourcesdk_content\hl2\flufy.qc


::Well I found the tools but when I go to compile I get this error,
what do i do? --[[User:Lazy genius|Lazy genius]] 01:25, 13 June 2009 (UTC)
::"The procedure entry point ?LockForRead@CThreadSpinRWLock@@QAEXXZ could not be located in the dynamic link libary tier0.dll"
: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)
::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)
:::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.
:::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)


::::'''Huzzah! I got it to compile.'''
== Unable to find the .smd file ==
::::My solution,


::::1) Right click Source SDK, in steam, and delete local content.
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
::::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)
<pre>
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
</pre>


:::::'''I just want to confrim that:'''
: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)


:::::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.
 
:::::'''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)