BA Replication Array - Replication Info Actor - Non Authorative Functions
All functions shown here are demonstrated in the 'BP_ThirdPersonCharacter_Rep' class.
They can be found via right click, Category "BA Rep Array|Replication Info Actor|Non Authoritive Functions"
Non Authorative Functions
The following functions are available:
Functions to retrieve object(s) from the Replication Array:
- Get Array Count - Returns the number of current objects in the Replication Array.
- Get All Objects - Returns a Map of all objects with Instance Guid as key and and the Object as value. Object needs to be cast to regarding class.
- Get Object By Guid - Returns the Object defined by its Instance Guid and its Instance Identifier
- Get Object By Identifier - Returns the Object defined by its Instance Identifier
- Get GetRandom Entry - Returns a random Object from the Replication Array, its Instance Identifier and Guid
Functions to sort the Replication Array:
- Sort By Index - Sorts the array by the index that was created when the object was inserted into the array.
- Sort by Property - Sorts the array by the name of a property. All objects that have this property and this property is a numeric value will be sorted - all others ignored. This function will also sort objects of differrent classes as long as they have this public property. As this function is using the reflection system, its much slower than a direct sort - expect ca. 5 milliseconds for 100 objects, 15 ms for 200 objects etc.
Object Retrieval
Get Array Count
Returns the current array count.
- Input:
- Reference to a 'BA Replication Info' object
- Output:
- int32 ArrayCount
Get All Objects
Returns all objects stored in the Replication Array.
- Input:
- Reference to a 'BA Replication Info' object
- Output:
- Map < Entry Instance Guid, Object >. The object needs to be cast to the right type.
Get Object By Guid
Returns one object with a fitting Instance Guid - or NULL if no object was found.
- Input:
- Reference to a 'BA Replication Info' object
- Instance Guid to search for (Replace the 'Make Guid' node below with an existing Entry Guid)
- Output:
- bool Found
- Reference to a 'BA Replication Info' object (cast to type)
- String Identifier (added to entry as human readable Id)
Get Object By Id
Returns one object with a fitting Identification - or NULL if no object was found.
- Input:
- Reference to a 'BA Replication Info' object
- Id string to search for. Id is an automatically generated human readable value for each object (2 random adjective, one random name)
- Output:
- bool Found
- Reference to a 'BA Replication Info' object (cast to type)
Get GetRandom Entry
Returns one random object - or NULL if no object was found.
- Input:
- Reference to a 'BA Replication Info' object
- Output:
- bool Found
- Reference to a 'BA Replication Info' object (cast to type)
- Identifier. Id is an automatically generated human readable value for each object (2 random adjective, one random name)
- Instance Guid
Sorting
Sort By Index
Sorts the array by the index that was created when the object was inserted into the array.
Necessary, as the array will sometimes changes the position of the objects in the array while replicating.
- Input:
- Reference to a 'BA Replication Info' object
Sort By Property
Sorts the array by the provided property name.
The property name will be compared - case insensitive - with all properties in the object and will apply a sorting if its a numeric value.
- Input:
- Reference to a 'BA Replication Info' object
This sorting uses reflections to sort, meaning it is slow. Expect 5 ms for 100 object, 15 ms for 200 and 200 ms for 2000 objects. As this is using the game thread, dont go above 20 ms here.
For convenience, there are the functions 'Stop Watch In Milliseconds - Start' and 'Stop Watch In Milliseconds - Stop' to check performance.
:::
tip
Access
- Source code https://github.com/DeveloperBastian/BA_ReplicationArray
- a video tutorial https://youtu.be/rrGx6bwwM6U (german version)