/**
* This kismet node is used to hide a bone
*/
class SeqAct_BoneRemoval extends SequenceAction;
var() Object SkelMesh;
var() name BoneName;
defaultproperties
{
ObjName="Bone Removal"
ObjCategory="Misc"
VariableLinks.Empty
VariableLinks(0)=(ExpectedType=class'SeqVar_Object',LinkDesc="Target",PropertyName=Targets)
}
Then I added to SkeletalMeshComponent.uc this function:
function OnBoneRemoval(SeqAct_BoneRemoval Action, SkeletalMeshComponent SkelMesh, name BoneName)
{
(SkelMesh).HideBoneByName(BoneName,PBO_Term);
}
Once again I get the same error. At this point I’m fairly sure it’s not a matter of syntax, so there must be something else that’s not working properly. Any suggestion?
EDIT: Found someone that encountered the same error as I did:
They said ‘solved the error part.
forgot the sequence class and method name in the function call as the error correctly tells me to do’
I finally managed to get the node to work, but there’s still work to do. To make it work I removed the typecasting from the function, and also removed all parameters but one.
SeqAct_BoneRemoval.uc
/**
* This kismet node is used to hide a bone
*/
class SeqAct_BoneRemoval extends SequenceAction;
var() Object SkelMesh;
var() name BoneName;
defaultproperties
{
ObjName="Bone Removal"
ObjCategory="Misc"
VariableLinks.Empty
VariableLinks(0)=(ExpectedType=class'SeqVar_Object',LinkDesc="Target",PropertyName=Targets)
}
SkeletalMeshComponent.uc
function OnBoneRemoval(SeqAct_BoneRemoval Action)
{
HideBoneByName('b_MF_Head',PBO_Term);
}
Unfortunately I cannot pass the bone name as a variable to the function, which means I cannot change the bone from the Kismet. I could make a function for each bone but that’s really bad design and it would only postpone the problem: if instead of hiding the bone I want to use BreakConstraint I’ll need to pass the function the hit vector, and that MUST be done through kismet. Any idea on how to proceed?
is it both the casting and the params that break it? can you confirm it’s not just one of the two?
if it all fails you could make a new name var in the skeletalmeshcomponent where you set the bone from a new kismet node first, and then call your BoneRemoval kismet node which would use the previously saved bone name
SkeletalMeshComponent_32 is the name of an instance of an object in the level, not a variable in the context of the class.
in short: you cannot call it like that
for testing try to just iterate on all skeletal mesh actors, and use the skeletalmeshcomponent from them
function OnBoneRemoval(SeqAct_BoneRemoval Action)
{
local Sequence GSeq;
local array<SequenceObject> AllSeqObjs;
local int i;
local name FoundBone;
GSeq = Actor.WorldInfo.GetGameSequence();
if(GSeq != None)
{
GSeq.FindSeqObjectsByClass(class'SeqAct_BoneRemoval', true, AllSeqObjs);
for(i = 0; i < AllSeqObjs.length; i++)
{
//FoundBone = SeqAct_BoneRemoval(SeqObjs*).Value;
}
HideBoneByName(FoundBone,PBO_Term);
}
}
Unfortunately this doesn’t work because SkeletalMeshComponent is not in the same hierarchy as WorldInfo, or at least that’s the reason I think it doesn’t work. How can I call functions from 2 classes that are not in the same hierarchy?
what is Value in the first place? it’s not something that is defined in any of the versions of your SeqAct_BoneRemoval class code that you’ve posted so far
but well, why are you even looping through all the kismet nodes? your kismet node will call OnBoneRemoval() already!
I’m not really sure, I just copied the code off someone saying that was a way to store the variables in an array. What is the best way to get the bone name (and eventually the hit vector) without passing them to the function since I can’t do that?