Blueprint
A Blueprint Class allows spawning any Unreal Blueprint Actor in HELIX.
If your Actor Blueprint was spawned on the Server, it will be automatically synchronized with other players using the HELIX Network Authority system! It follows the same rules as all other entities!
Examplesβ
Calling Blueprint Events from luaβ
-- Spawns the Blueprint
local blueprint = Blueprint(Vector(), Rotator(), "my-asset-pack::BP_MyBlueprint")
local param1 = 123
local param2 = "hello there!"
-- Calls the event, passing any parameters
blueprint:CallBlueprintEvent("MyBlueprintCustomEvent", param1, param2)
Binding Blueprint Event Dispatchersβ
-- Spawns the Blueprint
local blueprint = Blueprint(Vector(), Rotator(), "my-asset-pack::BP_MyBlueprint")
-- Subscribes to a Blueprint Event Dispatcher
blueprint:BindBlueprintEventDispatcher("MyBlueprintDispatcher", function(self, arg1, arg2)
Console.Log("Called from Blueprint!", arg1, arg2)
end)
Constructorsβ
Default Constructorβ
local my_blueprint = Blueprint(location?, rotation?, blueprint_asset?)
Type | Name | Default | Description |
---|---|---|---|
Vector | location | Vector(0, 0, 0) | |
Rotator | rotation | Rotator(0, 0, 0) | |
Blueprint Reference | blueprint_asset |
|
Static Functionsβ
Inherited Entity Static Functions
Returns | Name | Description | |
---|---|---|---|
table of Base Entity | GetAll | Returns a table containing all Entities of the class this is called on | |
Base Entity | GetByIndex | Returns a specific Entity of this class at an index | |
integer | GetCount | Returns how many Entities of this class exist | |
iterator | GetPairs | Returns an iterator with all Entities of this class to be used with pairs() | |
table | Inherit | Inherits this class with the Inheriting System | |
table of table | GetInheritedClasses | Gets a list of all directly inherited classes from this Class created with the Inheriting System | |
table or nil | GetParentClass | Gets the parent class if this Class was created with the Inheriting System | |
boolean | IsChildOf | Gets if this Class is child of another class if this Class was created with the Inheriting System | |
function | Subscribe | Subscribes to an Event for all entities of this Class | |
function | SubscribeRemote | Subscribes to a custom event called from server | |
Unsubscribe | Unsubscribes all callbacks from this Event in this Class within this Package, or only the callback passed |
Functionsβ
Inherited Entity Functions
Returns | Name | Description | |
---|---|---|---|
integer | GetID | Gets the universal network ID of this Entity (same on both client and server) | |
table | GetClass | Gets the class of this entity | |
boolean | IsA | Recursively checks if this entity is inherited from a Class | |
function | Subscribe | Subscribes to an Event on this specific entity | |
function | SubscribeRemote | Subscribes to a custom event called from server on this specific entity | |
Unsubscribe | Unsubscribes all callbacks from this Event in this Entity within this Package, or only the callback passed | ||
SetValue | Sets a Value in this Entity | ||
any | GetValue | Gets a Value stored on this Entity at the given key | |
Destroy | Destroys this Entity | ||
boolean | IsValid | Returns true if this Entity is valid (i.e. wasn't destroyed and points to a valid Entity) | |
CallRemoteEvent | Calls a custom remote event directly on this entity to a specific Player | ||
CallRemoteEvent | Calls a custom remote event directly on this entity | ||
BroadcastRemoteEvent | Calls a custom remote event directly on this entity to all Players |
Inherited Actor Functions
Returns | Name | Description | |
---|---|---|---|
AddImpulse | Applies a force in world world to this Actor | ||
AttachTo | Attaches this Actor to any other Actor, optionally at a specific bone | ||
Detach | Detaches this Actor from AttachedTo Actor | ||
SetCollision | Sets this Actor's collision type | ||
SetDimension | Sets this Actor's Dimension | ||
SetForce | Adds a permanent force to this Actor, set to Vector(0, 0, 0) to cancel | ||
SetGravityEnabled | Sets whether gravity is enabled on this Actor | ||
SetVisibility | Sets whether the actor is visible or not | ||
SetHighlightEnabled | Sets whether the highlight is enabled on this Actor, and which highlight index to use | ||
SetOutlineEnabled | Sets whether the outline is enabled on this Actor, and which outline index to use | ||
SetLifeSpan | Sets the time (in seconds) before this Actor is destroyed. After this time has passed, the actor will be automatically destroyed. | ||
SetLocation | Sets this Actor's location in the game world | ||
SetRotation | Sets this Actor's rotation in the game world | ||
SetRelativeLocation | Sets this Actor's relative location in local space (only if this actor is attached) | ||
SetRelativeRotation | Sets this Actor's relative rotation in local space (only if this actor is attached) | ||
SetScale | Sets this Actor's scale | ||
SetNetworkAuthority | Sets the Player to have network authority over this Actor | ||
SetNetworkAuthorityAutoDistributed | Sets if this Actor will auto distribute the network authority between players | ||
TranslateTo | Smoothly moves this actor to a location over a certain time | ||
RotateTo | Smoothly rotates this actor to an angle over a certain time | ||
boolean | IsBeingDestroyed | Returns true if this Actor is being destroyed | |
boolean | IsVisible | Returns true if this Actor is visible | |
boolean | IsGravityEnabled | Returns true if gravity is enabled on this Actor | |
boolean | IsInWater | Returns true if this Actor is in water | |
boolean | IsNetworkDistributed | Returns true if this Actor is currently network distributed | |
table of Base Actor | GetAttachedEntities | Gets all Actors attached to this Actor | |
Base Actor or nil | GetAttachedTo | Gets the Actor this Actor is attached to | |
table | GetBounds | Gets this Actor's bounds | |
CollisionType | GetCollision | Gets this Actor's collision type | |
Vector | GetLocation | Gets this Actor's location in the game world | |
Vector | GetRelativeLocation | Gets this Actor's Relative Location if it's attached | |
Player or nil | GetNetworkAuthority | Gets this Actor's Network Authority Player | |
Rotator | GetRotation | Gets this Actor's angle in the game world | |
Rotator | GetRelativeRotation | Gets this Actor's Relative Rotation if it's attached | |
Vector | GetForce | Gets this Actor's force (set by SetForce() ) | |
integer | GetDimension | Gets this Actor's dimension | |
boolean | HasNetworkAuthority | Returns true if the local Player is currently the Network Authority of this Actor | |
boolean | HasAuthority | Gets if this Actor was spawned by the client side | |
Vector | GetScale | Gets this Actor's scale | |
Vector | GetVelocity | Gets this Actor's current velocity | |
AddActorTag | Adds an Unreal Actor Tag to this Actor | ||
RemoveActorTag | Removes an Unreal Actor Tag from this Actor | ||
table of string | GetActorTags | Gets all Unreal Actor Tags on this Actor | |
boolean | WasRecentlyRendered | Gets if this Actor was recently rendered on screen | |
float | GetDistanceFromCamera | Gets the distance of this Actor from the Camera | |
float | GetScreenPercentage | Gets the percentage of this Actor size in the screen |
Inherited Paintable Functions
Returns | Name | Description | |
---|---|---|---|
SetMaterial | Sets the material at the specified index of this Actor | ||
SetMaterialFromCanvas | Sets the material at the specified index of this Actor to a Canvas object | ||
SetMaterialFromSceneCapture | Sets the material at the specified index of this Actor to a SceneCapture object | ||
SetMaterialFromWebUI | Sets the material at the specified index of this Actor to a WebUI object | ||
ResetMaterial | Resets the material from the specified index to the original one | ||
SetMaterialColorParameter | Sets a Color parameter in this Actor's material | ||
SetMaterialScalarParameter | Sets a Scalar parameter in this Actor's material | ||
SetMaterialTextureParameter | Sets a texture parameter in this Actor's material to an image on disk | ||
SetMaterialVectorParameter | Sets a Vector parameter in this Actor's material | ||
SetPhysicalMaterial | Overrides this Actor's Physical Material with a new one |
Returns | Name | Description | |
---|---|---|---|
any | CallBlueprintEvent | Calls a Blueprint Event or Function | |
function | BindBlueprintEventDispatcher | Assigns and Binds a Blueprint Event Dispatcher | |
UnbindBlueprintEventDispatcher | Unbinds a Blueprint Event Dispatcher | ||
SetBlueprintPropertyValue | Sets a Blueprint Property/Variable value directly | ||
any | GetBlueprintPropertyValue | Gets a Blueprint Property/Variable value |
CallBlueprintEvent
β
Calls a Blueprint Event or Function
Returns all Function return values on Client Side
β Returns any (the function return values).
local ret = my_blueprint:CallBlueprintEvent(event_name, arguments...?)
Type | Parameter | Default | Description |
---|---|---|---|
string | event_name | Event or Function name | |
any | arguments...? | nil | Sequence of arguments to pass to the event |
BindBlueprintEventDispatcher
β
Assigns and Binds a Blueprint Event Dispatcher
β Returns function (the callback itself).
local ret = my_blueprint:BindBlueprintEventDispatcher(dispatcher_name, callback)
Type | Parameter | Default | Description |
---|---|---|---|
string | dispatcher_name | Event Dispatcher name | |
function | callback | Callback function to call (the first argument is the blueprint itself) |
UnbindBlueprintEventDispatcher
β
Unbinds a Blueprint Event Dispatcher
my_blueprint:UnbindBlueprintEventDispatcher(dispatcher_name, callback?)
Type | Parameter | Default | Description |
---|---|---|---|
string | dispatcher_name | Event Dispatcher name | |
function | callback? | Optional callback to unbind |
SetBlueprintPropertyValue
β
Sets a Blueprint Property/Variable value directly
my_blueprint:SetBlueprintPropertyValue(property_name, value)
GetBlueprintPropertyValue
β
Gets a Blueprint Property/Variable value
β Returns any (the value).
local ret = my_blueprint:GetBlueprintPropertyValue(property_name)
Type | Parameter | Default | Description |
---|---|---|---|
string | property_name |
Eventsβ
Inherited Entity Events
Name | Description | |
---|---|---|
Spawn | Triggered when an Entity is spawned/created | |
Destroy | Triggered when an Entity is destroyed | |
ValueChange | Triggered when an Entity has a value changed with :SetValue() | |
ClassRegister | Triggered when a new Class is registered with the Inheriting System |
Inherited Actor Events
Name | Description | |
---|---|---|
Spawn | Triggered when an Entity is spawned/created | |
Destroy | Triggered when an Entity is destroyed | |
ValueChange | Triggered when an Entity has a value changed with :SetValue() | |
ClassRegister | Triggered when a new Class is registered with the Inheriting System |
β Β List of Supported Parameter Typesβ
List of all supported parameters which can be passed between Lua β Blueprint:
Lua Type | Blueprint Type | Lua β BP | BP β Lua |
---|---|---|---|
boolean | Boolean | β | β |
number | Byte | β | β |
number | Integer | β | β |
number | Integer64 | β | β |
number | Float | β | β |
number | Enum | β | β |
string | String | β | β |
string | Name | β | β |
string | Text | β | β |
Vector2D | Vector2D | β | β |
Vector | Vector | β | β |
Rotator | Rotator | β | β |
Color | Color | β | β |
Color | LinearColor | β | β |
StaticMesh | StaticMeshActor | β | β |
Prop | StaticMeshActor | β | β |
Weapon | SkeletalMeshActor | β | β |
Vehicle | WheeledVehiclePawn | β | β |
Grenade | StaticMeshActor | β | β |
Melee | StaticMeshActor | β | β |
Light | Light | β | β |
Decal | DecalActor | β | β |
TextRender | WorldText3D | β | β |
Sound | AmbientSound | β | β |
Canvas | MaterialInstanceDynamic | β | β |
WebUI | MaterialInstanceDynamic | β | β |
SceneCapture | MaterialInstanceDynamic | β | β |
Blueprint | Actor | β | β |
Widget | Widget | β | β |
BaseActor | Actor | β | β |
Player | PlayerController | β | β |
SpecialPath | Texture2D | β | β |
table | Any Struct | β | β |
It is only possible to pass Actors from Blueprint β Lua if the Actor is a Spawned Entity. It is not possible to pass newly spawned Actors in Blueprints to Lua.
Passing Maps
, Arrays
and Sets
is also supported! As long their keys/values are in the list above.
Any Structβ
Custom Structs can also be passed and retrieved, just pass an object with the same properties as the Unreal Struct, examples:
FTransformβ
{
["Translation"] = Vector(),
["Rotation"] = Rotator(),
["Scale"] = Vector()
}
FMarginβ
{
["Bottom"] = 0.0,
["Left"] = 0.0,
["Right"] = 0.0,
["Top"] = 0.0
}
FVector4β
{
["W"] = 0.0,
["X"] = 0.0,
["Y"] = 0.0,
["Z"] = 0.0
}