Values and expressions
Pure nodes (green, no execution pins) are written inside the line that uses them, the way they're evaluated: when that line runs.
Pure nodes, operators and conversions
Math and logic nodes become operators (+, <=, !). The small automatic conversion nodes become calls, such as FTrunc(...) for float to integer. Make Array and Make Set are written as [Pistol, Rifle], Make Map as {"one": 1, "two": 2}.
A library function is named with its library, KismetSystemLibrary::PrintString(...), since two libraries can have functions of the same name. A call on an object starts with that object: Enemy.TakeHit(...).
AND, OR, XOR, NAND and NOR are written as calls, not as && and ||: AND(KismetSystemLibrary::IsValid(Target), Target.Health > 0.0). Blueprint evaluates every operand of these nodes, so the second one is read even when the first is false, which && would not do.
Some nodes stay calls so that what they do shows: the string and text comparisons, named by their title, such as KismetStringLibrary::EqualCaseInsensitiveString(A=Name, B="Boss"), and a comparison whose tolerance is wired or changed, such as KismetMathLibrary::EqualVector(A=Aim, B=Target, ErrorTolerance=0.1).
The Array, Set and Map functions, Set Members in Struct and the in-place math functions write into what is wired to their by-reference pin. When that is a copy, such as the result of a function, the change is lost and the argument is marked: KismetArrayLibrary::Add(TargetArray=GetItems() /* redundant data operation - writes into a copy */, NewItem=Item).
event Tick(float DeltaSeconds)
Score = FTrunc(Distance * 2.0)
One pure chain read in several places: fn_
Blueprint evaluates a pure node again for every statement that reads it. When a pure chain is read by two or more wires, it's declared once as fn_Name = () => ..., just above the first statement that calls it, and each statement calls fn_Name(). So each call is one more evaluation, which matters for random numbers, expensive queries and values that change in between. Within one statement it runs once, even when the line calls it twice.
A chain read by one wire stays inline, and so does a call with no wired input, such as KismetMathLibrary::RandomFloat(): each time it is written, it runs. An array a loop runs over is an fn_ even when read once, since the loop evaluates it on every pass.
event OnHit(float BaseDamage)
fn_Multiply_FloatFloat = () => BaseDamage * DamageMultiplier
Health = Health - fn_Multiply_FloatFloat()
ShowHint(FloatToString(fn_Multiply_FloatFloat()))
Structs: Break and Make
A Break node reads fields, so it's written as Struct.Field. A Make node is written as Type{Field=...}. Engine break functions such as Break Hit Result or Break Vector stay calls: KismetMathLibrary::BreakVector(V).X.
Set Members in Struct is a call named by its title, with the struct it writes into first: SetMembersInS_WeaponStats(Stats, Damage=25.0). Get (a copy) and Get (a ref) on an array are written as an index, Stats[0].
event Upgrade()
ApplyDamage(Stats.Damage)
Stats = S_WeaponStats{Damage=25.0, FireRate=0.1}
Long lines
A line longer than 140 characters, not counting its indentation, is split at its widest brackets, one argument per line. The operands of AND(...) and OR(...) count as arguments. A variable's default and a class default's value are split the same way, with their flags kept on the last line.
Actor* SpawnActorActor = SpawnActorActor(
Class=/Script/Engine.Actor,
SpawnTransform=KismetMathLibrary::MakeTransform(Location=SpawnLocation, Rotation=SpawnRotation, Scale=SpawnScale),
CollisionHandlingOverride=ESpawnActorCollisionHandlingMethod::Default,
Instigator=None
)
if (
AND(
LongConditionTermOne > 0.0,
LongConditionTermTwo > 0.0,
LongConditionTermThree > 0.0,
LongConditionTermFour > 0.0,
LongConditionTermFive > 0.0
)
)