Mark Dialogue as NPC to NPC

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
RyanKonso
Posts: 2
Joined: Fri Jun 30, 2023 11:40 am

Mark Dialogue as NPC to NPC

Post by RyanKonso »

Hello,
I would like to highlight dialogues that are NPC to NPC. For dialogues with the PC, a letterbox and a CameraZoom is shown via the "Feel-Plugin", but I don't want to have this with NPC to NPC. I would like to mark the dialogue somehow, but not use the variables of the DialogueManager (because there could be a dialogue with the PC at the same time and then this variable would be set incorrectly). Does DialogueSystem already give me such a possibility to mark the whole dialogue, or how can I implement this functionality most elegantly?
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Mark Dialogue as NPC to NPC

Post by Tony Li »

Hi,

Yes, you can add a custom field to your conversation template. (See Templates.) You could add a Boolean field that you can set to specify whether the conversation is PC-to-NPC or NPC-to-NPC.

Or you could check the conversation in code in an OnConversationStart(Transform) method. Example:

Code: Select all

void OnConversationStart(Transform actor)
{
    var conversation = DialogueManager.masterDatabase.GetConversation(Dialoguemanager.lastConversationStarted);
    var actor = DialogueManager.masterDatabase.GetActor(conversation.ActorID);
    var conversant = DialogueManager.masterDatabase.GetActor(conversation.ConversantID);
    bool isPlayerToNPC = actor.IsPlayer || conversant.IsPlayer;
}
RyanKonso
Posts: 2
Joined: Fri Jun 30, 2023 11:40 am

Re: Mark Dialogue as NPC to NPC

Post by RyanKonso »

Oh Gosh, I'm so blind :oops:
Thank you :D
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Mark Dialogue as NPC to NPC

Post by Tony Li »

Glad to help!
Post Reply