Skip to content

Latest commit

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Array Helper


About

thumbnail

  • UE plugin to handle arrays operations (sort, filter, match, range, clamp, random, average, min, max, normalize, math)
  • Use custom predicate function to sort or filter arrays (Int, Float, Byte, Integer64, String, Name, Vector, Object, Actor, Generic)
  • It exposes blueprint functions to handle arrays by value or by reference
  • Provides some generic input nodes to operate on any array

Setup

Nodes

  1. Get the plugin on the marketplace and install the plugin for the engine version you wish to use
  2. Create or open an unreal engine project with a supported version
  3. In the editor, go to Edit/Plugins, search for the plugin, check the box to enable it and restart the editor
  4. When a new plugin version is available, go to your Epic Games Launcher, under Unreal Engine/Library, below the engine version, you will find your installed plugins, find the plugin and click on update, then wait for it to finish and restart your editor

Support

Bugs/Issues

If you encounter issues with this plugin, you should report it, to do so, in the editor, go to Edit/Plugins, search for this plugin, click on the plugin support button, this will open your browser and navigate to the plugin issue form where you need to fill in all the relevant details about your issue, this will help me investigate and reproduce it on my own in order to fix it. Be precise and give as many details as you can. Once solved, a new plugin version will be submitted to the marketplace, update the plugin and you are good to go. Due to epic marketplace limitations, I can only patch/update this plugin for the last 3 engine version, older engine versions will not be supported anymore.

Feature requests

If you want a new feature relevant to this plugin use case, you can submit a request in the plugin marketplace question page. I may add this new feature in a future plugin version.


Documentation

Screenshots may differ from the latest plugin version, some features may have evolved or have been removed if deprecated.

In UE 5.1, the plugin files were renamed from "SortPlugin" to "ArrayHelper" to match the real name of the plugin, you can remove the plugin and reinstall it if you want a clean install, check your uproject file to change the plugin name there too, the plugin nodes names have not changed, this renaming was necessary to match with the plugin name.

If you wish to update the current array, use functions with "ref" for best performance. If you wish to keep the current array and get another array as output, use standard function without "ref" (a copy of the array will be made).

Compare

Utility to compare arrays

NodeInputsOutputsNote
EqualsArrayArrayA(Array(Any)), ArrayB(Array(Any)), Mode(EArrayHelperContainerCompareMode)Result(Bool)Compare if two generic arrays contain the same elements based on the mode chosen (None, MatchSizeAndOrder, MatchSize)

Average

Average

Computes the average of an array

NodeInputsOutputsNote
AverageIntegerArray(Integer)Average(Float)
AverageFloatArray(Float)Average(Float)
AverageDoubleArray(Double)Average(Float)
AverageByteArray(Byte)Average(Float)
AverageInteger64Array(Integer64)Average(Float)

Minimum

Minimum

Returns the index of the minimum value in the array or -1.

NodeInputsOutputsNote
MinimumIntegerIndexArray(Integer)Index(Integer)
MinimumFloatIndexArray(Float)Index(Integer)
MinimumDoubleIndexArray(Double)Index(Integer)
MinimumByteIndexArray(Byte)Index(Integer)
MinimumInteger64IndexArray(Integer64)Index(Integer)

Maximum

Maximum

Returns the index of the maximum value in the array or -1.

NodeInputsOutputsNote
MaximumIntegerIndexArray(Integer)Index(Integer)
MaximumFloatIndexArray(Float)Index(Integer)
MaximumDoubleIndexArray(Double)Index(Integer)
MaximumByteIndexArray(Byte)Index(Integer)
MaximumInteger64IndexArray(Integer64)Index(Integer)

Normalization

Normalization

Normalize the value of the array between min and max.

NodeInputsOutputsNote
MinMaxIntegerNormalizationArray(Integer), Min(Integer), Max(Integer)Array(Integer)
MinMaxFloatNormalizationArray(Float), Min(Float), Max(Float)Array(Float)
MinMaxDoubleNormalizationArray(Double), Min(Double), Max(Double)Array(Double)
MinMaxByteNormalizationArray(Byte), Min(Byte), Max(Byte)Array(Byte)
MinMaxInteger64NormalizationArray(Integer64), Min(Integer64), Max(Integer64)Array(Integer64)

Reverse

Reverse

Reverse a generic array by copy and return the reversed array.

NodeInputsOutputsNote
ReverseArrayArray(Any)Array(Any)Returns a copy of the input array reversed

Convert

Convert

NodeInputsOutputsNote
ToSetArray(Any)Set(Any)Converts a generic array to a new set and removes duplicates
MakeTransformArrayLocations(Array(Vector)), Rotations(Array(Rotator)), Scales(Array(Vector))Result(Bool), Transforms(Array(Transform))Creates a transform array out of locations, rotations, scales arrays
BreakTransformArrayTransforms(Array(Transform))Locations(Array(Vector)), Rotations(Array(Rotator)), Scales(Array(Vector))Creates locations, rotations, scales arrays out of a transform array
SplitStringString(String), Separator(String), SearchCase(Enum), RemoveEmptyString(Bool)Array(String)Splits a string using a specific separator and return an array of strings
ArrayToStringArray(Any), Delimiter(String), Start(String), End(String), ShowIndexes(Bool)String(String)Converts a generic array into a string

Clamp

Clamp

Creates or updates an array clamped using min and max value.

NodeInputsOutputsNote
ClampIntegerArray(Integer), Min, MaxArray(Integer)
ClampFloatArray(Float), Min, MaxArray(Float)
ClampDoubleArray(Double), Min, MaxArray(Double)
ClampByteArray(Byte), Min, MaxArray(Byte)
ClampInteger64Array(Integer64), Min, MaxArray(Integer64)
ClampVectorSizeArray(Vector), MinSize(Float), MaxSize(Float), Only2D(Bool)Array(Vector)
ClampVector2DSizeArray(Vector2D), MinSize(Float), MaxSize(Float)Array(Vector2D)
ClampIntegerByRefArray(Integer), Min, Maxvoid
ClampFloatByRefArray(Float), Min, Maxvoid
ClampDoubleByRefArray(Double), Min, Maxvoid
ClampByteByRefArray(Byte), Min, Maxvoid
ClampInteger64ByRefArray(Integer64), Min, Maxvoid
ClampVectorSizeRefArray(Vector), MinSize, MaxSize, Only2Dvoid
ClampVector2DSizeRefArray(Vector2D), MinSize, MaxSizevoid

Range

Range

NodeInputsOutputsNote
ExtractArrayArray(Any), StartIndex, EndIndexArray(Any)Creates a subarray out of a generic array using start and end index
RangeIntegerStartValue(Integer), EndValue(Integer), Delta(Integer), MaxCount(Integer)Array(Integer)Creates an array from a range using a specific delta and size limit
RangeFloatStartValue(Float), EndValue(Float), Delta(Float), MaxCount(Integer)Array(Float)Creates an array from a range using a specific delta and size limit
RangeDoubleStartValue(Double), EndValue(Double), Delta(Double), MaxCount(Integer)Array(Double)Creates an array from a range using a specific delta and size limit
RangeByteStartValue(Byte), EndValue(Byte), Delta(Byte), MaxCount(Integer)Array(Byte)Creates an array from a range using a specific delta and size limit
RangeInteger64StartValue(Integer64), EndValue(Integer64), Delta(Integer64), MaxCount(Integer)Array(Integer64)Creates an array from a range using a specific delta and size limit

Random

Random

NodeInputsOutputsNote
RandomIntegerSize, Min, MaxArray(Integer)Returns a random array filled with value between min and max
RandomFloatSize, Min, MaxArray(Float)Returns a random array filled with value between min and max
RandomDoubleSize, Min, MaxArray(Double)Returns a random array filled with value between min and max
RandomVectorSize, Min, MaxArray(Vector)Returns a random array filled with value between min and max
RandomVector2DSize, Min, MaxArray(Vector2D)Returns a random array filled with value between min and max
RandomByteSize, Min, MaxArray(Byte)Returns a random array filled with value between min and max
RandomBooleanSizeArray(Boolean)Returns a random array filled with value
RandomInteger64Size, Min, MaxArray(Integer64)Returns a random array filled with value between min and max
PickRandomItemArray(Any), Weights(Int)Item(Any), Index(Int)Picks a random item in a generic array based on weights and returns it with its index

Sort

Sort

NodeInputsOutputsNote
SortIntegerArray(Integer), IsAscendingArray(Integer)Returns a copy of the array sorted by descending or ascending order
SortFloatArray(Float), IsAscendingArray(Float)Returns a copy of the array sorted by descending or ascending order
SortDoubleArray(Double), IsAscendingArray(Double)Returns a copy of the array sorted by descending or ascending order
SortByteArray(Byte), IsAscendingArray(Byte)Returns a copy of the array sorted by descending or ascending order
SortInteger64Array(Integer64), IsAscendingArray(Integer64)Returns a copy of the array sorted by descending or ascending order
SortStringArray(String), IsAscendingArray(String)Returns a copy of the array sorted by descending or ascending order
SortNameArray(Name), IsAscendingArray(Name)Returns a copy of the array sorted by descending or ascending order
SortActorArray(Actor), Origin(Actor), isAscendingArray(Actor)Returns a copy of the array sorted by descending or ascending order based on distance to origin
SortVectorArray(Vector), Origin(Vector), IsAscendingArray(Vector)Returns a copy of the array sorted by descending or ascending order based on Origin
SortVector2DArray(Vector2D), Origin(Vector2D), IsAscendingArray(Vector2D)Returns a copy of the array sorted by descending or ascending order based on Origin
SortVerticesArray(Vector2D), CounterClockWise(Bool)Array(Vectir2D)Returns a copy of the vertices array sorted by (counter) clock wise order
SortIntegerByRefArray(Integer), IsAscendingvoidSorts the input array by descending or ascending order
SortFloatByRefArray(Float), IsAscendingvoidSorts the input array by descending or ascending order
SortDoubleByRefArray(Double), IsAscendingvoidSorts the input array by descending or ascending order
SortByteByRefArray(Byte), IsAscendingvoidSorts the input array by descending or ascending order
SortInteger64ByRefArray(Integer64), IsAscendingvoidSorts the input array by descending or ascending order
SortStringByRefArray(String), IsAscendingvoidSorts the input array by descending or ascending order
SortNameByRefArray(Name), IsAscendingvoidSorts the input array by descending or ascending order
SortActorByRefArray(Actor), Origin(Actor), IsAscendingvoidSorts the input array by descending or ascending order based on distance to origin
SortVectorByRefArray(Vector), Origin, IsAscendingvoidSorts the input array by descending or ascending order based on Origin
SortVector2DByRefArray(Vector2D), Origin, IsAscendingvoidSorts the input array by descending or ascending order based on Origin
SortVerticesByRefArray(Vector2D), CounterClockWise(Bool)voidSorts the input array by (counter) clock wise order

Sort by predicate

Predicate Sort

Note v2 and above: In order to sort by predicate you must create a functions by dragging the PredicateFunction pin and select create event, then create or select a matching function in the list.

Note v1.1 and below : In order to sort by predicate you must implement the ArrayComparator Interface and pass the object implementing this interface as input of the function (Context), the appropriate compare method will be called to perform the sort.

Example SortExample Sort

NodeInputsOutputsNote
PredicateSortIntegerArray(Integer), PredicateFunction, InvertResult(Bool)Array(Integer)Returns a new array sorted using a custom predicate
PredicateSortFloatArray(Float), PredicateFunction, InvertResult(Bool)Array(Float)Returns a new array sorted using a custom predicate
PredicateSortDoubleArray(Double), PredicateFunction, InvertResult(Bool)Array(Double)Returns a new array sorted using a custom predicate
PredicateSortByteArray(Byte), PredicateFunction, InvertResult(Bool)Array(Byte)Returns a new array sorted using a custom predicate
PredicateSortInteger64Array(Integer64), PredicateFunction, InvertResult(Bool)Array(Integer64)Returns a new array sorted using a custom predicate
PredicateSortStringArray(String), PredicateFunction, InvertResult(Bool)Array(String)Returns a new array sorted using a custom predicate
PredicateSortNameArray(Name), PredicateFunction, InvertResult(Bool)Array(Name)Returns a new array sorted using a custom predicate
PredicateSortVectorArray(Vector),PredicateFunction, InvertResult(Bool)Array(Vector)Returns a new array sorted using a custom predicate
PredicateSortVector2DArray(Vector2D),PredicateFunction, InvertResult(Bool)Array(Vector2D)Returns a new array sorted using a custom predicate
PredicateSortActorArray(Actor), PredicateFunction, InvertResult(Bool)Array(Actor)Returns a new array sorted using a custom predicate
PredicateSortObjectArray(Object), PredicateFunction, InvertResult(Bool)Array(Object)Returns a new array sorted using a custom predicate
PredicateSortWildcardArray(Wildcard), Owner(Object), PredicateName(Name), InvertResult(Bool)Result(Bool), Array(Wildcard)Returns a new array sorted using a custom predicate function inside an object, the function inputs (A, B) need to match array element type and return a boolean
PredicateSortIntegerByRefArray(Integer), PredicateFunction, InvertResult(Bool)voidSorts the input array using a custom predicate
PredicateSortFloatByRefArray(Float), PredicateFunction, InvertResult(Bool)voidSorts the input array using a custom predicate
PredicateSortDoubleByRefArray(Double), PredicateFunction, InvertResult(Bool)voidSorts the input array using a custom predicate
PredicateSortByteByRefArray(Byte), PredicateFunction, InvertResult(Bool)voidSorts the input array using a custom predicate
PredicateSortInteger64ByRefArray(Integer64), PredicateFunction, InvertResult(Bool)voidSorts the input array using a custom predicate
PredicateSortStringByRefArray(String), PredicateFunction, InvertResult(Bool)voidSorts the input array using a custom predicate
PredicateSortNameByRefArray(Name), PredicateFunction, InvertResult(Bool)voidSorts the input array using a custom predicate
PredicateSortVectorByRefArray(Vector), PredicateFunction, InvertResult(Bool)voidSorts the input array using a custom predicate
PredicateSortVector2DByRefArray(Vector2D), PredicateFunction, InvertResult(Bool)voidSorts the input array using a custom predicate
PredicateSortActorByRefArray(Actor), PredicateFunction, InvertResult(Bool)voidSorts the input array using a custom predicate
PredicateSortObjectByRefArray(Object), PredicateFunction, InvertResult(Bool)voidSorts the input array using a custom predicate
PredicateSortWildcardByRefArray(Wildcard), Owner(Object), PredicateName(Name), InvertResult(Bool)Result(Bool)Sorts the input array using a custom predicate function inside an object, the function inputs (A, B) need to match array element type and return a boolean

Distance

Distance

NodeInputsOutputsNote
ClosestLocationArray(Vector), Origin(Vector)Closest(Vector), Distance, IndexReturn the closest vector to Origin, the distance, the index in array
FarthestLocationArray(Vector), Origin(Vector)Farthest(Vector), Distance, IndexReturn the farthest vector to Origin, the distance, the index in array
ClosestActorArray(Actor), Origin(Actor)Closest(Actor), Distance, IndexReturn the closest actor to Origin, the distance, the index in array
FarthestActorArray(Actor), Origin(Actor)Farthest(Actor), Distance, IndexReturn the farthest actor to Origin, the distance, the index in array
ClosestTransformArray(Transform), Origin(Vector)Closest(Transform), Distance, IndexReturn the closest transform to Origin, the distance, the index in array
FarthestTransformArray(Transform), Origin(Vector)Farthest(Transform), Distance, IndexReturn the farthest transform to Origin, the distance, the index in array

Filters

Filter

NodeInputsOutputsNote
FilterMatchesArray(String), PatternFound, Array(String)Returns an array containing strings that match the pattern (regex)
FilterMatchArray(String), PatternFound, String, IndexReturns the first string matching the pattern (regex) with its index

Filters by predicate

Predicate Filter

Note v2 and above: In order to filter by predicate you must create a functions by dragging the PredicateFunction pin and select create event, then create or select a matching function in the list.

Note v1.1 and below : In order to filter by predicate you must implement the ArrayFilter Interface and pass the object implementing this interface as input of the function (Context), the appropriate filter method will be called to perform the filtering.

Example FilterExample Filter

NodeInputsOutputsNote
PredicateFilterIntegerArray(Integer), PredicateFunction, InvertResult(Bool)Array(Integer)Returns a new array filtered using a custom predicate
PredicateFilterFloatArray(Float), PredicateFunction, InvertResult(Bool)Array(Float)Returns a new array filtered using a custom predicate
PredicateFilterDoubleArray(Double), PredicateFunction, InvertResult(Bool)Array(Double)Returns a new array filtered using a custom predicate
PredicateFilterByteArray(Byte), PredicateFunction, InvertResult(Bool)Array(Byte)Returns a new array filtered using a custom predicate
PredicateFilterInteger64Array(Integer64), PredicateFunction, InvertResult(Bool)Array(Integer64)Returns a new array filtered using a custom predicate
PredicateFilterStringArray(String), PredicateFunction, InvertResult(Bool)Array(String)Returns a new array filtered using a custom predicate
PredicateFilterNameArray(Name), PredicateFunction, InvertResult(Bool)Array(Name)Returns a new array filtered using a custom predicate
PredicateFilterVectorArray(Vector), PredicateFunction, InvertResult(Bool)Array(Vector)Returns a new array filtered using a custom predicate
PredicateFilterVector2DArray(Vector2D), PredicateFunction, InvertResult(Bool)Array(Vector2D)Returns a new array filtered using a custom predicate
PredicateFilterActorArray(Actor), PredicateFunction, InvertResult(Bool)Array(Actor)Returns a new array filtered using a custom predicate
PredicateFilterObjectArray(Object), PredicateFunction, InvertResult(Bool)Array(Object)Returns a new array filtered using a custom predicate
PredicateFilterWildcardArray(Wildcard), Owner(Object), PredicateName(Name), InvertResult(Bool)Array(Wildcard)Returns a new array filtered using a custom predicate function inside an object, the function input (Element) need to match the array element type and return a boolean

Math

Perform math operations on a generic numeric array.

NodeInputsOutputsNote
+Array(Numeric), NumericResult(Bool)Performs a add operation on all numeric elements in the generic numeric array
-Array(Numeric), NumericResult(Bool)Performs a subtract operation on all numeric elements in the generic numeric array
*Array(Numeric), NumericResult(Bool)Performs a multiply operation on all numeric elements in the generic numeric array
/Array(Numeric), NumericResult(Bool)Performs a division operation on all numeric elements in the generic numeric array

Releases

Packages

Contributors