Page 1 of 1

Run response from code

Posted: Wed Jul 20, 2016 11:31 am
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.

Re: Run response from code

Posted: Wed Jul 20, 2016 2:16 pm
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
}