Conveyor Statics Library


Conveyor Statics is a blueprint function library (Also useful in C++) that can be used to safely interact with the simulation layer of the conveyor system.

Table of Contents:


Save System

Get Conveyor Save Data

Waits for the current simulation tick to finish, flushes pending game thread actions, and returns save data. For more information, see [Saving and Loading].

Load Conveyor Save Data

Loads save data into the simulation. The save handler is an optional parameter that defines the way item descriptors should be loaded. You should use this if your item descriptors are generated during runtime (not data assets). For more information, see [Saving and Loading].


Component Registration and Manipulation

Register Conveyor Component

Registers Conveyor Component Data with the subsystem and returns the handle to the registered component. Will also call any event bound to On Register when the component has been registered (signature is void()).


Unregister Conveyor Component

Unregisters a conveyor component via handle. returns true if successful.


Is Conveyor Component Valid

Returns true if the component associated to the handle is valid and registered.


Set Conveyor Component Speed / Set Conveyor Component Spacing / Set Conveyor Component Rotation Speed

Sets speed, spacing, and item rotation speed respectively for all segments associated with the component.


Set Conveyor Component Item Rotation Type

Sets the item rotation type and desired rotation if the type is set to fixed for all segments associated with the component.

Fixed World and Fixed Local make no difference in this case. The Desired Rotation will be interpreted as world space.


Get Conveyor Item At Location / Get Conveyor Item And Transform At Location

Tries to find an item on a specified component with location being at most Tolerance distance away from the specified location. It returns the handle to the segment which the item is on and the item index (Invalid handle and index -1 if not found).

The version which returns the transform is separate since it is more expensive to calculate and not always needed. Include Item Additional Transform will make it so the returned transform is the actual transform of the mesh, rather than of the item itself. This is affected by the transform of the item descriptor.


Get Conveyor Node At Location

Tries to get a conveyor node at the specified location from a component handle with a given tolerance.

If Tolerance < 0, it will return the closest node to the specified location.

Returns true if a node was found, false otherwise.


Node Functions

Get Conveyor Node Handle

Gets the handle to a specific node via its unique name and component handle. The handle is valid until the next time that any component is unregistered from the subsystem.

Returns true if the node was found, as well as its handle.


Attempt Insert Conveyor Item To Node

Attempts to insert an item into a node via its handle. Returns true if the insertion was successful, false otherwise.


Is Conveyor Node Paused

Returns true if the node (from handle) is paused. A paused node will not allow items to pass through.


Set Conveyor Node Paused

Sets the paused state of a node. A paused node will not allow items to pass through.


Get Conveyor Node Location

Returns the world location of a node via handle.


Get Conveyor Node Segments / Get Conveyor Node In Segments / Get Conveyor Node Out Segments

These functions will return handles to all segments, segments leading into, or segments leaving from a node respectively.


Get Conveyor Node In Round Robin Index

Returns the current input round-robin segment index for the target node. This index determines what segment the node prefers to accept an item from next.


Set Conveyor Node In Round Robin Index

Sets the current node input round-robin index. Must be a valid index for it to take action. This index determines what segment the node prefers to accept an item from next.


Get Conveyor Node Out Round Robin Index

Returns the current output round-robin segment index for the target node. This index determines what segment the node prefers to send an item to next.


Set Conveyor Node Out Round Robin Index

Sets the current node output round-robin index. Must be a valid index for it to take action. This index determines what segment the node prefers to send an item to next.


Segment Functions

Get Conveyor Segment Handle

Gets the handle to a specific segment via its unique name and component handle. The handle is valid until the next time that any component is unregistered from the subsystem.

Returns true if the segment was found, as well as its handle.


Set Conveyor Segment Speed / Get Conveyor Segment Speed

Getter and setter for conveyor speed (in cm/s) via a segment handle.

Cannot be negative.


Set Conveyor Segment Spacing / Get Conveyor Segment Spacing

Getter and setter for conveyor item spacing (in cm) via a segment handle. Cannot be <= 0.

Spacing is doubled when splitting to prevent one output from blocking the whole input even if the other outputs are clear.


Set Conveyor Segment Item Rotation Speed / Get Conveyor Segment Item Rotation Speed

Getters and setters for item rotation speed (in deg/s) on a specific segment (via handle). Negative numbers will be interpreted as 0, meaning items will maintain whatever rotation they had when entering the segment.


Set Conveyor Segment Item Rotation Type

Sets the item rotation type for a segment. Desired Rotation is the rotation used if the type is set to fixed.

Fixed World and Fixed Local make no difference in this case. The Desired Rotation will be interpreted as world space.


Get Conveyor Segment Items

Gets copies of all conveyor items on a specific segment by handle.


Get Conveyor Segment Item At Location

Tries to find an item on a specified segment with location being at most Tolerance distance away from the specified location.

Returns the found item (invalid item if not found) and the item index (-1 if not found).


Get Conveyor Segment Item And Transform At Location

Tries to find an item on a specified segment with location being at most Tolerance distance away from the specified location.

Returns the found item (invalid item if not found), the item index (-1 if not found) and the transform of the item. If Include Item Additional Transform is enabled, the transform returned will be the transform of the visual mesh, otherwise, the transform returned will be the one of the item excluding the specified transform in the item descriptor.


Get Conveyor Segment Item

Gets the item from a conveyor belt from an index. Returns an invalid item if the index is not valid.

The order if items in a segment is given by their position. The first item in the array is the frontmost item.


Get Conveyor Segment Item And Transform

Gets the item from a conveyor belt from an index. Returns an invalid item if the index is not valid.

Returns the found item (invalid item if not found) and the transform of the item. If Include Item Additional Transform is enabled, the transform returned will be the transform of the visual mesh, otherwise, the transform returned will be the one of the item excluding the specified transform in the item descriptor.


Get Conveyor Segment Num Items

Returns the number of items on a conveyor segment.


Get Conveyor Segment From Node / Get Conveyor Segment To Node

Get handles to the nodes before and after the target segment.


Extract Conveyor Item

Extracts the item at the specified index on the specified segment and returns it. Returns an invalid item if the index is invalid or if it is unable to be extracted (if it is marked as being processed by a conveyor action).


Attempt Modify Conveyor Item

Attempts to modify the item on the given segment at the given index. What this means is that if the item index is valid, it will get replaced with the item specified. If the input item is invalid, it will delete the item.

Returns true if the change was successful and false if the index was invalid or if an extraction was attempted on an item marked for processing by a conveyor action.


Attempt Insert Conveyor Item To Segment

Attempts to insert an item into the given segment. Returns true if the insertion was successful. An unsuccessful insertion occurs when the handle is invalid, the item is invalid, or if there was not enough space for the item.

The item will be inserted at the beginning of the segment.


Node Action Functions

Get Conveyor Node Action

Attempts to get a conveyor node action from a specified component handle. The unique name is the one assigned to the node associated with the action.

This means that to access the action on a node with unique name “Example”, you will need to input the relevant component handle and as the Node Name parameter you will input “Example”.

Returns nullptr if the node was not found or if the node does not have any action associated.


Get Conveyor Node Action From Class

This function will search for the action associated to a conveyor component by its class. It will include subclasses as well.

If multiple actions matching the class filter are present, it will return the first one found.

Returns nullptr if no action was found.


Get Conveyor Node Actions From Class

This function will search for all actions associated to a conveyor component by its class. It will include subclasses as well.


Item Functions

Register Conveyor Item Type

Registers a conveyor item type with the system. While this is not necessary, it is recommended, especially the items are generated at runtime and garbage collection could cause issues.

This should be called once per item type per play session. Later calls are ignored.


Is Conveyor Item Valid

Returns true if the item is valid (Has a valid type assigned)


Invalidate Conveyor Item

Invalidates the item, setting the type to null.


Misc

Get Conveyor Delta Time

Returns the delta time for the last simulation frame in seconds. This is different from the global world delta time, since the conveyor system can skip ticks.


Get/Set Conveyor Time Dilation

Gets or set time dilation for the conveyor system.

  • A value of 1 will mean normal simulation speed.
  • A value of 2 will run the simulation at twice the normal speed.
  • A value of 0.5 will run the simulation at half the normal speed.
  • A value of 0 will pause the simulation. (Registrations will still be processed, but no items will move and no node actions will be processed)

The value is clamped between 0 and the world’s maximum time dilation (Editable via World Settings)


This site uses Just the Docs, a documentation theme for Jekyll.