Compiled model positioning

Got problems with your models? Struggling with textures? Get help with your custom assets.

Compiled model positioning

Postby Goonie on Thu May 02, 2013 10:51 pm

I made a model that will replace sniper rifle in L4D 2. I got .qc file from the guy who compiled sniper rifle with it too. I changed a bit that .qc so it compile my model and find my textures, however Im getting problem like in pictures bellow. Weapon model is somehow positioned wrong.

Thirdperson view
Image

Firstperson view
Image

Heres .qc file:
Code: Select all
$cd "C:\sg mdls\vqc"
$origin 0 0 0 -90
$modelname "v_models\v_sniper_military.mdl"
$include "sharedbones.qci"   
$model "main" "mattock.smd"

$poseparameter ver_aims -1.00 1.00
$poseparameter move_x -0.50 0.50

$cdmaterials "models\mattock\"

$hboxset "default"
$hbox 0 "ValveBiped.Bip01" 0.000  0.000  -0.018  20.239  17.853  4.890

$attachment "attach_shell_eject" "weaponpart_ie" 0.00 -23.80 1.95 rotate -0.00 -90.00 0.00
$attachment "attach_muzzle" "weaponpart_ie" 0.00 -23.80 1.95 rotate -0.00 -90.00 0.00
$attachment "muzzle_flash" "weaponpart_ie" 0.00 -23.80 1.95 rotate -0.00 -90.00 0.00
//$attachment "flashlight" "weaponpart_ie" -1.25 -18.50 2.25 rotate -0.00 -90.00 0.00 // ez_jamin
$attachment "flashlight" "weaponpart_ie" -1.34 -16.85 2.35 rotate -0 -90 0 // FAS
$attachment "shell" "weaponpart_ie" 0.00 1.00 2.20 rotate -25.00 -155.00 0.00
$attachment "attach_camera" "ValveBiped.attach_camera" -0.00 0.00 0.00 rotate -0.00 0.00 0.00
$attachment "camera" "ValveBiped.Camera" 0.00 0.00 -0.00 rotate -0.00 0.00 0.00
$attachment "fowardnode" "weaponpart_ie" 0.00 0.00 0.00 rotate -0.00 -90.00 0.00
$include "bonesaver_attachments.qci"

$surfaceprop "default"
$illumposition -0.000 7.307 -31.193

$animation idle_delta "idle.smd" fps 0.0435

$animation look_down "look_down" fps 30.000000 subtract idle_delta 0
$animation look_mid "look_mid" fps 30.000000 subtract idle_delta 0
$animation look_up "look_up" fps 30.000000 subtract idle_delta 0
$sequence look_poses "look_up" fps 30.00 node Ready {
  blendwidth 3
  blend ver_aims -1.000000 1.000000
  delta
 look_mid look_down
}

$sequence idle_raw "idle_raw" loop fps 30.00 node Ready
$animation ta_trans_run "ta_trans_run" loop fps 40.000000
$animation ta_trans_idle "ta_trans_idle" loop fps 30.000000
$sequence idle "idle" loop ACT_VM_IDLE 1 fps 10.00 node Ready {
  blendwidth 3
  blend move_x -0.500000 0.500000
 ta_trans_idle ta_trans_run
  //addlayer look_poses
}

//$sequence deploy "deploy" ACT_VM_DEPLOY 1 fps 30.00 node Drawgun
$sequence deploy_layer "deploy" ACT_VM_DEPLOY_LAYER 1 fps 30.00 subtract idle_delta 0 node Drawgun {
 delta
  { event 5004 1 "Sniper_Military.Deploy" }
  { event 5004 12 "Sniper_Military.Pushbutton" }
}

//$sequence fire "fire" ACT_VM_PRIMARYATTACK 1 fps 30.00 node Bang
$sequence fire_layer "fire" ACT_VM_PRIMARYATTACK_LAYER 1 fps 30.00 subtract idle_delta 0 node Bang {
 delta
  { event AE_MUZZLEFLASH 0 "1" }
  { event AE_CL_CREATE_PARTICLE_EFFECT 0 "muzzle_lee_sniper follow_attachment muzzle_flash" }
  { event AE_CL_CREATE_PARTICLE_EFFECT 0 "muzzle_fire_sniper follow_attachment muzzle_flash" }
  { event AE_CL_CREATE_PARTICLE_BRASS 1 "weapon_shell_casing_rifle shell" }
}

$sequence reload_raw "reload" fadein 0.1 fps 25.00 node Rld {
}
$sequence fire_raw "fire" fps 30.00 node Bang {
  { event AE_MUZZLEFLASH 0 "1" }
  { event AE_CL_CREATE_PARTICLE_EFFECT 0 "muzzle_lee_sniper follow_attachment muzzle_flash" }
  { event AE_CL_CREATE_PARTICLE_EFFECT 0 "muzzle_fire_sniper follow_attachment muzzle_flash" }
  { event AE_CL_CREATE_PARTICLE_BRASS 1 "weapon_shell_casing_rifle shell" }
}

$sequence reload "reload" ACT_VM_RELOAD 1 fadein 0.1 fps 25.00 node Rld
$sequence reload_layer "reload" ACT_VM_RELOAD_LAYER 1 fadein 0.1 fps 25.00 subtract idle_delta 0 node Rld {
 delta
  { event 5004 0 "Sniper_Military.Deploy" }
  { event 5004 25 "Sniper_Military.ClipOut" }
  { event 5004 36 "Sniper_Military.ClipIn" }
  { event 5004 43 "Sniper_Military.ClipLocked" }
  { event 5004 59 "Sniper_Military.BoltBack" }
  { event 5004 68 "Sniper_Military.BoltForward" }
}

//$sequence melee "melee" ACT_VM_MELEE 1 fps 30.00 node Bash
$sequence melee_layer "melee" ACT_VM_MELEE_LAYER 1 fps 30.00 subtract idle_delta 0 node Bash {
 delta
}
Goonie
Regular
Regular
 
Joined: Thu Aug 19, 2010 7:13 pm

Re: Compiled model positioning

Postby Black_Stormy on Fri May 03, 2013 12:20 am

Are you editing this in a 3d package or just recompiling from .smd files? This would be easiest to rectify in a 3d package since you could just rotate and reposition the model relative to the bones and (hopefully) that would fix it.

If you want to go about it the hard way, you're going to have to fiddle with the $origin line in your .qc to move it, and rotate it on the z axis - https://developer.valvesoftware.com/wiki/$origin

Although it looks to me like your model is on its side? In that case you're going to need to rotate around more than just the z axis, I recommend you get it into a 3d program to fix it. If you use blender I can help, not sure about the rest.
User avatar
Black_Stormy
May Contain Skills
May Contain Skills
 
Joined: Sun Nov 28, 2010 6:03 am
Location: Cairns, QLD, AUS

Re: Compiled model positioning

Postby Goonie on Fri May 03, 2013 12:34 pm

I will try to change the origin like you said and also the rotation on atachments. I will give an answer later if it help.
Goonie
Regular
Regular
 
Joined: Thu Aug 19, 2010 7:13 pm

Re: Compiled model positioning

Postby Goonie on Fri May 03, 2013 9:34 pm

I changed model positions in 3d modeling program to same position as original from game and thirdpeson view now work, however in firstperson, model is missing. I cheked original model and it worked in game, but with my model dissapear.
Goonie
Regular
Regular
 
Joined: Thu Aug 19, 2010 7:13 pm

Re: Compiled model positioning

Postby LordDz on Fri May 03, 2013 10:42 pm

Er.. Source uses separate models for first person and thirdperson/the player model.
User avatar
LordDz
May Contain Skills
May Contain Skills
 
Joined: Mon Sep 01, 2008 12:28 pm
Location: Hammer Crash Logs

Re: Compiled model positioning

Postby Goonie on Fri May 03, 2013 11:15 pm

LordDz wrote:Er.. Source uses separate models for first person and thirdperson/the player model.


I used difirent models for firstperson and thirdperson view. I mean I changed the position in 3d modeling program. Problem is that firstperson model is in the same position as original model was and it doesnt work in game.
Goonie
Regular
Regular
 
Joined: Thu Aug 19, 2010 7:13 pm

Re: Compiled model positioning

Postby Black_Stormy on Sat May 04, 2013 2:32 am

You have to make sure it's rigged to the bones properly. If you move it in your 3d program you have to move it relative to the armature so that the whole bone structure isn't moved. It's a bit complex but there are tutorials out there for viewmodels.
User avatar
Black_Stormy
May Contain Skills
May Contain Skills
 
Joined: Sun Nov 28, 2010 6:03 am
Location: Cairns, QLD, AUS

Re: Compiled model positioning

Postby Goonie on Sat May 04, 2013 7:39 pm

Well acording to "Compiling L4D2 First-Person Weapon Models" tutorial on some site, theres no need for that Black_stormy.
Goonie
Regular
Regular
 
Joined: Thu Aug 19, 2010 7:13 pm

Return to Custom Asset Help

Who is online

Users browsing this forum: Bing [Bot]

cron