Components and Actors

This page presents functionalities provided by Grail plugin’s components.

Grail AI Manager Actor

This actor holds the ownership of one instance of AIManager. The user should make sure that at least one AGrailAIManager is present on each scene in which they desire to place Grail controlled agents.

Default implementation of AGrailAIManager updates registered entities and their reasoners every frame. If this is not the intended behavior, please inherit from AGrailAIManager and provide different logic.

AI Entity Component

This component holds the ownership of one instance of AIEntity. Every object which should be able to think requires this component.

The user can define which entity from given GrailConfigurationLoader associated with the desired config file will be constructed in each instance of this component.

Additionally, it is possible to order an entity to be registered on scene startup.

An example of AIEntityComponent details panel

Important API

GetSpawnedEntity

  • A getter function returning the currently owned AIEntity.

OnEntityCreated

  • An event called once the owned AIEntity is ready to be used. Said AIEntity is passed as an argument of this event.

OnEntityDestroyed

  • An event called right before AIEntity is destroyed. The AIEntity is passed as the event’s argument.

Entity Group Component

This component holds ownership of one instance of a group of AIEntities. The user should use this component whenever a character should be controlled by more than one "mind" (e.g. separate logic for movement and aiming, executed in parallel).

The user can define which group from a given GrailConfigurationLoader associated with desired config file will be constructed in each instance of this component.

Additionally it is possible to order group to be registered on scene startup.

An example of EntityGroupComponent details panel

Important API

Entities

  • Readonly property returning the list of currently owned AIControlledEntities

OnGroupCreated

  • An event which will be called once all owned AIEntities are ready to be used. Said entities are passed as an argument of this call along with the mapping of local blackboards.

OnGroupsDestroyed

  • An event which will be called right before object is destroyed. Owned entities are passed as arguments of this call along with the mapping of local blackboards.