Skip to content

Range library

A view represents an iterable sequence (it doesn't contain any container data)
There are two types of views:

  • Iterator: Modify Begin, End and Next of the loop
  • Predicate: Returns the element if the predicate is true

ForRange

A loop that can use multiple views (reverse, even etc ...)

How it works

The ForRange loop will iterate over a container and filter the results depending on the selected views

Example
// Given a container of integers:
0 1 2 3 4 5 6 7 8 9

// We first take the 3 first elements, then we reverse the result
take(3)
reverse()
Result: 2 1 0

// We reverse the container, then we take the 3 first elements
reverse()
take(3)
Result: 9 8 7 

Create new views from blueprint

  • Create a new blueprint function library
  • Create a new function
    • Create an input parameter that must be named __Element of the desired type
    • Create an output parameter that must be named __Return of type bool
  • Write the function code and restart the editor
Example

View_Predicate

Views

ActorInRange

Parameter
Origin Location of origin
Range Maximum range between Origin and Actor location

Even

Range

Reverse

Reverse elements order in a view