Need to start some were in modding right? Why not try the Half-Life modding Kit. This Kit is designed to have all the tools you need to start your own Half-Life mod, simple mods can be made or advance ones like Base Defense with this small set of tools. If you want to start modding Half-Life you should try this.

Post tutorial Report RSS IRON SIGHT EXTRA: CREATE YOUR OWN IRON SIGHT

Read the summary of Server Side Coding. PLACEHOLDER

Posted by on - Basic Weapons Modelling

OOKIE LETS GET STARTED(pistol only)

Choose the model you want. Open it with a model viewer and go to Weapon Origin.

You will see some numbers here:

kektus

Modify those number to get your ideal iron sight position.

Now decompile it. After you decompile it, open the qc file with notepad. Here is an example


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

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

v_colt.mdl

Original internal name:
"v_9mmhandgun.mdl"

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

$modelname "v_colt.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 "studio" "hands_model_HEV"

$body "studio" "Colt"


// 2 attachment(s)
$attachment 0 "ber_body" -9.000000 2.800000 0.000000
$attachment 1 "ber_body" -3.000000 3.500000 0.000000

// 14 hit box(es)
$hbox 0 "base" -37.029636 -34.843513 -12.406800 0.000000 0.000000 12.406800
$hbox 0 "Bone L uparm" 0.000000 -4.380000 -2.860000 15.330000 2.790000 2.460000
$hbox 0 "Bone L lowarm" 0.000000 -3.400000 -2.570000 15.200000 2.590000 2.060000
$hbox 0 "Bone L hand" -0.060000 -1.120000 -2.220000 4.270000 1.550000 2.210000
$hbox 0 "Bone L thumbbase" 0.000000 -0.420000 -0.470000 2.260000 0.970000 0.700000
$hbox 0 "Bone L thumb mid" 0.000000 -0.690000 -0.460000 1.526287 0.570000 0.760000
$hbox 0 "Bone R uparm" 0.000000 -4.370000 -2.470000 15.330000 2.800000 2.850000
$hbox 0 "Bone R lowarm" 0.000000 -3.390000 -2.070000 15.200000 2.600000 2.560000
$hbox 0 "Bone R hand" -0.120000 -1.090000 -2.200000 4.190000 1.790000 2.220000
$hbox 0 "Bone R thumbbase" 0.000000 -0.500000 -0.560000 2.240000 1.010000 0.550000
$hbox 0 "Bone R thumb mid" 0.000000 -0.690000 -0.640000 1.420397 0.550000 0.570000
$hbox 0 "ber_body" -8.860000 -3.500000 -0.740000 2.040000 3.160000 0.760000
$hbox 0 "ber_mag" -1.240000 -3.870000 -0.590000 1.400000 1.980000 0.610000
$hbox 0 "ber_slide" -7.030000 -0.590000 -0.710000 2.850000 0.970000 0.730000

// 9 animation sequence(s)
$sequence "longidle" "longidle" fps 30
$sequence "idle_1" "idle_1" fps 30
$sequence "idle_2" "idle_2" fps 30
$sequence "fire1" "fire1" fps 30 { event 5001 0 "11" }
$sequence "fire_last" "fire_last" fps 30 { event 5001 0 "11" }
$sequence "reload_empty" "reload_empty" fps 32 {
{ event 5004 8 "weapons/glock_magout.wav" }
{ event 5004 30 "weapons/glock_magin.wav" }
{ event 5004 47 "weapons/glock_slideforward.wav" }
}
$sequence "reload" "reload" fps 31 { event 5004 8 "weapons/glock_magout.wav" } { event 5004 30 "weapons/glock_magin.wav" }
$sequence "deploy" "deploy" fps 30
$sequence "idle_3" "idle_3" fps 30

// End of QC script.


Under eyeposition add

$origin 0.000000 0.000000 0.000000

and change those zeros into your sight number.

Compile it, copy the model into another folder and decompile it again.

Now copy 1 idle animation, 1 fire animation and the qc file and rename the animations and paste it into your first decompile folder.

Open the qc and modify this part:


// 9 animation sequence(s)
$sequence "longidle" "longidle" fps 30
$sequence "idle_1" "idle_1" fps 30
$sequence "idle_2" "idle_2" fps 30
$sequence "fire1" "fire1" fps 30 { event 5001 0 "11" }
$sequence "fire_last" "fire_last" fps 30 { event 5001 0 "11" }
$sequence "reload_empty" "reload_empty" fps 32 {
{ event 5004 8 "weapons/glock_magout.wav" }
{ event 5004 30 "weapons/glock_magin.wav" }
{ event 5004 47 "weapons/glock_slideforward.wav" }
}
$sequence "reload" "reload" fps 31 { event 5004 8 "weapons/glock_magout.wav" } { event 5004 30 "weapons/glock_magin.wav" }
$sequence "deploy" "deploy" fps 30
$sequence "idle_3" "idle_3" fps 30

// iron sight anims

$sequence "sight_idle" "sight_idle" fps 30
$sequence "sight_fire" "sight_fire" fps 30
$sequence "sight_fire_last" "sight_fire_last" fps 30

// End of QC script.


Compile it and its done! YAYYYYY!!!!!


Post comment Comments
Sgt.McHale
Sgt.McHale - - 302 comments

I don't recommend de-compiling the model twice, it will mess with the textures.

Reply Good karma Bad karma+1 vote
curseofnight
curseofnight - - 134 comments

That's why you only re-compile with the ref .smd(s) from your first de-compiled model(as in the tutorial). Assuming you only want to edit the anim .smds, de-compiling the model multiple times can save you a lot of work(i.e., changeing the model's origin in preperation for additional anim tweaks).

Besides, even if someone does mess up their texture alignment by de-compiling and re-compiling the same model again and again, the UV map can be re-aligned in seconds in milk, max, whatever.

Reply Good karma Bad karma+1 vote
Sgt.McHale
Sgt.McHale - - 302 comments

Use paranoia model viewer, you can do all of these changes with no need to decompile the model.

Reply Good karma Bad karma+1 vote
Tonciwinner6470
Tonciwinner6470 - - 2 comments

How do I tie it to special (Mouse 2) key??

Reply Good karma Bad karma+1 vote
Guest
Guest - - 689,556 comments

bind

Reply Good karma Bad karma+1 vote
Guest
Guest - - 689,556 comments

This comment is currently awaiting admin approval, join now to view.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: