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?
Sorry that was just a typo when I copied the code, typecasting is correct but I still get the error. Could the fact that the function is native be why I can’t call it from 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.
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.
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
/**
* 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.