Within the Environment Query System (EQS), Contexts provide a frame of reference for any
EnvQueryContext_Item
Items are created by the Generator, and if using the EQS Testing Pawn, they are the spheres that appear in the Editor. An EnvQueryContext_Item is either a location (FVector) or an Actor (AActor).
EnvQueryContext_Querier
The Querier is the Pawn that is currently possessed by an AI Controller and is executing the
In the Details panel for a Generator type, you can assign the Querier as a Context for the following properties:
Generator |
Property |
---|---|
Actors of Class |
Search Center
|
Current Location |
Query Context
|
Points: Circle |
Circle Center
|
Points: Cone |
Center Actor
|
Points: Donut |
Center
|
Points: Grid |
Generate Around
|
Points: Pathing Grid |
Generate Around
|
EnvQueryContext_BlueprintBase
You can create a custom Context through Blueprint using the EnvQueryContext_BlueprintBase Class. This provides four functions that can be overridden, enabling you to add your own custom Contexts for use within Tests in a query.
To use a custom Context:
Create a new Blueprint of the EnvQueryContext_BlueprintBase class.
In EnvQueryContext_BlueprintBase, click Override and select the type of function you wish to use.
Refer to the table below a description of each function override:
Function |
Description |
---|---|
Provide Single Location |
This returns a single location (vector). How you generate that location is up to you. For example, the function below will return the trace hit location of a random Actor (one that is found in the DesiredObjectType array, such as Pawn, Vehicle) found within 1500 cm of the Querier: |
Provide Single Actor |
This returns a single Actor. You can obtain that Actor through any method you desire. In this example, the function will return Player 0's controlled Actor: |
Provide Locations Set |
This returns an array of locations (vectors). How you generate these locations is up to you. In the example below, this function will trace from 16 evenly spaced locations on a circle with a radius of 1500 units, returning successful hits on the environment: |
Provide Actors Set |
This returns an array of Actors. You can use any desired method to obtain those Actors. In the example below, we use a Get All Actors of Class node to retrieve our specified class as the Actors to return: |