Skip to content

SeinARTS Entity Library

Class · USeinEntityBPFL : UBlueprintFunctionLibrary

#include "Lib/SeinEntityBPFL.h"

deterministic: safe in simulation code

Blueprint nodes to spawn, destroy and query entities and to change their owner, transform, lifespan, selectability and child transforms. It also holds named-entity lookup, tag lookup and entity-control grants. Nodes that change an entity are accepted only from simulation logic.

Spawn an entity from a Blueprint class at the given transform, owned by the specified player. A class without an entity bridge is refused with an error and an invalid handle.

static FSeinEntityHandle SeinSpawnEntity(const UObject* WorldContextObject, TSubclassOf<AActor> ActorClass, const FFixedTransform& SpawnTransform, FSeinPlayerID OwnerPlayerID);

Destroy an entity (deferred to post-tick cleanup)

static void SeinDestroyEntity(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle);

Destroy the entity once Seconds of simulation time pass (to the nearest tick), replacing any lifespan it had. Use it for summons, projectiles and timed effects.

static void SeinSetLifespan(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FFixedPoint Seconds);

Remove the entity’s lifespan, so it lives until something else destroys it.

static void SeinClearLifespan(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle);

Take the entity out of the world, as for a passenger, a unit waiting off-map or a hero waiting to respawn. It keeps its owner, components and abilities, but leaves world queries, collision, vision, targeting, navigation and selection, and its actor hides. Its abilities keep running: give it your own tag to block them while it is away.

static void SeinRemoveFromWorld(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle);

Bring the entity back into the world at its transform (set it first with Set Entity Transform). Its actor shows, or spawns if it never had one. Players and the match stay out.

static void SeinReturnToWorld(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle);

Whether the entity is alive and in the world: false after Remove From World, and for players, the match and classes marked Is Abstract.

static bool SeinIsInWorld(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle);

Whether players can select the entity. Entities are selectable unless the game clears it, for example on projectiles and ability helpers.

static bool SeinIsSelectable(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle);

Let players select the entity, or not. It is simulation state: set it from the simulation, such as an ability.

static void SeinSetSelectable(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, bool bSelectable);

Get the simulation transform of an entity

static FFixedTransform SeinGetEntityTransform(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle);

Set the simulation transform of an entity

static void SeinSetEntityTransform(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, const FFixedTransform& Transform);

Get the owner player ID of an entity

static FSeinPlayerID SeinGetEntityOwner(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle);

Give the entity to another player, such as on capture. Its production queue is cancelled and refunded to each entry’s payer.

static void SeinSetEntityOwner(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FSeinPlayerID NewOwner);

Check whether an entity handle refers to a living entity

static bool SeinIsEntityAlive(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle);

True when the handle can refer to an entity: its index and generation are both above zero. It does not check that the entity is still alive; use Is Entity Alive for that.

static bool SeinIsHandleValid(FSeinEntityHandle EntityHandle);

Returns an invalid entity handle

static FSeinEntityHandle SeinInvalidHandle();

Every entity carrying Tag, from the tag index. Empty when no entity has it. Skip Abstract Entities leaves out entities with no world presence: players, the match, brokers and classes marked Is Abstract.

Defaults: bSkipAbstractEntities = true.

static TArray<FSeinEntityHandle> SeinLookupEntitiesByTag(const UObject* WorldContextObject, FGameplayTag Tag, bool bSkipAbstractEntities = true);

The first entity in the tag index that carries Tag, or an invalid handle. Skip Abstract Entities leaves out entities with no world presence.

Defaults: bSkipAbstractEntities = true.

static FSeinEntityHandle SeinLookupFirstEntityByTag(const UObject* WorldContextObject, FGameplayTag Tag, bool bSkipAbstractEntities = true);

How many entities carry Tag. Skip Abstract Entities leaves out entities with no world presence.

Defaults: bSkipAbstractEntities = true.

static int32 SeinCountEntitiesByTag(const UObject* WorldContextObject, FGameplayTag Tag, bool bSkipAbstractEntities = true);

True when at least one entity carries Tag. Skip Abstract Entities leaves out entities with no world presence.

Defaults: bSkipAbstractEntities = true.

static bool SeinHasAnyEntityWithTag(const UObject* WorldContextObject, FGameplayTag Tag, bool bSkipAbstractEntities = true);

Give an entity a name that Lookup Named Entity finds, such as a scenario objective. A name maps to one entity; registering it again replaces the old one.

static void SeinRegisterNamedEntity(const UObject* WorldContextObject, FName Name, FSeinEntityHandle Handle);

The entity registered under Name, or an invalid handle.

static FSeinEntityHandle SeinLookupNamedEntity(const UObject* WorldContextObject, FName Name);

Remove a name registered with Register Named Entity.

static void SeinUnregisterNamedEntity(const UObject* WorldContextObject, FName Name);

Every live entity the predicate accepts. The predicate is a Blueprint function that takes a handle and returns a bool. Visits every entity, so prefer Lookup Entities By Tag when a tag can express the filter. Skip Abstract Entities leaves out entities with no world presence.

Defaults: bSkipAbstractEntities = true.

static TArray<FSeinEntityHandle> SeinFindEntities(const UObject* WorldContextObject, FSeinEntityFilterPredicate Predicate, bool bSkipAbstractEntities = true);

True if the entity has a child node with this tag anywhere in its tree. Walks DFS.

static bool SeinHasChild(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FGameplayTag Tag);

Read a full FSeinChildTransform copy by tag (DFS). Returns false on invalid handle / missing component / tag-not-found (OutNode left default-constructed).

static bool SeinGetChild(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FGameplayTag Tag, FSeinChildTransform& OutNode);

Local transform of the named child (relative to its parent). Returns identity on miss.

static FFixedTransform SeinGetChildLocalTransform(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FGameplayTag Tag);

World transform of the named child — composed by walking ancestors: Entity.Transform * (each ancestor’s LocalTransform) * (this node’s LocalTransform). Returns Entity transform on miss (so callers using the result for “spawn at world position” still produce a valid fallback at the unit’s location).

static FFixedTransform SeinGetChildWorldTransform(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FGameplayTag Tag);

Tag of the immediate parent of this child, or invalid tag if the child sits at the root of the tree (parent is the entity itself). Useful for ability scripts walking up the hierarchy.

static FGameplayTag SeinGetChildParentTag(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FGameplayTag Tag);

Direct (one-level) children of the named parent tag. Pass an invalid tag to get the root-level children of the entity. Returns copies.

static TArray<FSeinChildTransform> SeinGetDirectChildrenOf(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FGameplayTag ParentTag);

Whole tree as a copy. Useful for editors / debug overlays / one-off walks. Hot paths should target individual tags via the lookups above to avoid the array copy.

static bool SeinGetChildTransformsData(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FSeinChildTransformsPayload& OutData);

Set the named child’s rotation relative to its parent. False when the entity has no child with Tag.

static bool SeinSetChildLocalRotation(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FGameplayTag Tag, FFixedQuaternion NewRotation);

Set the named child’s transform relative to its parent. False when the entity has no child with Tag.

static bool SeinSetChildLocalTransform(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FGameplayTag Tag, FFixedTransform NewTransform);

Turn the named child (a turret or mount) toward a world point, in yaw only, by at most Turn Rate (radians per second) x Delta Time. Call once per tick from the aiming ability. False when the entity has no child with Tag.

static bool SeinTurnChildToward(const UObject* WorldContextObject, FSeinEntityHandle EntityHandle, FGameplayTag Tag, FFixedVector WorldTarget, FFixedPoint TurnRateRadPerSec, FFixedPoint DeltaTime);

Create an exact-entity control grant.

StartTick is inclusive; INDEX_NONE resolves to the world’s current tick. EndTick is exclusive; INDEX_NONE means permanent. A finite end must be greater than the resolved start. Invalid entities, neutral grantees, bad intervals, or exhausted ID state return an invalid ID without mutation. AllowedCommandTypes is normalized to unique lexical order; empty permits every structurally valid entity command.

Defaults: StartTick = -1, EndTick = -1.

static FSeinEntityControlGrantID SeinGrantEntityControl(const UObject* WorldContextObject, FSeinEntityHandle TargetEntity, FSeinPlayerID Grantee, const TArray<FGameplayTag>& AllowedCommandTypes, int32 StartTick = -1, int32 EndTick = -1);

Revoke one grant by stable ID. IDs are never reused after revocation.

static bool SeinRevokeEntityControl(const UObject* WorldContextObject, FSeinEntityControlGrantID GrantID);

Remove every finite grant whose exclusive end is <= the current tick. The allocator component remains so IDs cannot rewind.

static int32 SeinPruneExpiredEntityControlGrants(const UObject* WorldContextObject, FSeinEntityHandle TargetEntity);

Owner-only by default, extended by active exact grants. Neutral is not a player principal and therefore cannot gain control merely because an entity is neutral-owned. Restricted grants match CommandType exactly.

static bool SeinCanPlayerControlEntity(const UObject* WorldContextObject, FSeinPlayerID Player, FSeinEntityHandle TargetEntity, FGameplayTag CommandType);

True when the identified grant exists and is active at the current tick.

static bool SeinIsEntityControlGrantActive(const UObject* WorldContextObject, FSeinEntityControlGrantID GrantID);

Every Entity Control grant on the entity, in grant order, including future and expired grants until they are revoked or pruned.

static TArray<FSeinEntityControlGrant> SeinGetEntityControlGrants(const UObject* WorldContextObject, FSeinEntityHandle TargetEntity);
C++ members (2)
  • static bool CanPlayerControlEntityAtTick(const USeinWorldSubsystem& World, FSeinPlayerID Player, FSeinEntityHandle TargetEntity, FGameplayTag CommandType, int32 AtTick); C++ policy entry point with an explicit tick. Useful to validate a canonical command against the tick at which it will execute.
  • static bool IsEntityControlGrantActiveAtTick(const USeinWorldSubsystem& World, FSeinEntityControlGrantID GrantID, int32 AtTick); C++ exact-grant query with an explicit tick.