Pages: [1]
Author Topic: Custom skeletons  (Read 27636 times)
Botjer
Guardsman
**
Posts: 8


View Profile
« on: February 05, 2008, 10:57:02 PM »

Hi, i guess you're adding your own skeletons to the game.
Im a smalltime modder and i cant find any information about skeletons at all, and definetly not about adding new ones.
I have the model is done.
the skeleton is done.
a first round of weighting is done.

what i need to know is the process of getting the skeleton to work, along with its animations. its for an npc.

Could you help me, please?
Logged

ChromeAngel
Administrator
Marine Chaplain
*****
Posts: 1267


View Profile WWW
« Reply #1 on: February 06, 2008, 09:15:41 AM »

Ah well, it really all comes down to animations and activities.  Their is a way of mapping animations from one skeleton to another in the source SDK, but in my experience that just screwed up the animation.  

We ended up making our own sets of animations from scratch for each skeleton (each tyranid class having it's own unique skeleton plus one for the marines).  Refining our DIY animations is large chunk of the work remaining on EX.  Volunteer animators seem to be as rare as hens teeth, so I suggest you start learning to animate your skeleton yourself.
Logged

Typheron
Moderator
Marine Chaplain
*****
Posts: 939



View Profile WWW
« Reply #2 on: February 06, 2008, 09:24:20 AM »

Having worked on a few of the Ex animations, what Chrome said is sadly true, your going to have to create a custom set of animations for your model.

Although it depends on the kind of model, as our PDF meatshields are of similar proportions to the Half Life 2 character models (and were built using the HL2 default skelition). Thus we did not need to animate them.

Knowing what it is your modeling would be a help. A standard human shape could possably utilise the existing HL2 skelitions if its proportions are similar enough.

Beyond this a trip into Valves Wiki on the suybject would be your best bet.
Logged

God of the outer darkness. bringer of evil, storms, plague, misery, and torment. Protects fugitives, Apparently...

Botjer
Guardsman
**
Posts: 8


View Profile
« Reply #3 on: February 06, 2008, 09:45:28 AM »

well i know i have to make my own animations or use that function to get animations from another skeleton.

but it doesnt bother me much.

Ive made a xenomorph model.

What i want to know is how to set import the skeleton into the game and set up the files and code for it.

and while your at it you can tell me how to set up the animations Tongue

ive done animations for bf2 mod earlier.

and no i havnt found anything about it in valves wiki.
Logged

Typheron
Moderator
Marine Chaplain
*****
Posts: 939



View Profile WWW
« Reply #4 on: February 06, 2008, 11:02:47 AM »

Ah, chrome is going to have to field that one as he did the compiling.

Although from my basic understending of what happened, it involves writing some kind of file with the list of animations tied to some code for each animation (basically flagging it as such).
Logged

God of the outer darkness. bringer of evil, storms, plague, misery, and torment. Protects fugitives, Apparently...

Botjer
Guardsman
**
Posts: 8


View Profile
« Reply #5 on: February 06, 2008, 08:08:36 PM »

ok ill just wait with anticipation then
Logged

ChromeAngel
Administrator
Marine Chaplain
*****
Posts: 1267


View Profile WWW
« Reply #6 on: February 06, 2008, 08:24:33 PM »

Are you planning to replace the model of an existing NPC (such as the fast zombie) or make one from scratch?
Logged

Botjer
Guardsman
**
Posts: 8


View Profile
« Reply #7 on: February 06, 2008, 08:47:03 PM »

from scratch.
Logged

ChromeAngel
Administrator
Marine Chaplain
*****
Posts: 1267


View Profile WWW
« Reply #8 on: February 07, 2008, 11:26:43 AM »

Assuming you have already created your mod using the Source SDK...

Source models are made up of 3 kinds of files:
    * Reference SMDs - contains the geometry of the model, skin names the skeleton heirarchy and rigging.
    * Animation SMDs - containing the skeleton and describes one animation
    * QC file - Script telling the compiler how to put it all together.


You need to get your model exported into SMD reference format and each of it's animations into SMD animation format.  You might need a plugin or extension for your modelling app to get it to export SMDs.
Source SMDs are a bit different from half-life 1 SMDs so mak sure you get them in the right format.

QC files are just text documents with a .QC extension so whip open notepad (or your prefered text editor) and stick in the following:
Code:

//path and name of the final model relative to the sourcemods/yourmod/models folder
$modelname npc/xenomorph.mdl

// Directory of skin materials sourcemods/yourmod/materials folder
$cdmaterials models/npc/xenomorph/

//Sometimes it comes out larger or smaller than expected in-game, use this to adjust it's in-game size
$scale 1.0

//Sometimes it's not where you expect it to be in-game, use this to adjust it's origin (mainly used for view weapons)
$origin 0 0 0

//Check the valve wiki for other surface props
$surfaceprop flesh

//Where are it's eyes (relative to the origin)
$eyeposition 0.000 0.000 128.000

//name of your models refrence SMD
$body studio "reference"

//describe your animation sequences : name , smd file name , acitivity from the valve wiki, weight (if you have several animations for the same activity), the frames per second to play it back at
$sequence idle_lower "idle" activity ACT_HL2MP_IDLE 1 fps 30 loop

// Example run/walk combinging multiple animations into one sequence that can be contorolled by the NPCs angle in-game
$animation a_RunSW run_sW startloop 0 LX LY alignto Idle_lower rotateto 135 fps 30.00
$animation a_RunS run_s startloop 0 LX LY alignto Idle_lower rotateto -180 fps 30.00
$animation a_RunSE run_se startloop 0 LX LY alignto Idle_lower rotateto -135 fps 30.00
$animation a_RunE run_e startloop 0 LX LY alignto Idle_lower rotateto -90 fps 30.00
$animation a_RunNE run_ne startloop 0 LX LY alignto Idle_lower rotateto -45 fps 30.00
$animation a_RunN run_n startloop 0 LX LY alignto Idle_lower rotateto 0 fps 30.00
$animation a_RunNW run_nw startloop 0 LX LY alignto Idle_lower rotateto 45 fps 30.00
$animation a_RunW run_w startloop 0 LX LY alignto Idle_lower rotateto 90 fps 30.00
$animation a_RunZero "idle" loop

$sequence Run_lower "a_RunS" loop ACT_HL2MP_RUN 1 fps 30.00 {
  blendwidth 9
  blend move_yaw -180.000000 180.000000
  a_RunS a_RunE a_RunNE a_RunN a_RunNW a_RunW a_RunS a_RunS
}

//Example technique for creating "gesture" sequences, used by weapons to modify an NPCs exising activity
$animation a_attack "primary_attack"
$animation b_attack "primary_attack" subtract a_attack 0
$sequence attack "b_attack" activity ACT_HL2MP_GESTURE_RANGE_ATTACK_SMG1 1 fps 30 delta


Read and inwardly digest the comments (QC uses "C" style comments).  Their are more QC commands on the wiki, but those are the core.

Notice the mention of materials, Source uses 2 files for each material(model skin in this case)
    * VTF - Binary file, I suggest you use VTFEdit to convert your skins to VTF format, it doesn't come with the SDK but IMHO it's an essential Source modding tool.
     * VMT - A text file that describes what shaders and VTFs to use.  The skin name in you model will cause Source to look for a VMT of that name in the folder specified by $cdmaterials


Heres a sample VMT for a model skin (NOTE VTF edit can generate VMTs for you but assumes they are for map textures and so specifies the wrong shader)
Code:

//Shader used for models
"VertexLitGeneric"
{
//Required, refers to the VTF file for the models colour map
"$basetexture" "models/npc/xenomorph/xenomorph_sheet"

//Required, tells Source this is going to be used on a model
"$model" 1

//Optional
"$surfaceprop" "flesh"

//Optional use the normal maps alpha channel for how shiny to make that pixel and how strong the mapping is
"$normalmapalphaenvmapmask" 1  

//Optional, refers to the VTF file for the models normal map
"$bumpmap" "models/npc/xenomorph/xenomorph_normalmap"

//Optional, used for normal mapping
"$envmap" "env_cubemap"

//Optional, used to tint reflections in the normal map
"$envmaptint" "[1.0 1.0 1.0]"

//Optional, used to adjust contrast of reflections in the normal map
"$envmapcontrast" 1.0
}


OK now stick all your SMDs and QC script into a single folder, start up the Source SDK, select your mod from the drop down,
find the studiomdl.exe in the Source SDK/bin folder and drag 'n' drop the QC file on to it.  It will throw up a load of tetx in a DOS window which will vanish when it it's done.  It *should* then compile into a bunch of binary files in SourceMods/yourmod/models/npc/.

It probably wont, the odds of you getting this right first time are minuscule, just because it is so picky.  So you'll want to open up a command prompt and run studiomdl.exe from there, giving it the full path to your QC file.  It should then hint at whereabouts it's gone wrong.

You should now have a model you can look at in the Model Viewer and assign to your new npc.

OK?    :wink:
Logged

Botjer
Guardsman
**
Posts: 8


View Profile
« Reply #9 on: February 07, 2008, 10:55:42 PM »

THANKS:D
been busy today but ill try that asap.
thanks alot. ive been all over the net trying to find answers.
Logged

Botjer
Guardsman
**
Posts: 8


View Profile
« Reply #10 on: February 15, 2008, 10:47:46 AM »

cant get my mdl decompiler to work. steam app id bug. and the fixes dont work.

is there anywhere i can get info about what animations say fast zombie uses. how you set up animations for the game etc..

why cant i get the damn decompiler to work...
Logged

Botjer
Guardsman
**
Posts: 8


View Profile
« Reply #11 on: February 15, 2008, 10:52:44 AM »

and now suddenly it works...
Logged

Typheron
Moderator
Marine Chaplain
*****
Posts: 939



View Profile WWW
« Reply #12 on: February 15, 2008, 01:40:02 PM »

Yeh Valve related software is liek that, i recomend sacraficing a small chicken to it when you absolutly have to make it work.
Logged

God of the outer darkness. bringer of evil, storms, plague, misery, and torment. Protects fugitives, Apparently...

Botjer
Guardsman
**
Posts: 8


View Profile
« Reply #13 on: February 15, 2008, 02:15:00 PM »

writes down *small chicken*
and how many candles and how many times must i turn to my phallic totem?
anyways now ill be on my way moehehehe
Logged

Pages: [1]
Print
Jump to: