I’ve written a kismet node with variables that can be edited through kismet. I want to reference these variables in a class inside PlayerController.uc. I also want to add a delay after a certain action, and to do that I use the SetTimer() function. The problem is SetTimer can’t call functions with arguments, and I must reference the kismet node in each function to be able to use the variables inside it (as far as I’m aware). Here’s some code to explain what I’m talking about:
function OnTestNode (SeqAct_TestNode Action)
{
// Do something here
SetTimer(1.5, false, nameof(DelayedFunction));
}
function DelayedFunction (SeqAct_TestNode Action)
{
Action.TestVariable = 5;
}
This doesn’t work because the function DelayedFunction needs a parameter Action to work, and you can’t call functions with parameters through SetTimer. Does anyone have any suggestions on how to get around this?
Yeah that’s the only thing I could come up with. I was looking for another solution because there’s a lot of variables in this kismet node and this is really messy, but if it’s the only way to do it it’s better than nothing. Thank you so much for the help!
I may need additional help. One of the variables in the kismet node is a struct. When I try to copy the struct from the node to the global variable I get an error. Am I doing something wrong?
SeqAct_TestNode.uc
class SeqAct_TestNode extends SequenceAction;
struct TestStruct;
{
var() int TestInt;
var() float TestFloat;
}
var TestStruct Example;
defaultproperties
{
ObjName="Test Node"
ObjCategory="Test"
VariableLinks.Empty
VariableLinks(0)=(ExpectedType=class'SeqVar_Object',LinkDesc="Target",PropertyName=Targets)
}
PlayerController.uc
struct TestStruct;
{
var() int TestInt;
var() float TestFloat;
}
var TestStruct NewExample;
function OnTestNode (SeqAct_TestNode Action)
{
NewExample = Action.Example;
}