Studiomdl.exe

0 views
Skip to first unread message

Ailene Goldhirsh

unread,
Aug 3, 2024, 4:14:02 PM8/3/24
to restripovi

This error occurs when the path for the output model does not exist. This is an error that happens at the compile stage and will happen if you are compiling straight from WWMT or by compiling manually from the batch file.

When you export a model via WWMT it exports the QC, SMDs and compiler batch file to your Source SDK directories. That is not the final path for the destination model (.mdl file). When you run the compiler (studiomdl.exe), the compile makes the model (MDL) from the QC and SMDs; it saves it to the game directory (as opposed to SDK directory) that mirrors your SDK directory. If the game model's folder does not have a path that matches your Model Folder Path, the compiler will fail.

I recently acquired Counter-Strike: Condition Zero and was, as most veteran CS were, appalled by the models that were used--the same tired ones from the original CS with a skin tone like a sun-burned asian covered with cheese. So, naturally, being the seasoned PC gamer that I am, I copied my models that I'd downloaded for the mod version of CS 1.5 to the cstrike\models\players folder in Condition Zero. I started playing a match with bots and quickly noticed an oddity continued to occur with my CS 1.5 models; they weren't dying--at least not in the typical sense where you would expect them to be dead when you apply a bullet to their skull. Instead, they floated around in the dummy pose such as in the screenshot to the right. As you can imagine, this is extremely annoying and can affect your game when you can't determine if a player is dead or not. I'm Snake, though...and I find solutions. If you also have this problem with older custom models in new versions of HL mods (particularly CS), I'll detail how to fix them in the following guide.

First, you will need a few things. One being that you do need some skill and knowledge with the computer and Half-life for some of the steps. Modeling by nature is a complex practice, even if we're only cutting the surface of it by upgrading its structure. Of course, you will also need some programs to assist you, as this guide won't help you without them. Go ahead and download/install these programs and continue reading when you're ready:

So things don't get complicated, we need to set up a directory structure in which to convert the models we plan to upgrade. If we don't do this, things will definitely get screwed up as we convert more models. You'll see why momentarily. Your directory structure should look like this with each model in its own folder and all the model folders in an upper-level folder.

Now fire up Milkshape. You'll have 30 days to use it without buying, but that should be enough time to upgrade all your favorite models. You'll see the standard views for editing in 3D and the like, but for right now, we just need to decompile the old model. Go to the Tools menu and down to Kratisto's HL MDL Decompiler. If you don't have that, you could try the built-in decompiler.

Locate your model and uncheck "Sequence SMDs". This will extract all the model specific parts, geometry and textures, but not the skeletal animations. You should see some bitmap, qc, and smd files in the folder where your model is.

We'll need a base model from CZ (or CS 1.6) in which to steal the skeletal animations (sequences) from. So, head to your cstrike\models\player folder and grab one. Create a new folder with your other models to be decompiled and paste the model from CZ there. Go back to Milkshape to decompile the CZ model like before but this time check only "QC Script" and "Sequence SMDs". It'll chug away for a moment creating the many sequences and then you should have several hundred smd files and a qc file in with your CZ model.

Now you will have a choice to make. Depending on the amount of time you want to spend, we can upgrade the skeletal animations for our old model in two ways. One is using my tool to compare the CZ and old CS model skeletons and change the skeletal animations according to their differences. The other way is using Milkshape to map the new CZ skeleton to the old CS model which will use the new (superior) skeletal animations. The first method could take roughly five minutes; the second will definitely take more than an hour.

We'll start by loading my tool, CSCZMDLconv.exe. It's rather straight forward, but I'll still walk you through the steps. You'll notice that the only button enabled is the "Grab Old Bones" one, so go ahead and click that. Go to the folder with your new CZ model and select one of the smd files; it doesn't matter which one, they all have the same bones. Some bones will appear in the list at the bottom of the app. "Grab New Bones" is now available, so click that. This time, find the reference smd file of the model in which you're upgrading. Because I'm upgrading the Nina Guns model, I choose the ninaguns.smd file. You should see something similar to the next screenshot. It's okay if the number of the bones don't match up between the old and new skeletons. If they did match up, then your model should already be compatible with CZ.

At this point, we load the sequence SMDs we want to convert from the CZ model. My app is supposed to handle multiple file selections and conversion, so go ahead and select all the smd files in the folder with the CZ model. It'll show how many files will be converted--should be over 600. The app will also make a guess to where the converted files will go, but you'll probably want to change that path to where your old CS model is (don't forget the ending slash). Go ahead and click convert now. The conversion process will take a minute or so depending on your CPU speed. When the progress indicator displays "Done", you can close the app and continue.

Now we need to edit the QC file. This task is simple enough, just some copying and pasting. Open the new CZ model folder and then open the QC file there with notepad. Select everything starting with "// 111 animation sequence(s)" down to the end of the file and copy it. Close the QC file. Open the old CS model folder and then its QC file in notepad. Select the same stuff as before and paste over it. Save the QC file. We're done with the QC editing.

Time to compile the model back together. Copy studiomdl.exe to your CS model's folder. Open a command prompt (run "cmd") and change the directory to where you just copied studiomdl if necessary (using the "cd" command). Then, type "studiomdl arctic.qc" or the name of your model's QC file. You could alternatively use a batch file or drag the QC file to studiomdl.exe. As long as there aren't any errors compiling, you should have a CZ or CS 1.6 compatible mdl file now. I'd recommend downloading HL Model Viewer from the same site as Milkshape to make sure the model looks and moves correctly.

A few notes about using this method: If you're feeling a little more savvy, you can just convert the shield or necessary missing sequences and make the additions to the QC file. There are two reasons that I can think of that you might want to try this. One being that, although I personally have been pleased with the conversion results, I would think that the model's original author did a more precise job of mapping the old skeleton to the model and would not account for the differences in the new skeleton. Also, the model may have originally had some animation modifications that you would lose when converting from a standard model's animations. Although, if you're just looking for a quick way to fix the death animation of your model and not worry about accuracy, then this method should suit you just fine.

In this method, we'll be doing roughly the same thing as in the other method, but instead of adapting the new model sequences to our old model, we'll be updating the old model to take advantage of the new skeleton. We'll be editing in 3D in Milkshape, and although it's only selecting vertexes and rotating the view around, if you think that'll be too much, then the other method should suit. There's little to gain from updating the skeleton of your old model: You'll be able to see their fingers move when arming the bomb, and they'll be a bit more realistic moving and limber when dying.

Start by copying all the smd files from the base CZ model to the old CS model's folder, overwriting any sequences that are already there. Start up Milkshape. We're gonna need the geometry from the old model in order to assign the new skeleton's bones to the vertexes, so go to the File menu and Import>Half-life SMD. Select your old model's reference smd. In my case, it's ninaguns.smd. In the next box, unselect "Skeleton" and "Rename Bones" and click OK. You should see the model standing with arms spread in three wireframe angles and in 3D.

Now we import the new skeleton. Decompile the new CZ model again, selecting only "Reference SMDs". Go to File>Import>Half-life SMD and select the reference smd we just decompiled. In the box, only select "Skeleton". You should now see your model and the blue skeleton inside of it.

Let's practice moving around in the views. You do this primarily with the mouse. You zoom with the mouse wheel and move the view by holding the middle mouse button and dragging. In the 3D view, you can also click to rotate the view around the axis. Locate a specific detail on the model and practice zooming in on that detail and looking at it from different angles. You can turn the skeleton off in the "Joints" tab on the right.

While you're in the joints tab, let's play with the bones a little. When you select one of the bone joints in the list and the skeleton is turned on, you'll see that joint in red and all the bones attached to it in green. If you click "SelAssigned", you'll obviously notice that none of the vertexes are assigned to any of the bone joints. Our task is to fix this. Now I could tell you specifically which vertexes to assign to which bone joints, but that would take me hours and I would fall asleep somewhere around Left Finger11, anyways. There's a better way, though. Open another instance of Milkshape. Import the base CZ model again in this new instance, but this time select both "Triangles" and "Skeleton". Go to the joints tab and select a joint and then click "SelAssigned". You should see some vertexes turn red in the views. You probably see what I'm getting at now. We're going to use the CZ model as our guide when assigning vertexes.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages