NPC Persona component
Verse using statement |
using { /UnrealEngine.com/Conversations } |
Inheritance Hierarchy
This class is derived from component.
| Name | Description |
|---|---|
component |
Base class for authoring logic and data in the SceneGraph. Using components you can author re-usable building blocks of logic and data which can then be added to entities in the scene. Components are a very low level building block which can be used in many ways. For example:
As components are generic there is no specific way that they must be used. It is up to the needs of your experience if you use one big game component or if you break up logic into many small components. Classes deriving from component must also specify Only one instance of a component from each subclass group can be added to an entity at a time. For example, given this group of components, only one light_component can exist on a single entity. To create multiple lights you should use multiple entities. light_component := class ============================================================================== Component Lifetime Components move through a series of lifetime functions as they are added to entities, added to the scene, and begin running in the simulation. Components should override these methods to perform setup and run their simulation. As a component shuts down it will then move through shutdown version of these
functions, giving users the opportunity to clean up any retained state on the
component before it is disposed
.
Lifetime Methods:
OnAddedToScene
OnBeginSimulation -> OnSimulate |
Members
This class has both data members and functions.
Data
| Data Member Name | Type | Description |
|---|---|---|
CommitSayEvent |
listenable(payload) |
Listenable which is signaled when the spoken message is finalized (after moderation). Contains the actual message delivered — either the original or the canned replacement. 1/ The agent (if involved) that prompted the response. 2/ The final message that was said. |
Entity |
entity |
The parent entity of this component.
|
InterruptionRule |
?persona_interruption_rule |
How the persona will handle overlapping prompts. |
Knowledge |
?message |
What the persona knows |
Personality |
?message |
The personality of the persona |
PromptFailureEvent |
listenable(payload) |
Listenable which is signaled when the persona was requested to talk, either by a player or prompt and failed. Callback receives: 1) The persona which had the failure 2) The error |
Session |
?llm_session |
The session which will process all this persona's prompts When the persona is in a voice channel, every session in that channel will automatically propagate conversation history entries to all sessions found in the channel. All and only conversation directly to or from a persona will be automatically recorded. |
StartHearEvent |
listenable(payload) |
Listenable which is signaled when the player starts prompting the persona. |
StartSayEvent |
listenable(payload) |
Listenable which is signaled when the persona begins speaking (before moderation resolves). 1/ The agent (if involved) that prompted the response. 2/ Cancelable to stop the persona from talking. |
StopHearEvent |
listenable(payload) |
Listenable which is signaled when the player finishes prompting the persona. |
StopSayEvent |
listenable(payload) |
Listenable which is signaled when the target stops talking. 1/ logic that is true when interrupted |
TickEvents |
?tick_events |
Set callbacks to |
Voice |
?voice_model |
The voice assigned to this persona. |
Functions
| Function Name | Description |
|---|---|
IsInScene |
Succeeds if the component is currently in the scene.
|
IsSimulating |
Succeeds if the component is currently simulating.
|
OnAddedToScene |
Called when the component is added to the scene by parenting it under the simulation entity or another entity already in the scene.
|
OnBeginSimulation |
Called when the component begins simulating within the scene.
|
OnEndSimulation |
Called when the component ends simulation within the scene.
|
OnReceive |
|
OnReceive |
Respond to a scene event. Return true to consume the event and halt propagation to the next entity. |
OnRemovingFromScene |
Called when the component is about to be removed from the scene.
|
OnSimulate |
Called when the component begins simulating within the scene.
|
RemoveFromEntity |
Removes the component from the entity.
|
RequestToTalk |
Requests the Persona to talk on the topic provided, requires the persona to be on a channel |
SendDown |
Send a scene event to this component, invoking OnReceive. Returns true if any participant consumed the event. |
SubscribeToResponseType |
Registers a callback for when the persona receives structured data in the format of response_type. Required forces this be filled out every time the persona is prompted. The returned cancelable unregisters this callback and stops the llm from attempting to send this kind of structured data. The result type must be a struct which can contain.
|