Page 1 of 1

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

PostPosted: Tue Aug 06, 2013 8:46 am
by Black_Stormy

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

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.

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

PostPosted: Tue Aug 06, 2013 9:08 am
by jimonions
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.

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

PostPosted: Wed Aug 07, 2013 5:12 pm
by Chris528
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

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

PostPosted: Wed Aug 07, 2013 6:02 pm
by ScarT
Personally I just added a context menu to QC files. It calls a batch files that I can modify to whatever I want.


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

PostPosted: Wed Aug 07, 2013 10:18 pm
by Black_Stormy
You guys have all the rocks. ScarT, how do I do that?

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

PostPosted: Fri Aug 09, 2013 1:57 am
by Chris528
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