Page 1 of 1

Equip system

Posted: Sat Jul 21, 2007 12:30 am
by NoodlePowa
I've been trying to figure out a way to create a system where you can equip armor, weapons, accessories, etc. I do not know how to do this. I've heard of some kind of skeletal system, but I'm not sure how that works either...

I would appreciate any help. ^_^

Posted: Sat Jul 21, 2007 8:34 pm
by Praetor
If you have a mesh with a skeleton (this only works with .b3d, .ms3d and .x models last I checked) you can parent a mesh (or any other node for that matter) to any joint on that skeleton.

Here's an example to attach a weapon to the hand of a .x mesh:

Code: Select all

ISceneNode* hand = 
character_Node->getXJointNode("hand");//for an .ms3d or .b3d use getMS3DJointNode() or getB3DJointNode()

hand->addChild(weapon_Node);

Posted: Sun Jul 22, 2007 5:38 am
by NoodlePowa
Oh... thank you for your reply! ^_^

Could you explain how that skeleton system works? I'm really confused as to how it works. Is the skeleton made with the model, do I have to set it myself, or what?

Thanks!

Posted: Sun Jul 22, 2007 5:51 am
by Virion
Sounds interesting. Where can I find a tutorial regarding this? Thanks.

Posted: Sun Jul 22, 2007 6:32 am
by Praetor
The skeleton is made with the model in a 3d modelling program, so I recommend you find a tutorial for whatever modeller you use on how to set up a skeleton (I found a good one for blender a while back I'll try to find it sometime if I can). Then once exported to .x, .b3d or .ms3d you can use the code I gave earlier to acess the given joint and attached the desired items (use whatever you named the joint in the modeller for the parameter of the get joint node function).

At the moment irrlicht's skeletal stuff only supports attaching items as I showed earlier but there is a new animation system in the works (it might be in the next release but it isn't yet confirmed, you can get it off the irrlicht SVN though). With this new system you'll be able to control the skeleton dynamically in the code. This system makes, for example, ragdoll effects possible in irrlicht and makes it possible to combine animations etc.

I hope I've answered your questions, if you need anything cleared up just ask.

I'll look around for a tutorial or two if I can also....

Posted: Sun Jul 22, 2007 7:38 am
by Virion
At the moment irrlicht's skeletal stuff only supports attaching items as I showed earlier but there is a new animation system in the works (it might be in the next release but it isn't yet confirmed, you can get it off the irrlicht SVN though). With this new system you'll be able to control the skeleton dynamically in the code. This system makes, for example, ragdoll effects possible in irrlicht and makes it possible to combine animations etc.
Awesome. :)

Posted: Mon Jul 23, 2007 1:07 am
by NoodlePowa
Cool. Thank you for your help! :D

I'll come back when I have some more questions, which is probably inevitable. xD

Posted: Mon Jul 23, 2007 8:11 am
by NoodlePowa
Yes, it was inevitable that I'd ask another question. =P

How do I set the skeleton with programs such as Blender?

Again, thanks!

Posted: Mon Jul 23, 2007 9:20 pm
by Praetor
Here's a good tutorial on blender's animation/skeletal stuff, the rigging section is the one that really applies to skeletal stuff, but the whole thing is rather helpful.
http://wiki.blender.org/index.php/BSoD/ ... _Animation

Equip system

Posted: Wed Jul 25, 2007 4:15 am
by T_Aubuchon
There is an easier way of creating a equip system, skip all the attatching nodes to the skeleton blah blah junk

PM me and I will send you the source.

Re: Equip system

Posted: Wed Jul 25, 2007 9:03 am
by NoodlePowa
T_Aubuchon wrote:There is an easier way of creating a equip system, skip all the attatching nodes to the skeleton blah blah junk

PM me and I will send you the source.
Well of course! I've sent you a PM.

Blender wasn't cooperating... I had trouble weight painting. It's too bad I can't get that chunk of my life back. :wink:

Posted: Sat Jul 28, 2007 10:44 pm
by NoodlePowa
...I sent you a PM...