HIT Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: How to change the Origins on a Weapon Model  (Read 15089 times)

0 Members and 1 Guest are viewing this topic.

James

  • Throw THIS at THAT!
  • Global Moderator
  • Gonarch
  • *******
  • Offline Offline
  • Posts: 3663
  • <3
    • View Profile
    • Resident Evil : Cold Blood
How to change the Origins on a Weapon Model
« on: June 16, 2005, 01:51:35 PM »

Whilst browsing through the forums, I noticed that this seems to be a problem. Just how exactly do you change the origins of a weapon model? Here's a quick and easy guide to show you how:

Tools needed:

Jed's Half Life Model Viewer (if you don't have it, I recommend you get it)
Milkshape 3d
Notepad (or other text editing program)
Your model

Step 1:
First of all, you will need your model that you want to change the origins of. Now, we're going to be breaking down the model into its various core pieces for this, so you might want to do this in a new folder to keep your hard-drive tidy. Now, double click on your model and open it up with Jeds Half Life Model Viewer. You will now be in the model view. We don't want that, so click on the tab "Weapon Origin". Ah, there we go. That's the way the gun is held and shown ingame. Now it's time to modify those origins!

Step 2:
Ok, we've made it this far, and now it's time to find some nice origins that you like. Notice the Origin X, Y and Z boxes with lots of zeros? Have a play about with those values until you find a position you like. (Don't forget to click "Test Origins" when you've modified the numbers so that you may preview the new position. Here are some screenshots to show you.




I apologise for the blurriness of the text. Anyway, we're now finished with Jeds Half Life Model Viewer, so copy your origin number values into notepad, then close down the Model Viewer. Now it's time to decompile.

Step 3:
Open up Milkshape 3d. We are now going to decompile the model to get to its QC file ( The QC file is a text file which stores information about the model, such as which animations it uses). In the top, click "Tools > Kratistos Half Life MDL Decompiler". Now you're presented with a little window with 4 boxes to tick. Leave all 4 of them ticked, then browse to the folder where your model is stored. Double click on it, then click "Ok". You will then see another window with some information. We can ignore that though, it's not important. Now, leaving Milkshape open, go to the folder where your model is. Oh my! a whole load of files have magically appeared! They're the animations, reference files, textures and the QC file. We can ignore the rest, all we want is the QC file (although do not delete the other files, they're needed later). Now it's time to use our text editing program

Step 4:
Open up the QC file in your prefered text editor. You will now be presented with a whole lot of text very similar to this:

Quote
/*
==============================================================================

QC script generated by Half-Life MDL Decompiler 1.2
2003, Kratisto. Based on code from Valve's HL SDK.

v_357.mdl

Original internal name:
"c:/sierra/half-life/valve/models/v_357.mdl"

==============================================================================
*/

$modelname "v_357.mdl"
$cd ".\"
$cdtexture ".\"
$scale 1.0
$cliptotextures


$bbox 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
$cbox 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
$eyeposition 0.000000 0.000000 0.000000


//reference mesh(es)
$body "gun" "v_python_reference"

$body "hands" "v_gordon_hands_reference"

$bodygroup "scope"
{
blank
studio "v_python_laser_reference"
}


// 1 attachment(s)
$attachment 0 "python" 0.000000 -14.000000 6.000000

// 10 hit box(es)
$hbox 0 "Bip01 R Hand" 0.000000 -0.990000 -1.710000 5.941133 1.084807 3.855314
$hbox 0 "python" -0.730000 -10.380000 -5.620000 1.070000 5.160000 3.010000
$hbox 0 "revolver" -1.920000 -1.990000 -57.742607 1.080000 22.403749 3.270000
$hbox 0 "speed_loader" -1.300000 -1.300000 0.000000 1.300000 1.300000 3.150000
$hbox 0 "Bip01 L Hand" 0.000000 -0.960000 -1.820000 3.910000 0.900000 1.710000
$hbox 0 "Bip01 L Finger0" 0.000000 -0.950000 -0.570000 2.450000 0.380000 0.970000
$hbox 0 "L_Arm_bone" -1.920000 -2.640000 -2.300000 2.760000 2.490000 7.980000
$hbox 0 "Bip01 R Finger0" 0.000000 -0.940000 -1.000000 2.450000 0.390000 0.540000
$hbox 0 "R_Arm_bone" -2.620000 -2.640000 -2.290000 2.060000 2.490000 7.990000
$hbox 0 "lasersight_mesh" -1.360000 -11.650000 -2.660000 0.790000 0.000000 1.840000

// 8 animation sequence(s)
$sequence "idle1" "idle1" fps 30 loop
$sequence "fidget1" "fidget1" fps 30
$sequence "fire1" "fire1" fps 30 { event 5001 0 "31" }
$sequence "reload" "reload" fps 37
$sequence "holster" "holster" fps 30
$sequence "draw" "draw" fps 30
$sequence "idle2" "idle2" fps 30 loop
$sequence "idle3" "idle3" fps 30 loop

// End of QC script.

We now need to put our origins in. To do this, we need to add the following text under this ($body "gun" "v_python_reference") line. Of course, your $body "gun" "v_python_reference" line might be different, but if in doubt, place it above the Hit Box lines. We now need to type this:

$origin X VALUE Y VALUE Z VALUE

(where the coloured words represent the values you copied earlier from Jeds Half Life Model Viewer)

Step 4:
Now we're ready to recompile the model. Go back to Milkshape 3d, and in the top tabs, go to
Tools>Half Life>Compile QC file...
Now select your QC file, and double click it. Voila! After the text has finished appearing in the little window, it's finished! Enjoy your new origins!
« Last Edit: June 16, 2005, 02:00:49 PM by Minuit »
Logged

fury_161

  • Gargantua
  • *******
  • Offline Offline
  • Posts: 836
    • View Profile
Re: How to change the Origins on a Weapon Model
« Reply #1 on: June 16, 2005, 01:59:41 PM »

This is great for new people and all, but why in model releases? Give me a legitamite reason and I won't move it to tutorials.

EDIT: Eh, actually I guess it would okay here. The more I think about, the more it makes sense. I'll sticky it.

Logged

James

  • Throw THIS at THAT!
  • Global Moderator
  • Gonarch
  • *******
  • Offline Offline
  • Posts: 3663
  • <3
    • View Profile
    • Resident Evil : Cold Blood
Re: How to change the Origins on a Weapon Model
« Reply #2 on: June 16, 2005, 02:01:37 PM »

Ah ok then, thank you
Logged

Frosty

  • Unreal 2 Mercenary.
  • Vortigaunt
  • *****
  • Offline Offline
  • Posts: 127
  • Soldier.
    • View Profile
Re: How to change the Origins on a Weapon Model
« Reply #3 on: June 16, 2005, 03:45:58 PM »

Great tutorial, Minuit.
Logged

James

  • Throw THIS at THAT!
  • Global Moderator
  • Gonarch
  • *******
  • Offline Offline
  • Posts: 3663
  • <3
    • View Profile
    • Resident Evil : Cold Blood
Re: How to change the Origins on a Weapon Model
« Reply #4 on: June 16, 2005, 04:00:55 PM »

Thanks Frosty, I hope it comes in handy
Logged

Preda

  • Herr Kolektor
  • Gonarch
  • ********
  • Offline Offline
  • Posts: 1108
  • Intriguing...
    • View Profile
Re: How to change the Origins on a Weapon Model
« Reply #5 on: June 25, 2005, 06:00:30 PM »

Thanks for this, Minuit. I finally got around this problem, thanks to you.

And look at what else I remembered to do:

http://img189.echo.cx/img189/43/imfuckingnihilanth4uv.png
Logged

Sergeant Kelly

  • Deus Ex Fan.
  • Gonarch
  • ********
  • Offline Offline
  • Posts: 1462
  • GE:S and Ballistic Weapons tester.
    • View Profile
Re: How to change the Origins on a Weapon Model
« Reply #6 on: June 25, 2005, 06:07:06 PM »

Thanks for this, Minuit. I finally got around this problem, thanks to you.

And look at what else I remembered to do:

http://img189.echo.cx/img189/43/imfuckingnihilanth4uv.png
You changed the displacer to a nihilanth?
Logged

Preda

  • Herr Kolektor
  • Gonarch
  • ********
  • Offline Offline
  • Posts: 1108
  • Intriguing...
    • View Profile
Re: How to change the Origins on a Weapon Model
« Reply #7 on: June 25, 2005, 06:29:29 PM »

Ain't it cool? ;D
Logged

James

  • Throw THIS at THAT!
  • Global Moderator
  • Gonarch
  • *******
  • Offline Offline
  • Posts: 3663
  • <3
    • View Profile
    • Resident Evil : Cold Blood
Re: How to change the Origins on a Weapon Model
« Reply #8 on: June 25, 2005, 06:43:34 PM »

That is a cool idea! Good one preda!
Logged

Sergeant Kelly

  • Deus Ex Fan.
  • Gonarch
  • ********
  • Offline Offline
  • Posts: 1462
  • GE:S and Ballistic Weapons tester.
    • View Profile
Re: How to change the Origins on a Weapon Model
« Reply #9 on: June 26, 2005, 02:16:56 AM »

Is there a way to do this without milkshape?
Logged

James

  • Throw THIS at THAT!
  • Global Moderator
  • Gonarch
  • *******
  • Offline Offline
  • Posts: 3663
  • <3
    • View Profile
    • Resident Evil : Cold Blood
Re: How to change the Origins on a Weapon Model
« Reply #10 on: June 26, 2005, 04:11:46 AM »

Yeah, all you need (the bare minimum) is a decompiling and recompiling program.
Logged

random salad

  • DANCING SOCKS
  • Gargantua
  • *******
  • Offline Offline
  • Posts: 769
  • WITH UNOFFICIAL SUPERSPECIAL NOPERMISSION TO SPAM
    • View Profile
Re: How to change the Origins on a Weapon Model
« Reply #11 on: June 27, 2005, 04:26:02 PM »

Yeah, all you need (the bare minimum) is a decompiling and recompiling program.
And notepad. Don't forget notepad.
Logged

James

  • Throw THIS at THAT!
  • Global Moderator
  • Gonarch
  • *******
  • Offline Offline
  • Posts: 3663
  • <3
    • View Profile
    • Resident Evil : Cold Blood
Re: How to change the Origins on a Weapon Model
« Reply #12 on: June 27, 2005, 04:30:51 PM »

Oh yeah, how could I have forgotten about the mighty notepad!
Logged

Jrloco

  • Vortigaunt
  • *****
  • Offline Offline
  • Posts: 122
  • Yeah.
    • View Profile
Re: How to change the Origins on a Weapon Model
« Reply #13 on: December 10, 2005, 02:50:01 AM »

Nice tut minuit
Logged

Papa Ebauns

  • Houndeye
  • ****
  • Offline Offline
  • Posts: 84
    • View Profile
Re: How to change the Origins on a Weapon Model
« Reply #14 on: December 10, 2005, 04:38:22 AM »

Nice bump.
Logged
Pages: [1] 2