Blueprints
constBlueprints:object
Defined in: client/api.d.ts:8502
Blueprint actors from a mod pak, spawned on this client only and driven by reflection: call their functions, read and write their variables, and hear their events as blueprintEvent. Values are booleans, numbers, strings (FString and FName), { x, y, z } for a vector or a rotator (pitch, yaw, roll), and a handle for a reference to another Blueprint this resource spawned. A handle belongs to the resource that spawned it: no other resource can use it, and its actor is destroyed when that resource stops.
Type Declaration
Section titled “Type Declaration”call()
Section titled “call()”call(
handle,functionName,args?):Record<string,string|number|boolean| {x:number;y:number;z:number; }> |null
Calls a function on a spawned Blueprint.
Parameters
Section titled “Parameters”handle
Section titled “handle”number
A handle returned by spawn.
functionName
Section titled “functionName”string
A function or custom event on the Blueprint or any parent class.
Record<string, string | number | boolean | { x: number; y: number; z: number; }>
Inputs by parameter name; one left out is its default-constructed value.
Returns
Section titled “Returns”Record<string, string | number | boolean | { x: number; y: number; z: number; }> | null
Its outputs by name (the return value as ReturnValue, and a by-reference input as the callee left it), or null when the handle, the function or an argument was refused, or the function is an event the Blueprint does not implement.
destroy()
Section titled “destroy()”destroy(
handle):boolean
Destroys one spawned Blueprint and drops its watches.
Parameters
Section titled “Parameters”handle
Section titled “handle”number
A handle returned by spawn.
Returns
Section titled “Returns”boolean
destroyAll()
Section titled “destroyAll()”destroyAll():
number
Destroys every Blueprint this resource spawned.
Returns
Section titled “Returns”number
How many were still live.
get(
handle,property):string|number|boolean| {x:number;y:number;z:number; } |undefined
Reads a variable.
Parameters
Section titled “Parameters”handle
Section titled “handle”number
A handle returned by spawn.
property
Section titled “property”string
A variable on the Blueprint or any parent class.
Returns
Section titled “Returns”string | number | boolean | { x: number; y: number; z: number; } | undefined
Its value, or undefined when it is missing or of a type this bridge does not carry.
isValid()
Section titled “isValid()”isValid(
handle):boolean
Whether the actor behind a handle is still alive.
Parameters
Section titled “Parameters”handle
Section titled “handle”number
A handle returned by spawn.
Returns
Section titled “Returns”boolean
preload()
Section titled “preload()”preload(
classPath):boolean
Loads a Blueprint class ahead of its first spawn. The load is synchronous and can take most of a second cold, so do it when the resource starts.
Parameters
Section titled “Parameters”classPath
Section titled “classPath”string
Class asset path, e.g. /Game/Mods/MyMod/BP_Thing.BP_Thing_C.
Returns
Section titled “Returns”boolean
Whether the class loaded and is a Blueprint actor.
set(
handle,property,value):boolean
Writes a variable in place. No setter or RepNotify runs.
Parameters
Section titled “Parameters”handle
Section titled “handle”number
A handle returned by spawn.
property
Section titled “property”string
A variable on the Blueprint or any parent class.
string | number | boolean | { x: number; y: number; z: number; }
The new value, of the variable’s own type.
Returns
Section titled “Returns”boolean
False when the variable is missing, the value is of another type, or a number does not fit the variable.
spawn()
Section titled “spawn()”spawn(
classPath,x,y?,z?,options?):number
Spawns a Blueprint actor on this client only. It lives until destroy, destroyAll, a world reload, disconnect, or this resource stopping.
Parameters
Section titled “Parameters”classPath
Section titled “classPath”string
Class asset path, e.g. /Game/Mods/MyMod/BP_Thing.BP_Thing_C.
number | Vector3Like
World-space X coordinate.
number
World-space Y coordinate.
number
World-space Z coordinate.
options?
Section titled “options?”Yaw in degrees; variables to set before the construction script and BeginPlay run; and functions to watch from before those run, which is the only way to hear them.
props?
Section titled “props?”Record<string, boolean | number | string | { x: number; y: number; z: number; }>
watch?
Section titled “watch?”string[]
number
Returns
Section titled “Returns”number
A handle, or 0 when the class did not load, is not a Blueprint actor, or a prop or watch was refused.
watch()
Section titled “watch()”watch(
handle,functionName):boolean
Raises blueprintEvent(handle, functionName, params) each time the engine dispatches that function on this actor: engine events, timers, input and Event Dispatcher bindings. A call one Blueprint graph makes into another is not dispatched that way and is not heard.
Parameters
Section titled “Parameters”handle
Section titled “handle”number
A handle returned by spawn.
functionName
Section titled “functionName”string
The event or function to hear.
Returns
Section titled “Returns”boolean
False when the handle or the function is unknown, the function is an event the Blueprint does not implement, or 64 watches are already held.