Represents a Non-Player Character (NPC) in the game world. Handles decision making, vision, memory, and interaction logic for the NPC.
More...
|
| void | Awake () |
| | Initializes the NPC, sets up the entity ID, animator, and subscribes to the NPC event bus.
|
| |
| void | Setup (IDecisionSystem decisionSystem, string modelId, CharacterDTO characterDTO) |
| | Sets up the NPC's decision system, model, name, and system prompt. Initializes default memories.
|
| |
| IDecisionSystem | GetDecisionSystem () |
| | Gets the decision system used by the NPC.
|
| |
| void | LookAt (Transform targetTransform) |
| | Makes the NPC look at a specified target transform. Updates the NPC's rotation to face the target. If the target is null, resets the rotation to the previous value. Logs the action for debugging purposes.
|
| |
| List< CurrentEnvironment > | GetCurrentEnvironment () |
| | Returns a list of possible environment descriptions for the NPC.
|
| |
| void | OnDestroy () |
| | Unsubscribes from the NPC event bus when the NPC is destroyed.
|
| |
| void | StartChatting (IChattable otherChatter) |
| | Called when Player starts interacting with NPC, see PlayerController::StartInteraction NPC will look at Player and StoppedDecision will be set to CurrentDecision
|
| |
| void | Chat (string message) |
| | Chat function implementation for .
|
| |
| void | FinishChatting () |
| | Chat finish function implementation for .
|
| |
| void | InterruptDecision (IDecision decision) |
| | Sets and starts new decision.
|
| |
| void | SetCurrentDecision (IDecision decision) |
| | Finishes current decision and starts up new one.
|
| |
| void | StartChatting (IChattable otherChatter) |
| |
| void | FinishChatting () |
| |
| void | Chat (string message) |
| |
Represents a Non-Player Character (NPC) in the game world. Handles decision making, vision, memory, and interaction logic for the NPC.
◆ Awake()
Initializes the NPC, sets up the entity ID, animator, and subscribes to the NPC event bus.
◆ Chat()
| void NPC.Chat |
( |
string |
message | ) |
|
Chat function implementation for .
Implements IChattable.
◆ FinishChatting()
| void NPC.FinishChatting |
( |
| ) |
|
Chat finish function implementation for .
Implements IChattable.
◆ GetCurrentEnvironment()
Returns a list of possible environment descriptions for the NPC.
- Returns
- List of CurrentEnvironment objects describing the environment.
◆ GetDecisionSystem()
Gets the decision system used by the NPC.
- Returns
- The decision system.
◆ InterruptDecision()
| void NPC.InterruptDecision |
( |
IDecision |
decision | ) |
|
◆ LookAt()
| void NPC.LookAt |
( |
Transform |
targetTransform | ) |
|
Makes the NPC look at a specified target transform. Updates the NPC's rotation to face the target. If the target is null, resets the rotation to the previous value. Logs the action for debugging purposes.
- Parameters
-
| targetTransform | The transform of the target to look at. If null, the NPC resets its rotation. |
◆ OnDestroy()
Unsubscribes from the NPC event bus when the NPC is destroyed.
◆ SetCurrentDecision()
| void NPC.SetCurrentDecision |
( |
IDecision |
decision | ) |
|
Finishes current decision and starts up new one.
◆ Setup()
Sets up the NPC's decision system, model, name, and system prompt. Initializes default memories.
- Parameters
-
| decisionSystem | The decision system to use. |
| modelId | The model ID for LLM-based decision making. |
| characterDTO | Character data |
◆ StartChatting()
◆ agent
The NavMeshAgent component for navigation.
◆ DecisionEmojiVisibility
| bool NPC.DecisionEmojiVisibility = false |
◆ HisBuilding
| GameObject NPC.HisBuilding = null |
The building associated with this NPC.
◆ Hunger
The hunger level of the NPC.
◆ speed
The movement speed of the NPC.
◆ StoppedDecision
Interrupted Decision, see OnInteraction
◆ Thirst
The thirst level of the NPC.
◆ AvailableToChat
Whether the NPC is available to chat with other chatters, see .
Implements IChattable.
◆ CharacterData
The Character data generated by Narrator.
◆ CurrentDecision
The current decision being executed by the NPC.
◆ EntityID
The unique entity ID of the NPC.
◆ LookTarget
◆ ModelID
| string NPC.ModelID = null |
|
get |
The model ID used for LLM-based decision making.
◆ Name
◆ ObtainedMemories
The list of memories obtained by the NPC.
◆ SystemPrompt
| string NPC.SystemPrompt = null |
|
getset |
The system prompt used for LLM-based decision making.
The documentation for this class was generated from the following file:
- RaymondMaarloeve/Assets/Scripts/NPC/NPC.cs