My first decompile

Modelling, Textures, Animating and other general engine asset topics.

My first decompile

Postby andy4729 on Sun Jan 22, 2012 12:25 pm

So I'm making a mod and am attempting to make all the artwork my own (or as little valve stuff as possible) so I'm trying to create a new crowbar/melee weapon. SO the plan is to have a look at the old one so I know what is needed within the model.

I've got mdldecompiler and extracted the model files for the v_crowbar model. I've decompiled them and that is where I'm up to. When I try to open the smds in Maya 2012 all I get is the bones and no actual model to have a look at. Maya does ask me for materials for certain smds. So I extracted the materials for the model but when trying to open them in VTFEdit I just get a "file corrupt; file too small for it's header" error. Also tried Photoshop VTF plugin. No joy.
We're squatting in a system that consistently stalls
User avatar
andy4729
Regular
Regular
 
Joined: Sat Sep 09, 2006 7:26 pm
Location: Canterbury, United Kingdom

Re: My first decompile

Postby TheDanishMaster on Sun Jan 22, 2012 8:16 pm

Just curious...

What's wrong with the SDK examples of the crowbar? They are already "decompiled" and comes with actually working scripts and such.

They're in sourcesdk_content\hl2\modelsrc\weapons\v_crowbar\
Specs:
MSI P67A-GD55, Intel Core i7 Sandy Bridge 2600k @ 3,4GHz, Corsair 8GB DDR3 1333MHz, 1TB HDD, NVidia GTX580 1,5GB GDDR5, Blu-Ray drive
Image
User avatar
TheDanishMaster
Been Here A While
Been Here A While
 
Joined: Sun Jul 26, 2009 7:02 pm

Re: My first decompile

Postby andy4729 on Sun Jan 29, 2012 8:49 pm

Just tried to open the crowbar from where you said.

I'm not really sure where to start. If I want to change the crowbar model to an axe or something where should I actually do this? Because there's loads of smds.

Is it just a case of changing the crowbar object in the Crowbar_reference smd? Although I'm not sure how to attach my new model tho the rig. Not done rigging in maya before :\
We're squatting in a system that consistently stalls
User avatar
andy4729
Regular
Regular
 
Joined: Sat Sep 09, 2006 7:26 pm
Location: Canterbury, United Kingdom

Re: My first decompile

Postby Stormy on Sun Jan 29, 2012 9:52 pm

export your axe mesh and rename it crowbar_reference.smd, then compile the .qc in the sdk example.You may need to create folders and troubleshoot a bit, the SDK examples aren't always current. But yes, if you change the reference model it will change the model in game.

Incidentally, since it doesn't pack the new compile into the half life files, if you delete your newly compiled model files, the old crowbar will just reappear in game. The engine looks in your mod folders before it looks in the game packages.
User avatar
Stormy
May Contain Skills
May Contain Skills
 
Joined: Sun Nov 28, 2010 6:03 am
Location: Cairns, QLD, AUS

Re: My first decompile

Postby andy4729 on Sun Jan 29, 2012 11:41 pm

Ahh awesome :P Thank you!

Just gotta figure out how to attach my axe to the rig now :\
We're squatting in a system that consistently stalls
User avatar
andy4729
Regular
Regular
 
Joined: Sat Sep 09, 2006 7:26 pm
Location: Canterbury, United Kingdom

Re: My first decompile

Postby andy4729 on Mon Jan 30, 2012 12:29 am

Think I got it parented to the rig.

Can anyone help me with exporting the SMD? What setting should I have in the exporter. I don't need a reference and physics layer I presume? But all I'm getting when I try to export is this:

Code: Select all
run time commands loadedfile -f -o "E:/Users/Andy/Documents/maya/projects/centralia/scenes/weapons/crowbar/Crowbar_reference.mb";
requires "stereoCamera" "10.0";
// File read in 0 seconds.
// Warning: The renderer ('base_OpenGL_Renderer') is not a registered renderer. Renderer will not be set. //
// Warning: The renderer ('base_OpenGL_Renderer') is not a registered renderer. Renderer will not be set. //
// Warning: The renderer ('base_OpenGL_Renderer') is not a registered renderer. Renderer will not be set. //
// Warning: The renderer ('base_OpenGL_Renderer') is not a registered renderer. Renderer will not be set. //
// Warning: Active stereo does not work with Aero enabled. Active stereo has been disabled. //
// Error: No object matches name: strokeGlobals.wrapH //
// Warning: swatches file depend node not found, icon discarded: head_uvw //
// Warning: swatches file depend node not found, icon discarded: crowbar_cyl //
// Warning: The currently active tab is not a scene tab.  This icon size change operation is not implemented for this tab. //
// E:/Users/Andy/Documents/maya/projects/centralia/scenes/weapons/crowbar/Crowbar_reference.mb //
commandPort -securityWarning -name commandportDefault;

E:/Users/Andy/Documents/maya/projects/centralia/
model_sources/weapons/crowbar/
models/weapons/crowbar/'e:\program' is not recognized as an internal or external command,
operable program or batch file.
// Warning: waitCursor stack empty //
select -cl  ;
// Undo: select -cl   //
// Undo: updateNode;deleteUI -window smdOptWin; smdExport( 3, `getAttr smdInfo.seperateBodyGroup` ) //
// Undo: updatePaths; //
// Undo: setAttr smdInfo.smdRef 0 //
// Undo: setAttr smdInfo.smdPhy 0 //
// Undo: smdOptionWindow //
// Undo: selectionMaskResetAll //
// Undo: refreshHyperShadePaneFrontTab firstPaneTabs false //
// Error: There are no more commands to undo. //
// Error: There are no more commands to undo. //
// Error: There are no more commands to undo. //
// Error: There are no more commands to undo. //
// Error: There are no more commands to undo. //
// Error: There are no more commands to undo. //
// Error: There are no more commands to undo. //
// Error: There are no more commands to undo. //
// Error: There are no more commands to undo. //
// Error: There are no more commands to undo. //
select -cl  ;
requires "stereoCamera" "10.0";
// File read in 0 seconds. //
// Warning: The node 'pasted__crowbar_cyl_file' still clashed with a node in the main scene.  Renaming to 'pasted__crowbar_cyl_file1'. //
// Warning: Edits on 'pasted__crowbar_cyl_file' may have been lost as a result of renaming. We strongly recommend the use of Namespaces to resolve Name Clashes. //
// Warning: The node 'pasted__head_uvw_file' still clashed with a node in the main scene.  Renaming to 'pasted__head_uvw_file1'. //
// Warning: Edits on 'pasted__head_uvw_file' may have been lost as a result of renaming. We strongly recommend the use of Namespaces to resolve Name Clashes. //
// Warning: The node 'pasted__place2dTexture1' still clashed with a node in the main scene.  Renaming to 'pasted__place2dTexture4'. //
// Warning: Edits on 'pasted__place2dTexture1' may have been lost as a result of renaming. We strongly recommend the use of Namespaces to resolve Name Clashes. //
// Warning: The node 'pasted__place2dTexture3' still clashed with a node in the main scene.  Renaming to 'pasted__place2dTexture5'. //
// Warning: Edits on 'pasted__place2dTexture3' may have been lost as a result of renaming. We strongly recommend the use of Namespaces to resolve Name Clashes. //
select -r pasted__head_uvw ;
rename pasted__head_uvw "head_uvw" ;
// Result: head_uvw //
select -r pasted__crowbar_cyl ;
rename pasted__crowbar_cyl "crowbar_cyl" ;
// Result: crowbar_cyl //
file -save;
// Result: E:/Users/Andy/Documents/maya/projects/centralia/scenes/weapons/crowbar/Crowbar_reference.mb //

E:/Users/Andy/Documents/maya/projects/centralia/
model_sources/weapons/crowbar/
models/weapons/crowbar/'e:\program' is not recognized as an internal or external command,
operable program or batch file.
// Warning: waitCursor stack empty //


..and no smd!

EDIT: Got a smd and a qc in the end, copied the smds from the example folder and replaced the reference one with my new one. Compiled the reference v_crowbar.qc so that it would just take my new reference smd along with the example animation smds. Model won't open in model viewer and there is no model at all in my mod. Can hear the swin sounds etc but just nothing visually.
We're squatting in a system that consistently stalls
User avatar
andy4729
Regular
Regular
 
Joined: Sat Sep 09, 2006 7:26 pm
Location: Canterbury, United Kingdom

Re: My first decompile

Postby Stormy on Mon Jan 30, 2012 11:21 am

The origin of your reference model is probably off. Import the original v_crowbar into your modelling program and make sure that your mesh lines up in scale and the origin points are smack on. You'll probably also have to use the hands from the old viewmodel, and rig it to the skeleton.

What I would do is take the imported reference model, delete the crowbar and merge your axe into the same object, then align it so it fits just like the crowbar did, rig it to the crowbar bone, (so you may have to import the rig .smd if it doesn't come with the reference) and then re-export.

That's how I got guns into the game.
User avatar
Stormy
May Contain Skills
May Contain Skills
 
Joined: Sun Nov 28, 2010 6:03 am
Location: Cairns, QLD, AUS

Re: My first decompile

Postby andy4729 on Mon Jan 30, 2012 12:17 pm

That's pretty much what I tried to do. Would I be able to upload it for you to have a look? I don't expect you to do it for me, just need to know what I'm doing wrong!

Attached in case you or anyone else can have a look.
Attachments
Crowbar_reference02.zip
(147.5 KiB) Downloaded 371 times
We're squatting in a system that consistently stalls
User avatar
andy4729
Regular
Regular
 
Joined: Sat Sep 09, 2006 7:26 pm
Location: Canterbury, United Kingdom

Re: My first decompile

Postby Stormy on Mon Jan 30, 2012 7:34 pm

I'll have a look when I get home, do you have all of the files in there? The reference and the rig .smd files at the very least.
User avatar
Stormy
May Contain Skills
May Contain Skills
 
Joined: Sun Nov 28, 2010 6:03 am
Location: Cairns, QLD, AUS

Re: My first decompile

Postby andy4729 on Mon Jan 30, 2012 11:01 pm

New upload has all the smds. Previous upload has the maya file.
Attachments
crowbar_replacement01.zip
(69.48 KiB) Downloaded 388 times
We're squatting in a system that consistently stalls
User avatar
andy4729
Regular
Regular
 
Joined: Sat Sep 09, 2006 7:26 pm
Location: Canterbury, United Kingdom

Re: My first decompile

Postby Stormy on Tue Jan 31, 2012 12:33 am

Wow what have you done to that smd? Delete that shit and start again. I got my crowbar_reference.smd from my soursesdk_content folder, it's pretty straightforward. Delete yours and restart SDK, it will download the original automagically. Import it into your program, replace the crowbar mesh with your own(leave the hand mesh alone and DON'T TOUCH THE BONES) and rig it the same (every vert of the crowbar is rigged 100% to bip01_r_hand). Make sure it's in the same object (mesh group, model, whatever you call it in maya) as the old mesh (and the hand model) then export and recompile. Make sure you haven't changed the $modelname line. It should read
Code: Select all
$modelname Weapons/v_crowbar.mdl
Essentially all you are doing is swapping the crowbar verts for your verts, and rigging them so the engine thinks they are the same.

Just to make sure I knew what I was talking about, I made this:
Image

I'm such a child.

EDIT:

Incidentally, if you don't want to overwrite your sourcesdk_content files (good call), export your new .smd as axe_reference.smd, open up V_crowbar.qc and change the $body line to:
Code: Select all
$body studio "axe_reference.smd"
then save the .qc file as "v_axe.qc" and compile it. That will save the source files.
User avatar
Stormy
May Contain Skills
May Contain Skills
 
Joined: Sun Nov 28, 2010 6:03 am
Location: Cairns, QLD, AUS

Re: My first decompile

Postby DonPunch on Tue Jan 31, 2012 5:36 pm

That sure is a big... match, yea match.
DonPunch
Been Here A While
Been Here A While
 
Joined: Mon Apr 12, 2010 11:23 pm

Re: My first decompile

Postby andy4729 on Tue Jan 31, 2012 7:10 pm

Huzzah!

Image

I realised that I had not done the membership crap on the layer in maya that you have needed to do since the 2011 version. If you don't make sure all the memberships are done then nothing gets exported. I'm a moron.

Only thing is, during a swing, this is what it looks like:

Image

What's that big blocky thing?!
We're squatting in a system that consistently stalls
User avatar
andy4729
Regular
Regular
 
Joined: Sat Sep 09, 2006 7:26 pm
Location: Canterbury, United Kingdom

Re: My first decompile

Postby Stormy on Tue Jan 31, 2012 10:48 pm

Looks like some badly weighted verts. Is it 100% rigid to the hand bone?
User avatar
Stormy
May Contain Skills
May Contain Skills
 
Joined: Sun Nov 28, 2010 6:03 am
Location: Cairns, QLD, AUS

Re: My first decompile

Postby andy4729 on Tue Jan 31, 2012 11:12 pm

I discovered this is actually the arm (by texturing the arm differently) that seems to be going crazy when the animation runs. The axe doesn't change during the swing (in the image, it's off screen).
We're squatting in a system that consistently stalls
User avatar
andy4729
Regular
Regular
 
Joined: Sat Sep 09, 2006 7:26 pm
Location: Canterbury, United Kingdom
Next

Return to Art Creation

Who is online

Users browsing this forum: No registered users

cron