THE GAME CUSTOMIZATION NETWORK: FPSB | RTSB | RPGB |
Help Wanted: Skinner @ noobs!ncorporated (See All) | SUBSCRIBE
 
 






Creating N
Added by...
Key Authors
killerworm
Category: CS:S > Other/Misc
Tags: compile, decompile, models
Added 3 years ago - last modified 2 years ago
THIS TUTORIAL IS FOR PEOPLE WHO WANT TO TAKE VALVE MODELS AND USE THEM IN MAPS THEY CREATE

Find the model you are trying to edit in GCFscape. (open up either source models OR Counter-Strike Source shared). Once in there locate the models folder in either folder. Right now we are going to be looking at the vending machine model for CS:S. So open the Counter-Strike Source Shared file and go into cstrike/models/props/cs_office/. Then locate the six vending_machine files. Export them.

Now, export it. Now, downlaod this: HERE (then click on MDLDECOMPILER.)

Download the "older version" 2'nd one down in the "older versions" list. Or it won't work.

Now, go to program files/valve/steam/steamapps/youaccount/sourcesdk/bin (must have the source SDK installed) now extract the mdldecompiler.exe file from the ZIP folder you just downloaded, and place it in the folder I directed you to above. Now double click on the mdldecompiler.exe file.

Now, create a new folder on your desktop and name it "vendy" place all the files (six files for the model I had you export earlier) in that folder. Now, using the mdldecompiler select the .mdl file in the "choose model file" section. Then select the "choose output directory" and select a new folder

(MAKE ONE AND NAME IT "VENDY DECOMPILED")

and decompile it to the new folder on your desktop named "vendy decompiled" (create the folder).

Hit "extract". Should say "model loaded *the directory*" hit OK then it should say "completed dumping model".

W007!! YAY!

Ok... now comes the little harder parts. I am not sure how to add extra skins... but this is just the way I am doing it. I am sure you can play around with the model's settings and add skins and things. But just follow the tutorial so you know how to do the basic stuff :P

First, open up GCFScape and go back into the "Counter-Strike Source Shared" file then this time, go to cstrike/materials/models/props/cs_office/. Now export the "vending_machine.vmt" and the "vending_machine.vtf". Now, open up Photoshop or whatever program you use to edit photos. Make sure you install the VTF plugin. (can be found: HERE ) Now, open up the vending_machine.VTF with photoshop or whatever you use. Edit the picture (skin for the new model) to however you like. Then save it as vending_machine.tga (make sure you save it as a TGA file)


NOW, back to the model
Open the mdldecompiler.QC in the new folder using standard notepad.

Change the $cd part to this: "models/props/vendy".

Now, edit the $modelname to this "props/vendy/vending_machine.mdl"

Now change the $body to this "body" "vending_machine.smd"

Now change the $cdmaterials to this "models/props/"

Now change the //model uses material to "vending_machine.vmt"

Now save it. (you can also edit the type of material you want the model to have under the "surfaceprop"



Ok, now go to program files/valve/steam/steamapps/youraccount/sourcesdk/contect/cstrike

Go into the modelsrc folder (in your sourcesdk_content folder). Now in that folder create a folder named "props" (since in the QC file you directed the file to the models/props/ folder). Now that you have a new folder in there named "props" drop and drag the four vending machine files (the decompiled model files from your "vendy decompiled" folder. The files should be named:

idle.smd
phymodel.smd
vendy.smd
mdldecompiler.qc

Once you have them all moved to that folder. Go back to the program files/valve/steam/steamapps/youraccount/sourcesdk/contect/cstrike

Folder and go into the materialsrc folder this time (in your sourcesdk_content folder). Once in that folder make a new folder named "models" in the new models folder make a new folder named "props". Now that you have the new models/props/ folder in the materialsrc folder, move the vending_machine.TGA I made you make into that props folder you made.

NOW FOR THE RE-COMPILE

...


Ok.. now download this:



Put that file you just downloaded in the program files/valve/steam/steamapps/youaccount/sourcesdk/bin Folder. Now double click on it. Here is the kinda tricky part... cuz if you don't do it just right it will not compile.. its a real huge pain in the you know what. lol.

Once you have the studio compiler open click on the "material compile" tab. Click and drag the TGA from your materialsrc/models/props folder into the little box

(see screenshot 1)



Alright, so now that you have the TGA selected.. make sure your settings in the studio compiler are the SAME as what I have in that screenshot. Set the "compiled material directory" above the TGA box to "props". Ok, now just hit compile. It should look something like this if you did it correctly.

(see screenshot 2)



Now, go to the "model compile" tab. And drag and drop the vending_machine.smd file (in the modelsrc/props/ folder) into the "reference SMD" slot in the studio compiler.

(see screenshot 3)



"Check" the "use reference smd" box. Type "vending_machine.mdl" in the "compiled model file" box. (see screenshot above). Now you should see that it has the texture listed below in the "compiled material directory" slot. Thats good you should be set to hit the "compile" button. Lets see. Try it out. You might get a couple
WARNING: WARNING: WARNING: Model has 1 convex sub-parts. errors... but thats no big deal.. at least I don't think it has ever effected anything. Now that window should look something like this.

(see screenshot 4)



And at the bottom should look something like this.

(see screenshot 5)



Alright!!! IF YOU GO THAT YOU ARE DONE!

Now, to check your model... get into the "bin" folder where you were getting into the studio compiler and the mdldecompiler, and click on the "hlmv" file. It will bring up a window. Now, click on file > load model. Then scroll down towards the bottom of the page that pops up and find "vending_machine". Now open that up. Should look like this (only with your texture on it.. my texture just says "hacked model" on it so that I could see if it worked as planned.)..

(see screenshot 6)



There ya go!


I hope this helps ya out!! And remember for each model (unless you can find a way to set skins) you have to just name it vending_machine2 or vending_machine3 or something.

Salute
-K!LLER^WORM
Feedback
2 years ago
Igor der Schreckliche



I think this would help me but the fucking modelcompiler won´t work
always i start cames this error:
"Q_strncpy" cant found DLL"vstdlib.dll"


I can do and edit anims ;)
3 years ago
YellowJello



This is a very good tutorial, but it could use just a little bit more HTML formatting and a few more images to help the readers along the way.

Banned
3 years ago
KillerWorm



The custom models that I have made this way work perfect in Counter-Strike Source :D. Thanks for the html link. I will check that out. Also.. moved it to the "general" section.


Worminated
3 years ago



A good tutorial, but it is in the wrong section. It isn't remodeling, it's retexturing. You have several steps in this you don't need, and this vending machine won't work with CS:S. Also, this tutorial could use some HTML, and you should state that this is how you have a valve model with a custom skin while still having the default one, for use in something like GMOD.
If you want to learn how to use HTML here:
Using HTML on FPSB


¿
Add Feedback
Please provide constructive feedback and adhere to FPSB's Posting Rules.
You cannot post yet! Get involved on FPSB by posting your thoughts. Give authors your feedback to help them develop. To post in this submission register or login
Assessment
You cannot assess yet! Moderating FPSB is in your hands - when you assess a submission your vote determines its success or failure. To vote on this submission register or login
User Rating [+]
8/10
bScore
8.0/10
Stamps
This Tutorial in a nutshell...
You cannot stamp yet! Stamps let you apply characteristics to submissions to help others understand them. To stamp this submission register or login.
No stamps recorded
Added by...
KillerWorm
OFFLINE
Worminated

Peasant
3,645 points

No EF
0 exemplary posts

Veteran
Joined 10 Mar 2006

Member
Related Tutorials