Compiling models for SDK 2013 - or "STUDIOMDL! Y U NO WORK?"

Got problems with your models? Struggling with textures? Get help with your custom assets.

Compiling models for SDK 2013 - or "STUDIOMDL! Y U NO WORK?"

Postby Black_Stormy on Tue Aug 06, 2013 8:46 am

image













Since the 2013 SDK came out some people have been having aneurisms trying to get studiomdl to work. There is likely a straightforward and logical solution to this but it probably involves setting up visual c++ and compiling solutions and shit that scares my little blender-print pants off. So here's how I got it to work tonight.

What the problem probably is (and what I am not ready to deal with)
First of all, your VProject environment variable is likely leftover from the pre-steampipe era. This is an easy enough fix, although I am not sure how relevant it is. Open up CMD (windows button > run > cmd - if you're on windows 8 get pokki to emulate a start menu) and type in "set" and hit enter. You should see a bunch of environment variables. Somewhere near the bottom is VProject. It probably points to the EP2 in your [username] directory. EP2 is now in our "common" directory .You can clear this variable by typing in
Code: Select all
set VProject=
I don't think this makes a difference, since mine keeps reverting automatically. I have a feeling this is the root of the problem but don't know how to really fix it.

Compiling a model
To get around this you'll need to set up a .bat file to compile your model. This is a little different to the old bat file. Create a new text document and change the file extension to .bat. Open it in notepad - note that notepad++ handles linebreaks differently, so use vanilla windoze notepad just to be sure. I am using SDK2013 multiplayer, so change accordingly if you are using single player. I am also compiling for Double Action: Boogaloo so change your mod path accordingly as well.

The main difference between this file and the old way of doing it is that you need to declare the .qc file you want to compile, which sucks my balls. You will also need to enter the full path to your studiomdl.exe and your mod's gameinfo.txt directory, as opposed to using the %sourcesdk% environment variable. Here is what I have in my .bat file:

Code: Select all
"C:\Program Files (x86)\steam\steamapps\common\Source SDK Base 2013 Multiplayer\bin\studiomdl.exe" -nop4 -game "C:\Program Files (x86)\steam\steamapps\sourcemods\dab" beam_01.qc
pause


I am using the studiomdl in my SDK 2013 Multiplayer directory, the game is dab, and I am compiling a .qc file named beam_01.qc. Note that the .qc file is in the same directory as the .bat file. Also note that the paths are encapsulated in double quotation marks, to allow for white space.

Once you have this .bat file in the same directory as your .qc file (I keep mine in the model construction folder, not in the mod folder, since you need to make a new .bat file for every .qc you want to compile) all you do is double click the .bat file to have windows run it and compile your model. You should no longer get a "missing gameinfo.txt" error.

Using HLMV
If you try to use the hlmv.exe in your SDK2013 directory you will get another missing gameinfo.txt error. To fix this, right click on hlmv.exe and create a shortcut. Right click on the shortcut and select "properties". In the "target" box, append the same "-game [path/to/your/mod]" as you did in the .bat file above after all the stuff that is already there. So the target box in my hlmv.exe shortcut located in my Source SDK Base 2013 Multiplayer directory looks like this:

Code: Select all
"C:\Program Files (x86)\steam\steamapps\common\Source SDK Base 2013 Multiplayer\bin\hlmv.exe" -game "C:\Program Files (x86)\steam\steamapps\sourcemods\dab"


I assume if you want to get the other tools to work around the gameinfo.txt error the same rules should apply.

Questions? Ask away.
Attachments
YUNO.png
YUNO.png (116.88 KiB) Viewed 4150 times
User avatar
Black_Stormy
May Contain Skills
May Contain Skills
 
Joined: Sun Nov 28, 2010 6:03 am
Location: Cairns, QLD, AUS

Re: Compiling models for SDK 2013 - or "STUDIOMDL! Y U NO WO

Postby jimonions on Tue Aug 06, 2013 9:08 am

The wallworm max plugin still works fine in case anybody wanted another alternative. I haven't gotten around to setting up the proper locations yet so it still compiles into my user directory instead of common.
User avatar
jimonions
Regular
Regular
 
Joined: Tue Feb 01, 2011 10:41 am

Re: Compiling models for SDK 2013 - or "STUDIOMDL! Y U NO WO

Postby Chris528 on Wed Aug 07, 2013 5:12 pm

Here's an even better method to compile your qcs. Just place a .bat in the root of your mod folder with the following contents. This way you can just drag and drop qcs on to the .bat. The only thing you need to modify is the path of the studiomdl.exe

If this doesn't work, chances are that your game has no entry in the gameconfig.txt in the sdk base bin folder.
Code: Select all
SET GameDir=%~dp0
SET GameDir=%GameDir:~0,-1%
"E:\Program Files (x86)\Steam\steamapps\common\Source SDK Base 2013 Singleplayer\bin\studiomdl.exe" -game "%GameDir%" -nop4 %1
pause
User avatar
Chris528
Member
Member
 
Joined: Sat Mar 01, 2008 10:21 pm

Re: Compiling models for SDK 2013 - or "STUDIOMDL! Y U NO WO

Postby ScarT on Wed Aug 07, 2013 6:02 pm

Personally I just added a context menu to QC files. It calls a batch files that I can modify to whatever I want.

Image
User avatar
ScarT
Senior Member
Senior Member
 
Joined: Sat Apr 02, 2005 7:33 pm
Location: Denmarkian Land

Re: Compiling models for SDK 2013 - or "STUDIOMDL! Y U NO WO

Postby Black_Stormy on Wed Aug 07, 2013 10:18 pm

You guys have all the rocks. ScarT, how do I do that?
User avatar
Black_Stormy
May Contain Skills
May Contain Skills
 
Joined: Sun Nov 28, 2010 6:03 am
Location: Cairns, QLD, AUS

Re: Compiling models for SDK 2013 - or "STUDIOMDL! Y U NO WO

Postby Chris528 on Fri Aug 09, 2013 1:57 am

Easy, open regedit, go to HKEY_CLASSES_ROOT->qc_auto_file->shell, then add a new key called "compile model" then add a child key and call it command.

You then modify the string data in the command key to run whatever batch file or program you want.

For example you could enter something like f:\myMod\compile_models.bat %1
User avatar
Chris528
Member
Member
 
Joined: Sat Mar 01, 2008 10:21 pm

Return to Custom Asset Help

Who is online

Users browsing this forum: No registered users