A Few Math Kismet Nodes!

#Kismet

Set of scripts that facilitate vector math in kismet!

5 scripts, all kismet nodes that help with vector math stuff. Base kismet lacks vector math nodes so I made a few.

  • Add vector
  • Multiply vector
  • Get direction vector (returns a vector that points from start to end location)
  • Lerp float
  • Normalize vector

All pretty self explanatory! If you enjoy building game-play in kismet (like I often do) then you will probably find these scripts useful!

Werti_SeqAct_AddVector.uc

[RAW] [Download]

class Werti_SeqAct_AddVector extends SequenceAction;
 
var() Vector VectorA;
var() Vector VectorB;
var() Vector VectorResult;
 
event Activated()
{
    if (InputLinks[0].bHasImpulse)
    {
        VectorResult.X = VectorA.X+VectorB.X;
        VectorResult.Y = VectorA.Y+VectorB.Y;
        VectorResult.Z = VectorA.Z+VectorB.Z;
    }
}
 
defaultproperties
{
    ObjName="Add Vector"
    ObjCategory="Math"
    HandlerName="OnAddVector"
 
    InputLinks(0)=(LinkDesc="In")
 
    VariableLinks.Empty
    VariableLinks(0)=(ExpectedType=class'SeqVar_Vector',LinkDesc="Vector A",PropertyName=VectorA,bWriteable=false)
    VariableLinks(1)=(ExpectedType=class'SeqVar_Vector',LinkDesc="Vector B",PropertyName=VectorB,bWriteable=false)
    VariableLinks(2)=(ExpectedType=class'SeqVar_Vector',LinkDesc="Vector Result",PropertyName=VectorResult,bWriteable=true)
}
 
Werti_SeqAct_GetDirectionVector.uc

[RAW] [Download]

class Werti_SeqAct_GetDirectionVector extends SequenceAction;
 
var() Vector StartVector;
var() Vector EndVector;
var() Vector VectorResult;
 
event Activated()
{
    if (InputLinks[0].bHasImpulse)
    {
        VectorResult = EndVector - StartVector;
    }
}
 
defaultproperties
{
    ObjName="Get Direction Vector"
    ObjCategory="Math"
    HandlerName="OnGetDirectionVector"
 
    InputLinks(0)=(LinkDesc="In")
 
    VariableLinks.Empty
    VariableLinks(0)=(ExpectedType=class'SeqVar_Vector',LinkDesc="Start Vector",PropertyName=StartVector,bWriteable=false)
    VariableLinks(1)=(ExpectedType=class'SeqVar_Vector',LinkDesc="End Vector",PropertyName=EndVector,bWriteable=false)
    VariableLinks(2)=(ExpectedType=class'SeqVar_Vector',LinkDesc="Vector Result",PropertyName=VectorResult,bWriteable=true)
}
 
Werti_SeqAct_LerpFloat.uc

[RAW] [Download]

class Werti_SeqAct_LerpFloat extends SequenceAction;
 
Var() Float A;
Var() Float B;
Var() FLoat Alpha;
 
var Float OutValue;
 
event Activated()
{
    if (InputLinks[0].bHasImpulse)
    {
        OutValue=Lerp(a,b,Alpha);
    }
 
}
 
 
defaultproperties
{
    ObjName="Lerp Float"
    ObjCategory="Math"
    HandlerName="OnLerpFloat"
 
 
    bLatentExecution=False
    bAutoActivateOutputLinks=True
 
    InputLinks(0)=(LinkDesc="In")
 
    VariableLinks.Empty
    VariableLinks(0)=(ExpectedType=class'SeqVar_Float',LinkDesc="A",PropertyName=A,bWriteable=false)
    VariableLinks(1)=(ExpectedType=class'SeqVar_Float',LinkDesc="B",PropertyName=B,bWriteable=false)
    VariableLinks(2)=(ExpectedType=class'SeqVar_Float',LinkDesc="Alpha",PropertyName=Alpha,bWriteable=false)
    VariableLinks(3)=(ExpectedType=class'SeqVar_Float',LinkDesc="Out Value",PropertyName=OutValue,bWriteable=True)
 
}
 
Werti_SeqAct_MultiplyVector.uc

[RAW] [Download]

class Werti_SeqAct_MultiplyVector extends SequenceAction;
 
var() Vector VectorA;
var() Vector VectorB;
var() Vector VectorResult;
 
event Activated()
{
    if (InputLinks[0].bHasImpulse)
    {
        //idk why I did it like this... I'm not changing it tho :D
        VectorResult.X = VectorA.X*VectorB.X;
        VectorResult.Y = VectorA.Y*VectorB.Y;
        VectorResult.Z = VectorA.Z*VectorB.Z;
    }
}
 
defaultproperties
{
    ObjName="Multiply Vector"
    ObjCategory="Math"
    HandlerName="OnMultiplyVector"
 
    InputLinks(0)=(LinkDesc="In")
 
    VariableLinks.Empty
    VariableLinks(0)=(ExpectedType=class'SeqVar_Vector',LinkDesc="Vector A",PropertyName=VectorA,bWriteable=false)
    VariableLinks(1)=(ExpectedType=class'SeqVar_Vector',LinkDesc="Vector B",PropertyName=VectorB,bWriteable=false)
    VariableLinks(2)=(ExpectedType=class'SeqVar_Vector',LinkDesc="Vector Result",PropertyName=VectorResult,bWriteable=true)
}
 
Werti_SeqAct_NormalizeVector.uc

[RAW] [Download]

class Werti_SeqAct_NormalizeVector extends SequenceAction;
 
var() Vector V;
var Vector OutVector;
 
event Activated()
{
    if (InputLinks[0].bHasImpulse)
    {
        OutVector = Normal(V);
    }
 
}
 
 
defaultproperties
{
    ObjName="Normalize Vector"
    ObjCategory="Math"
    HandlerName="OnNormalizeVector"
 
 
    bLatentExecution=False
    bAutoActivateOutputLinks=True
 
    InputLinks(0)=(LinkDesc="In")
 
    VariableLinks.Empty
    VariableLinks(0)=(ExpectedType=class'SeqVar_Vector',LinkDesc="Vector",PropertyName=V,bWriteable=false)
    VariableLinks(1)=(ExpectedType=class'SeqVar_Vector',LinkDesc="Normalized Vector",PropertyName=OutVector,bWriteable=True)
 
}