How do I initiate conversation from script

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
nishant
Posts: 55
Joined: Mon Sep 21, 2015 3:16 pm
Location: Canada
Contact:

How do I initiate conversation from script

Post by nishant »

Hi ,
In the game that am working on , my NPC is an AI who constantly gives player info , warnings etc on specific events . I have a separate gameobject for AI and conversation trigger is attached to it. I want to know few things.

1. Can a conversation trigger handle multiple conversations ? Currently I am attaching multiple conversation scripts .
2. Is there any way to directly initiate a conversation from script of a different gameobject ? something similar to SendMessage ??

For #2 , currently I am attaching that conversation to a different gameobject and enabling that gameobject when I wish to start the conversation but I am sure there must be a better way.

By the way awesome work on the dialogue system. :D

Thanks.
Nishant
User avatar
Tony Li
Posts: 22102
Joined: Thu Jul 18, 2013 1:27 pm

Re: How do I initiate conversation from script

Post by Tony Li »

Hi,

This appear to be a duplicate post, but I wanted to answer the second half. (The first half is: Use DialogueManager.StartConversation().)

You can add multiple Conversation Triggers to a GameObject. Then you can set different Conditions so that only the appropriate one should run.
Post Reply