PDA

View Full Version : Spawning skeletal meshes with other items



Quillisia
02-01-2010, 03:54 PM
Hey guys

I want to create a custome npc using the unreal anims. I would like to have some cloth and particle effects on the character too. I understand there are plenty of tutorials dotted around on how specifics but I can't find anything that offers more of an overview on how to go about doing this.

I should mention I am new to UDK and very new to programming.

Currently I have a game mode which is extending of UTDeathmatch. I then have a custom pawn extending off UTPawn which currently has the code that TheAgent offered in another thread. http://forums.epicgames.com/showpost.php?p=27061187&postcount=20


class AdvModellingPawn extends UTPawn;

// members for the custom mesh
var SkeletalMesh defaultMesh;
var MaterialInterface defaultMaterial0;
var AnimTree defaultAnimTree;
var array<AnimSet> defaultAnimSet;
var AnimNodeSequence defaultAnimSeq;
var PhysicsAsset defaultPhysicsAsset;




simulated function SetCharacterClassFromInfo(class<UTFamilyInfo> Info)
{
Mesh.SetSkeletalMesh(defaultMesh);
Mesh.SetMaterial(0,defaultMaterial0);
Mesh.SetPhysicsAsset(defaultPhysicsAsset);
Mesh.AnimSets=defaultAnimSet;
Mesh.SetAnimTreeTemplate(defaultAnimTree);

}

defaultproperties
{
defaultMesh=SkeletalMesh'Staffs.Mesh.Test'
defaultAnimTree=AnimTree'CH_AnimHuman_Tree.AT_CH_H uman'
defaultAnimSet(0)=AnimSet'CH_AnimHuman.Anims.K_Ani mHuman_BaseMale'
defaultPhysicsAsset=PhysicsAsset'CH_AnimCorrupt.Me sh.SK_CH_Corrupt_Male_Physics'

Begin Object Name=WPawnSkeletalMeshComponent
AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_ Human'
End Object
}


This changes the character to the mesh I want and works fine. (although I still do not understand how exactly it works, if someone cares to explain to me)

I would now like to attach a cloth item to the mesh. I have the cloth working if I skin it to a bone (in this case the shoulder bone which I am not using) and set that to cloth. The cloth however does not collide with the mesh. I did some searching and found out you need to use two different skeletal meshes. This works but only if I do it all in the editor.

How do I go about having an npc spawn with the cloth? I presume this must be in the code but I do not even know where to start.

I would also like to have some particle effects, something like a dust/glow cloud. How should I go about spawning an npc with this as well?

What is the general pipeline/workflow I should be doing?

Sorry for the block of text, I thought it best to explain my situation fully.

Thanks guys

mightyenigma
04-26-2011, 06:41 PM
Wish I knew. I'm trying to get a character to have a cloth in his hand that he wipes his helmet with.