Search Results for

    Show / Hide Table of Contents

    Class NonPlayerCharacter

    Inheritance
    Object
    NonPlayerCharacter
    Namespace: NPCEngine.Components
    Assembly: cs.temp.dll.dll
    Syntax
    public class NonPlayerCharacter : MonoBehaviour

    Fields

    audioSourceQueue

    Audio source queue that plays generated speech on the fly one-by-one.

    Declaration
    public AudioSourceQueue audioSourceQueue
    Field Value
    Type Description
    AudioSourceQueue

    character

    Characters assigned to this NPC.

    Declaration
    public Character character
    Field Value
    Type Description
    Character

    defaultThreshold

    Default semantic similarity threshold for dialogue tree triggers.

    Declaration
    public float defaultThreshold
    Field Value
    Type Description
    Single

    dialogueSystem

    Dialogue System integration.

    Declaration
    public AbstractDialogueSystem dialogueSystem
    Field Value
    Type Description
    AbstractDialogueSystem

    history

    Dialogue history.

    Declaration
    public List<ChatLine> history
    Field Value
    Type Description
    List<ChatLine>

    maxLines

    Declaration
    public int maxLines
    Field Value
    Type Description
    Int32

    OnDialogueEnd

    Event called when dialogue ends

    Declaration
    public UnityEvent OnDialogueEnd
    Field Value
    Type Description
    UnityEvent

    OnDialogueLine

    Event called when new line is added to history where parameters are (ChatLine newLine, bool scriptedLine)

    Declaration
    public UnityEvent<ChatLine, bool> OnDialogueLine
    Field Value
    Type Description
    UnityEvent<ChatLine, Boolean>

    OnDialogueStart

    Dialogue start event (triggered when the NPC starts talking)

    Declaration
    public UnityEvent OnDialogueStart
    Field Value
    Type Description
    UnityEvent

    OnProcessingEnd

    Event called in the end of an input processing

    Declaration
    public UnityEvent OnProcessingEnd
    Field Value
    Type Description
    UnityEvent

    OnProcessingStart

    Event called in the beginning of an input processing

    Declaration
    public UnityEvent OnProcessingStart
    Field Value
    Type Description
    UnityEvent

    OnTopicHintsUpdate

    Event called when new dialogue topic hints appear

    Declaration
    public UnityEvent<List<string>> OnTopicHintsUpdate
    Field Value
    Type Description
    UnityEvent<List<String>>

    testLocation

    Declaration
    public Location testLocation
    Field Value
    Type Description
    Location

    testOtherCharacter

    Declaration
    public Character testOtherCharacter
    Field Value
    Type Description
    Character

    voiceId

    Voice ID of the character for TTS.

    Declaration
    public string voiceId
    Field Value
    Type Description
    String

    Methods

    EndDialogue()

    End dialogue.

    Declaration
    public void EndDialogue()

    GenerateAndPlaySpeech(String)

    Coroutine to generate speech from text.

    Declaration
    public IEnumerator GenerateAndPlaySpeech(string line)
    Parameters
    Type Name Description
    String line
    Returns
    Type Description
    IEnumerator

    GenerateReply(String, String, String)

    Run Chatbot API and generate and play speech

    Declaration
    public IEnumerator GenerateReply(string otherName, string otherPersona, string line)
    Parameters
    Type Name Description
    String otherName

    Other conversant name

    String otherPersona

    Other conversant persona

    String line

    Utterance to generate reply to.

    Returns
    Type Description
    IEnumerator

    HandleLine(String, String, String)

    Step dialogue by line from player.

    Declaration
    public void HandleLine(string otherName, string otherPersona, string line)
    Parameters
    Type Name Description
    String otherName
    String otherPersona
    String line

    HandleLineCoroutine(String, String, String)

    Line handling coroutine

    Declaration
    public IEnumerator HandleLineCoroutine(string otherName, string otherPersona, string line)
    Parameters
    Type Name Description
    String otherName
    String otherPersona
    String line
    Returns
    Type Description
    IEnumerator

    HandlePlayerLineCoroutine(String, String, String)

    Player line handling coroutine

    Declaration
    public IEnumerator HandlePlayerLineCoroutine(string otherName, string otherPersona, string line)
    Parameters
    Type Name Description
    String otherName
    String otherPersona
    String line
    Returns
    Type Description
    IEnumerator

    SayNPCLines()

    Scan dialogue tree and say all scripted NPC lines

    Declaration
    public IEnumerator SayNPCLines()
    Returns
    Type Description
    IEnumerator

    StartDialogue()

    Initialize dialogue.

    Declaration
    public void StartDialogue()
    In This Article
    Back to top npc-engine Unity integration