Equip system

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
NoodlePowa
Posts: 32
Joined: Sun Jul 15, 2007 1:02 pm
Location: California

Equip system

Post 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. ^_^
Praetor
Posts: 42
Joined: Wed Jun 20, 2007 2:31 am

Post 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);
"Surely we don’t need to waste resources on pathfinding; they just need to walk along the shortest route from one place to another." - EA Producer
NoodlePowa
Posts: 32
Joined: Sun Jul 15, 2007 1:02 pm
Location: California

Post 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!
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

Sounds interesting. Where can I find a tutorial regarding this? Thanks.
Praetor
Posts: 42
Joined: Wed Jun 20, 2007 2:31 am

Post 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....
"Surely we don’t need to waste resources on pathfinding; they just need to walk along the shortest route from one place to another." - EA Producer
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post 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. :)
NoodlePowa
Posts: 32
Joined: Sun Jul 15, 2007 1:02 pm
Location: California

Post by NoodlePowa »

Cool. Thank you for your help! :D

I'll come back when I have some more questions, which is probably inevitable. xD
NoodlePowa
Posts: 32
Joined: Sun Jul 15, 2007 1:02 pm
Location: California

Post 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!
Praetor
Posts: 42
Joined: Wed Jun 20, 2007 2:31 am

Post 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
"Surely we don’t need to waste resources on pathfinding; they just need to walk along the shortest route from one place to another." - EA Producer
T_Aubuchon
Posts: 15
Joined: Fri Mar 04, 2005 1:06 am
Location: Rockford, IL USA

Equip system

Post 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.
NoodlePowa
Posts: 32
Joined: Sun Jul 15, 2007 1:02 pm
Location: California

Re: Equip system

Post 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:
"Be not ashamed of mistakes and thus make them crimes."
-Confucius
NoodlePowa
Posts: 32
Joined: Sun Jul 15, 2007 1:02 pm
Location: California

Post by NoodlePowa »

...I sent you a PM...
"Be not ashamed of mistakes and thus make them crimes."
-Confucius
Post Reply