Raised This Month: $12 Target: $400
 3% 

[Tutorial]How to: Model a Gun


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
heliumdream
Senior Member
Join Date: Aug 2006
Old 09-09-2006 , 23:31   [Tutorial]How to: Model a Gun
Reply With Quote #1

Admin, if you think this is the wrong forum please move this thread to the appropriate place. I couldn't decide where to put this so I just put it here. Thanks in advance.









Over the past few days I was on a tangent. I wanted to make some models. These images are the result of my work. Let me start out by telling you in detail what I did. First you may want to download the files at the bottum of my post, these are my finished models.

- Description of models -
First model is a new m249 (previously para) model. I wanted to use the hero 'Pimp' only replace the dual m4 model with a new model, made by me. I ended up going with a free high detail railgun model I found with a simple websearch. For this project, I needed to create 2 things, a p_m249.mdl and a v_m249.mdl. For those who don't already know every weapon model has at least 2 models, p - one which is seen in 3rd person mode, and v - which you see yourself hold in first person mode. I had to create from scratch both of these models.

- I Used Milkshape, the trial version -
Well the model I got was in Cinema4d format, so I open C4d and converted the model to a lightwave object, to be imported into another program simply called '3d photo browser'. This was done for one reason, the model I got was extremely complex with more than 30,000 vertices and 20,000 faces. A typical half life gun is typically between 1,000 and 2,000 faces. 3d photo browser has an advanced polygon reducing tool, which has options for preserving textures and edges. I had to run it twice, with almost 90% compression (which is almost max) and with extra preservation on the barrels to get a model that still looked like what I started with. Okay now that was the easy part.

- The hard part -
The easiest thing to do now is to find default models for the gun you are skining, I didn't want to reskin a reskin. So I found the default m249/para files online and put them in a folder. Now you should do these next parts one at a time, one for the v_model and one for p_model. You want to decompile one of the original m249/para files, so you get the files that were used to compile the model. This is composed of a .qc script, several .smd's which are small detailed models (smaller parts of the larger .mdl), and last texture .bmp's. You are only concerned with editing m249_reference.smd - this file contains a wireframe of the old gun and the wireframe of the skeleton. That and you may want to rebuild textures, so your guns will show up the way you want them to.

- Combining your new model with the old reference model -
You need to save m249_reference into a milkshape file, so you can close it and use it to merge with the new model file. Import your new_model.lwo into a new window. Now choose 'File->Merge' and select the m249_reference.ms3d. This will bring your new model, and old model, into the same window. Now select your new model, and scale it down to approximately the same size as the old one (or larger if your want a larger gun...). Next, obviously you need to 'move' in all 3d directions your new model on top of the old one. You can delete the old model and old textures now, but keep the old skeleton. Now, this is slightly tricky this gave me a lot of trouble. Before you can compile this window into your new_m249_reference.smd you must assign the vertices of the model to the corresponding joints they need to touch in the skeleton. I did this easily by selecting the entire model, and going to 'Tools->Joint Tool'. This tool has one button which reads 'assign unassigned vertices to nearest join'. This should typically do what you want it to do, bind key vertices to key joints. This acts as reference points for things like where your skeletal model ingame grabs the gun, where your bullets originate from, and probably some more stuff. Be sure all your models have been assigned a texture, or they wont show up. Textures will only be read in 8bit bmp format or you'll get errors and crash.

- If that all went smooth... -
You may be ready to export your window into a usable .smd file. You wll want to replace the old_m249_reference.smd with this one by 'File->Export->Half-life smd. If that worked, you might be ready to compile your new model. Check your .qc script file you plan on using to compile, you may be able to reuse the one from the old model you decompiled. I was so fortunate. You only need to update the paths in the qc files, most of the definitions and hitbox info should still work. Click 'Tools->Half-life->Compile .qc' and if it worked, you will have your spanking new model in the destination folder you defined in your .qc script. You are halfway done, you should now have a new and viewable p_m249.mdl that you can check out using your favorite model previewer.

- Now rinse and repeat -
You must do a similar process for the v_model you want to create. Be careful not to delete the HAND and FINGER models and textures when you are merging your old skeleton with your new model. This v_model is the first personal model and is substantially larger in scale than the parallel p_model so you may have to resize to scale again. Again don't forget any textures or joint and you shouldn't have any problems compiling your .smd's and .mdl's.

That tutorial was based on my first model, the new m249. I'm using my new para to replace the models in the hero 'pimp'. The texture I used was just ripped from the gundam mech model, I wanted to create cohesion between the new 'railgun' and my gundam model on my server and I didn't feel like making a texture, so I just borrowed one...It ended up getting stretched, and gives a 'techy' feel that I'm happy with for now.

- The New Deagle -
The second model I made was easier, my v_deagle.mdl was already included I only had to create the p_deagle.mdl. Some complications arose while making this model cause I did not turn the model into a deagle, like it was desgined for. I'm using this pistol model as a replacement awp model for the hero 'mad assasin'. I ripped the new gun model onto the old awp skeleton and didn't have too much trouble. Some of the animation is stumbly cause I'm new at this and I don't completely know what I'm doing yet.

- Final notes -
Please feel free to use my railgun and deagle/awp models. Also feel free to fix the texture used for the railgun so it looks like something 'real'. I may in the future get to texturing the beast. I will post if I do.

I was prompted to make this tutorial because of the difficulty I found in getting this information in one nice spot. I hope someone uses this and learns something. If you have any questions post them up and I will respond.
Attached Files
File Type: zip awp.zip (1.01 MB, 515 views)
File Type: zip m249.zip (209.2 KB, 552 views)

Last edited by heliumdream; 09-10-2006 at 04:18.
heliumdream is offline
guy
Senior Member
Join Date: Apr 2005
Old 09-17-2006 , 02:47   Re: [Tutorial]How to: Model a Gun
Reply With Quote #2

Hey, this is a pretty good tut. Nice to see another modeler. Sticky this somewhere appropriate please.
__________________
Call it, friendo.
guy is offline
thebobjones34
Member
Join Date: Oct 2006
Old 10-04-2006 , 17:00   Re: [Tutorial]How to: Model a Gun
Reply With Quote #3

Nice Dude, those are some pretty sweet models, keep up the good work.\

also, im sure help on modeling doesnt go under scripting help, mainly because im sure you do not script the model.

If i am wrong please correct me.
__________________

Last edited by thebobjones34; 10-04-2006 at 17:03.
thebobjones34 is offline
Send a message via AIM to thebobjones34
heliumdream
Senior Member
Join Date: Aug 2006
Old 10-10-2006 , 21:17   Re: [Tutorial]How to: Model a Gun
Reply With Quote #4

I believe in my first post I asked specifically for admins to place this where it was appropriate...there i no modeling forum, last time I check, so we concurred this was the place to put this thread.

BTW IF AN ADMIN READS THIS, LEMME GET A STICKY

1 TIME

heh, anyway...
in fact there is a .qc script used in the compilation of SMD's - small model details. There are usually any number of these smd's depending on complexity, a gun model is substantially less complex than a player model. You can get away with 2 or 3 smd's in a gun, you need the 'gun' model and a skeleton with the 'gun' attached to it to tell the game which arm or leg to bind the gun placement to. Other smd's in a gun would be skeletal animations. Player models require a 'model' and a 'model binded to a skeleton', but convexly - also needs at least like 96 standard skeletal animations. The master shake model I made had only 1 animation, so he doesn't turn right...you really can't use my model yet cause I didn't add those 96 animations. I'll be adding my master shake player model creation tutorial once I fix that problem and make a proper model.
heliumdream is offline
TerMiNat0r10
Junior Member
Join Date: Jul 2006
Old 03-12-2007 , 14:04   Re: [Tutorial]How to: Model a Gun
Reply With Quote #5

... its very cool but my awp... is not the awp like th picture but like a other hero... this is the picture...

__________________




+Karma if u help me

Last edited by TerMiNat0r10; 03-12-2007 at 15:03.
TerMiNat0r10 is offline
Send a message via MSN to TerMiNat0r10
Rolnaaba
Veteran Member
Join Date: May 2006
Old 03-13-2007 , 11:56   Re: [Tutorial]How to: Model a Gun
Reply With Quote #6

what does this have to do with superhero coding...? this is more appropriate for http://fpsbanana.com
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
Xel0z
Senior Member
Join Date: Apr 2006
Location: Netherlands
Old 03-13-2007 , 14:15   Re: [Tutorial]How to: Model a Gun
Reply With Quote #7

Quote:
Originally Posted by heliumdream View Post
- I Used Milkshape, the trial version -
I already downloaded milkshape once (trial version), but it expired. Because of that I cant save my .smd files anymore. I tried to reinstall milkshape, but it ended up in the same result. I rather not format my pc as I have a lot of files on it, which will - if I make a back-up of them - take a lot of time to put on another pc (we're talking about 160 GB). Now my question is, do I really have to format my pc in order to reinstall milkshape and get a crack working on it?

PS: I already tried to delete the registry keys, but it didnt really go well..
__________________
Heroes: TESS-One Working on: Grit (Fixing bugs)
Xel0z is offline
Send a message via MSN to Xel0z
heliumdream
Senior Member
Join Date: Aug 2006
Old 03-31-2007 , 15:03   Re: [Tutorial]How to: Model a Gun
Reply With Quote #8

Send me a priv, I'll firgure something out.
heliumdream is offline
heliumdream
Senior Member
Join Date: Aug 2006
Old 03-31-2007 , 15:07   Re: [Tutorial]How to: Model a Gun
Reply With Quote #9

Also - the guy with the wierd awp results in his picture.

There are more than 1 model on the net with the same name, and location. You have a previous model that has the same name as my model.

If you navigate to it in your cstrike directory, and delete it - when you reconnect to a server using my awp you will then have to download it again to view it.

And sorry to the guy who didn't think my tutorial was important enough to stash in these forums. When I looked into modeling, this site was pretty much the only resource I had. And it's nice to get everything in the same place - so I decided to share with the community - how to model.
heliumdream is offline
PAuk
New Member
Join Date: Mar 2007
Old 04-02-2007 , 12:24   Re: [Tutorial]How to: Model a Gun
Reply With Quote #10

Hey, nice models for the guns, but im kind of noob to this. Where do i put these files in, can i get an guide or something thx
PAuk is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:45.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode