Skip to content

SeinARTS Order Library

Class · USeinOrderBPFL : UBlueprintFunctionLibrary

#include "Lib/SeinOrderBPFL.h"

deterministic: safe in simulation code

Orders for one or more units. Every order runs through a broker, the entity that holds it for its member units: it queues the order, lays the members out in formation and picks each member’s ability.

The broker’s data: members, queued orders and settled layout. False, leaving Out Data unchanged, when the entity is not a broker.

static bool SeinGetBrokerData(const UObject* WorldContextObject, FSeinEntityHandle Broker, FSeinCommandBrokerData& OutData);

The broker the unit belongs to, or an invalid handle.

static FSeinEntityHandle SeinGetCurrentBroker(const UObject* WorldContextObject, FSeinEntityHandle Member);

The broker’s living members. Empty for an invalid broker.

static TArray<FSeinEntityHandle> SeinGetBrokerMembers(const UObject* WorldContextObject, FSeinEntityHandle Broker);

The center of the broker’s members. Zero for an invalid broker.

static FFixedVector SeinGetBrokerCentroid(const UObject* WorldContextObject, FSeinEntityHandle Broker);

The command context tags of the order the broker is running. Empty when the broker is idle or invalid.

static FGameplayTagContainer SeinGetBrokerOrderContext(const UObject* WorldContextObject, FSeinEntityHandle Broker);

How many orders the broker has, the running one included.

static int32 SeinGetBrokerQueueLength(const UObject* WorldContextObject, FSeinEntityHandle Broker);

A persistent group’s members in the order its resolver lists them, the order a HUD shows them. Empty when Group is not a group broker.

static TArray<FSeinEntityHandle> SeinGetGroupMembers(const UObject* WorldContextObject, FSeinEntityHandle Group);

The persistent group a unit belongs to, or an invalid handle when it belongs to none. An order’s own broker is not a group; Get Current Broker returns that.

static FSeinEntityHandle SeinGetOwningGroup(const UObject* WorldContextObject, FSeinEntityHandle Member);

True while an order lays out the whole selection’s base positions. A resolver whose Post Process Positions repeats what a selection destination plan provider does returns early while this is true, so the adjustment applies once.

static bool SeinIsSelectionBaseLayoutInProgress(const UObject* WorldContextObject);

Submit this machine’s player’s order for these units through one broker. A unit belongs to one broker at a time, so the units leave any broker they were in. The broker’s resolver reads Command Context (the click and target tags, plus your own) to pick each member’s ability; include an ability tag to have every member use it.

Queue Command appends the order behind the orders of the broker the units already share instead of replacing them; a strict subset of that broker gets the order for itself. Target Entity is optional. True when submitted; the simulation still checks the player may command the units. An AI controller or a scenario uses Issue Broker Order For Player.

Formation Tag and Guide Points shape an order without a target entity: the members take that formation at Target Location, along the guide points when given (a drag line’s points, at most 4,096). Without them a ground right-click spreads the members in the resolver’s default formation. To issue exactly what a preview showed, use Plan Formation Order.

Defaults: bQueueCommand = false.

static bool SeinIssueBrokerOrder(const UObject* WorldContextObject, const TArray<FSeinEntityHandle>& Members, const FGameplayTagContainer& CommandContext, FSeinEntityHandle TargetEntity, FFixedVector TargetLocation, const TArray<FFixedVector>& GuidePoints, FGameplayTag FormationTag, bool bQueueCommand = false);

Issue Broker Order as Player. A machine acts for its own player; a network host also for an AI-run player and for Neutral; a standalone game for any player. Otherwise nothing is submitted and this returns false. An AI controller passes Formation Tag to attack or move in formation.

Defaults: bQueueCommand = false.

static bool SeinIssueBrokerOrderForPlayer(const UObject* WorldContextObject, FSeinPlayerID Player, const TArray<FSeinEntityHandle>& Members, const FGameplayTagContainer& CommandContext, FSeinEntityHandle TargetEntity, FFixedVector TargetLocation, const TArray<FFixedVector>& GuidePoints, FGameplayTag FormationTag, bool bQueueCommand = false);

Plan a formation move: the exact positions each member will take, and a one-use token that issues them. Show Out Layout, keep Out Token, then pass it to Issue Formation Order so units go exactly where the preview showed. Planning changes nothing. It takes no target entity; use Issue Broker Order for orders aimed at an entity. In a network match the local player replaces Player ID.

The token stays valid while units and destination providers move, and their movement never shifts the planned points. A loaded or replaced match, a change in the order’s members or authority, another local player or world, or a previous issue makes it stale. A member that dies after planning drops only its own slot. Out Layout and Out Token are reset unless the result is Success.

static ESeinFormationOrderTokenResult SeinPlanFormationOrder(const UObject* WorldContextObject, FSeinPlayerID PlayerID, const TArray<FSeinEntityHandle>& Members, const FGameplayTagContainer& CommandContext, FFixedVector TargetLocation, const TArray<FFixedVector>& GuidePoints, FGameplayTag FormationTag, bool bQueueCommand, FSeinFormationLayout& OutLayout, USeinFormationOrderToken*& OutToken);

Submit the order a Plan Formation Order token holds. The token is checked against this world, match, local player, authority and the order’s members, and one accepted submission uses it up. Submission Rejected leaves it usable, so you can retry. Success means the order was submitted; the simulation still decides whether it runs.

static ESeinFormationOrderTokenResult SeinIssueFormationOrder(const UObject* WorldContextObject, USeinFormationOrderToken* Token);

The positions a formation move to Target Location would give these units, from the same resolver and destination providers the order uses, without changing anything. Members of a persistent group are laid out by its resolver with its facing; any other selection uses the Default Broker Resolver Class from Project Settings.

Issue Broker Order computes its own layout and does not use this result; to issue exactly what you show, use Plan Formation Order. Cost depends on the destination providers, so call it at the formation preview’s cadence rather than every frame.

static FSeinFormationLayout SeinComputeFormationPreview(const UObject* WorldContextObject, const TArray<FSeinEntityHandle>& Members, FFixedVector TargetLocation, const TArray<FFixedVector>& GuidePoints, FGameplayTag FormationTag);

From an ability graph, order Caller Entity’s whole broker to use an ability. The broker’s resolver fans it out by the ability’s Dispatch Mode: every capable member, a single member, or the members matching a tag. A unit in no broker gets the ability command by itself.

Example: a place-building ability spawns the site, then calls this with the Build ability so every unit in the builder’s broker goes to build it (with Build’s Dispatch Mode set to All). Ability Tag must be granted to the members, or to the broker entity for group abilities. The order joins the back of the broker’s queue. Inputs are optional: each performing member gets its own copy, and a unit in no broker gets a single ability command with the same inputs.

static void SeinIssueBrokerOrderFromEntity(const UObject* WorldContextObject, FSeinEntityHandle CallerEntity, FGameplayTag AbilityTag, FSeinEntityHandle TargetEntity, FFixedVector TargetLocation, const FSeinAbilityActivationInputs& Inputs);
C++ members (2)
  • static FSeinFormationLayout ComputeFormationDestinationArtifact(const UObject* WorldContextObject, const TArray<FSeinEntityHandle>& Members, FFixedVector TargetLocation, const TArray<FFixedVector>& GuidePoints, FGameplayTag FormationTag, FSeinPlayerID OrderingPlayer, bool bQueueCommand, TArray<FSeinFrozenDestination>& OutDestinationArtifact, bool* OutSucceeded = nullptr); Native preview/commit seam. Returns the same layout as the Blueprint preview API and also exposes the exact per-member artifact after all stable-ID selection providers have run.
  • static TArray<FFixedVector> ComputeMultiBrokerAnchors(USeinWorldSubsystem& World, const TArray<FSeinEntityHandle>& Brokers, FFixedVector ClickTarget, const TArray<FFixedVector>& GuidePoints, FGameplayTag FormationTag, TArray<FFixedQuaternion>& OutFacings); Formation anchors for several persistent brokers (groups). Each broker is one element of the FormationTag formation, sized by its FSeinCommandBrokerData::FormationRadius through the same footprint-aware ResolveFormationLayout loose units use, and then lays its own members around its anchor. An invalid FormationTag falls back to the resolver’s default formation; one broker centers on ClickTarget. The result and OutFacings (each broker’s position-dependent facing) are index-aligned with Brokers. The order handler and SeinComputeFormationPreview share it, so preview and commit agree.