Run response from code

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
GreenishFlow
Posts: 5
Joined: Thu Mar 31, 2016 12:17 pm

Run response from code

Post by GreenishFlow »

Hello.
I have a flow: node1 -> response node -> node2 -> ....
When user click on response node it goes to inventory screen. in node2 i have WaitForMessage(GotItem); So when user pick some item it return to quest and continue. But I have a button "inventory" in the game GUI (not in dialogue) and I'd like to run "response node" when user click on inventory button. The matter is that if user goes to inventory NOT from the quest, the dialogue system doesn't wait for message.
please advice how to do it better. I'd like to do something like: DialogueManager.currentConversation.gotoEntry(id); or something else.
Thank you
Evgeny.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Run response from code

Post by Tony Li »

Hi Evgeny,

You can specify a dialogue entry node ID with DialogueManager.StartConversation(). To get the ID of a dialogue entry node, inspect it. The ID is listed at the top. Here's some example code:

Code: Select all

using PixelCrushers.DialogueSystem;
...
void OnClickItem() {
   DialogueManager.StopConversation(); // In case conversation is already running.
   DialogueManager.StartConversation("Title", actor, conversant, node2ID); // Restart at node2 ID
} 
Post Reply