Hide bone through Kismet

I’m working on a UDK project and need to hide a skel mesh bone through a kismet node. I wrote a custom node for it but I get an error when calling the function. The code for the node is the following:


/**
* This kismet node is used to hide a bone
*/
class SeqAct_BoneRemoval extends SequenceAction;

var() Object SkelMesh;
var() name BoneName;

function Activated()
{
    SkeletalMeshComponent(SkelMesh).HideBoneByName( BoneName,PBO_Term );
}

defaultproperties
{
HandlerName="HideBoneByName"
ObjName="Bone Removal"
ObjCategory="Misc"
VariableLinks.Empty
VariableLinks(0)=(ExpectedType=class'SeqVar_Object',LinkDesc="Target",PropertyName=Targets)
}

When I try to use the node I get the following error:

‘Object SkeletalMeshComponent_32 has a function named HideBoneByName, but it either has a return value or doesn’t have exactly one parameter’

Can anyone help? Is there any other way to remove bones?

I don’t see much wrong with the code and the error seems quite obscure. perhaps the warning is just confused

then again…

your typecasting seems wrong?
you’re typecasting var(class) instead of class(var)

how about this:

Sorry that was just a typo when I copied the code, typecasting is correct but I still get the error. :frowning: Could the fact that the function is native be why I can’t call it from Kismet?

Cant help here, but im interested in why do you want to hide a bone from a skel mesh?What use does it make for you?

Death scenes, I want to do dismemberment in some cases but it needs to stay dynamic.

dynamic, how so?

Dynamic as in the player will be able to choose from multiple characters.

so what? you can do dismemberment with the classic method without hiding bones. you still can make paperdolling character parts

Classic method as in? But regardless I would really like to implement a way to do it through Kismet.

the classic method as in, the one that Epic made for Gears and included in UDK, for which I made a tutorial 6 years ago :slight_smile:

what you’re doing in kismet is calling unrealscript code anyway, which doesnt need to be different

anyway the other thing I can think of when looking at your code:
what are you plugging as SkelMesh object node in Kismet?

Your tutorial only talks about dismemberment triggered by hits, which is something I’m not really after right now. As for your second question I have a ‘Get Property’ node in Kismet that takes the SkeletalMeshComponent from a SkeletalMeshActor, and that’s plugged into the custom node I wrote.

And yes I know that I’m writing code regardless, but I plan to expand the project to a couple other people and they don’t have unrealscript knowledge.

I guess I could use a matinee for the death sequence, but this doesn’t really help because I don’t think there’s a way to trigger dismemberment through matinee either.

my dismemberment is triggered by code, which means you can trigger it with whatever you want - not only hits

Do you think I can create an actor that once attached to a slot on a skeletal mesh actor dismembers that part of the body once an event is triggered?

sure but I don’t even see why you need an actor
you want to fire an event in Kismet that causes dismember, right?
there’s several ways to do it, but it would be nice to know what it is that will trigger that event

Character position could work, but to be honest with you I’d love to just be able to trigger it through kismet/console or anything for testing purposes.

and I’m telling you, you can do it via Kismet
you can code your own Kismet node to do whatever you want it to do (the code in unrealscript)

but you keep missing my questions and therefore I cannot accomplish helping you

You asked what will trigger the event. I said player position, so for example a volume check in Kismet. But as I said anything will do, I’m not interested in what event triggers the dismemberment at the moment, I’m just trying to figure out how to make the node to dismember the character.

If there’s any other information I need to provide feel free to ask, I really appreciate your help.

ok so any event will do. and you already know how to make custom kismet nodes.
so all you need now is to make the dismemberment. the code posted there can be placed in your kismet node.

just watch out for the mesh requirements. if you already have ready-made characters it might not be the best method for you

Edited the node with your data:


/**
* This kismet node is used to break a bone
*/
class SeqAct_BoneRemoval extends SequenceAction;

var() Object SkelMesh;
var() Vector Impulse, HitLoc;
var() int LODIdx;

function Activated()
{
	SkeletalMeshComponent(SkelMesh).BreakConstraint(Impulse, HitLoc, 'b_MF_Head');
	for (LODIdx=0; LODIdx < SkeletalMeshComponent(SkelMesh).LODInfo.length; LODIdx++ )
	SkeletalMeshComponent(SkelMesh).ToggleInstanceVertexWeights(true, LODIdx);
}

defaultproperties
{
HandlerName="BreakConstraint"
ObjName="Bone Removal"
ObjCategory="Misc"
VariableLinks.Empty
VariableLinks(0)=(ExpectedType=class'SeqVar_Object',LinkDesc="Target",PropertyName=Targets)
}

Unfortunately I still get the same error as before. I don’t think it’s an issue with the function itself, since even if I leave it empty I get the same error. The problem seems to come from the HandlerName function.