Page 1 of 1

Linking to and from a convo

Posted: Thu May 25, 2017 5:37 pm
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?

Re: Linking to and from a convo

Posted: Thu May 25, 2017 7:00 pm
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.

Re: Linking to and from a convo

Posted: Fri May 26, 2017 6:46 am
by chud575
ok cool, ill fiddle with that thanks Tony

Re: Linking to and from a convo

Posted: Fri May 26, 2017 8:43 am
by Tony Li
Sounds good! If any questions come up, please let me know.

Re: Linking to and from a convo

Posted: Fri May 26, 2017 9:41 am
by chud575
uhhh, yeah! How do you start a convo with an Id? Seems like you can only start a convo with a title

Re: Linking to and from a convo

Posted: Fri May 26, 2017 9:54 am
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); 

Re: Linking to and from a convo

Posted: Fri May 26, 2017 12:03 pm
by chud575
Got it working, thanks dude

Re: Linking to and from a convo

Posted: Fri May 26, 2017 12:52 pm
by Tony Li
Happy to help!