handling player character models

Blitz3D Forums/Blitz3D Programming/handling player character models

CakeMonitor(Posted 2005) [#1]
I'm making a 3D RPG in Blitz3D and want to ask how other people handle characters changing their weapons and clothes/armour.

Currently I have one mesh for a character in basic armour with a sword...

If that player equips a new helmet, say, I want to apply a new texture to just the head of the 3D model (same goes for torso, hands, feet). Is it possible to re-texture just part of a mesh and leave the rest of the surfaces unchanged?

If they equip an axe there'll be a significant change in the shape of the weapon so I'll need to display a differen't mesh. The only method I've used so far is to edit the model in a 3rd party program and delete the sword, saving this model (and all its animation frames) to a new file. Then return to the original file and delete everything but the sword and save this (and all the animailon frames) as a second file. Finally I adjust this second file so that the sword looks like an axe and save this as a third file. Then, in Blitz3D, I load the first *new* model and either the second OR the third *new* model - assigning them both to the same pivot. By calling Animate twice (i.e. once for each of the two meshes) I can make the character run with a sword or an axe. The original 3D model file never gets used.

This seems absurdly long-winded! I guess I've missed something fundimental here. So, expert coders of the forum, how do you handle characters changing their armour and weapons?

Thanks,

Martin


slenkar(Posted 2005) [#2]
have each piece of armour and equipment as seperate meshes and parent them to the bones of the model with
FINDCHILD (model,"Joint name")


CakeMonitor(Posted 2005) [#3]
Cheers Slenkar,

OK, so I can just have an animated skeleton and blitz will still let me reference the various bones within it?

I guess what you're saying is - 1 model to contain just the animation plus a bunch of 'static' models which I attach to it at runtime.

What 3D format would you recommend?

Does anyone have any sample code + media I could take a look at?

Thanks again,

M


DH(Posted 2005) [#4]
1.Create a mesh in your favorite modeller
2.Animated it in CharacterFX or Milkshape with bones (write down the names of your bones)
3.loadanimmesh the model in blitz
4.use findchild (listed above) to get a bone entity from the mesh (IE Handbone=findchild(mydude,"lefthand")
5. take your weapon or armor (Say mesh mysword) and parant it to the bone you found with find child (IE entityparent(mysword,handbone)

Now animated the model and the sword will follow the hand


slenkar(Posted 2005) [#5]
when the player gets shot by an arrow you can also parent that to the nearest bone and you get a cool 'arrow embedded in player' effect.