Linking to and from a convo

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
chud575
Posts: 50
Joined: Thu May 11, 2017 10:57 am

Linking to and from a convo

Post by chud575 »

Howdy howdy,

okay so this is kind of a quirky question - I noticed you can link from one node to a different convo entirely (and anywhere inside that convo to boot, very cool), but is there a way to set some kind of flag so that when you exit that convo you come back and resume Convo1 from where you left off?
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Linking to and from a convo

Post by Tony Li »

Hi,

There's nothing built-in that does exactly what you describe.

At the end of the linked conversation (Convo2), can you define a link back to the original conversation (Convo1)? This is the easiest way to do it without scripting. It also gives you a better visual picture of the logic.

Alternatively, you can write a small script that implements some of the conversation scripting messages.

For example, in:
  • OnConversationStart: Record the original conversation ID.
  • OnConversationLine: Record the line (conversation ID & dialogue entry ID) as mostRecentLine. If you're still in the original conversation, also record the line as the returnPoint.
  • OnLinkedConversationStart: I don't know if you need this, but it's called when the conversation follows a link to another conversation. Thought I'd mention it at least.
  • OnConversationEnd: If the mostRecentLine wasn't in the original conversation, start a new conversation at the returnPoint.
chud575
Posts: 50
Joined: Thu May 11, 2017 10:57 am

Re: Linking to and from a convo

Post by chud575 »

ok cool, ill fiddle with that thanks Tony
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Linking to and from a convo

Post by Tony Li »

Sounds good! If any questions come up, please let me know.
chud575
Posts: 50
Joined: Thu May 11, 2017 10:57 am

Re: Linking to and from a convo

Post by chud575 »

uhhh, yeah! How do you start a convo with an Id? Seems like you can only start a convo with a title
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Linking to and from a convo

Post by Tony Li »

You can grab the title from an ID. For example:

Code: Select all

var conversationTitle = DialogueManager.MasterDatabase.GetConversation(id).Title;
DialogueManager.StartConversation(conversationTitle, actor, conversant, dialogueEntryID); 
chud575
Posts: 50
Joined: Thu May 11, 2017 10:57 am

Re: Linking to and from a convo

Post by chud575 »

Got it working, thanks dude
User avatar
Tony Li
Posts: 21070
Joined: Thu Jul 18, 2013 1:27 pm

Re: Linking to and from a convo

Post by Tony Li »

Happy to help!
Post Reply