Page 1 of 1

Trigger Conversation/Continuation via C# script

Posted: Sat Aug 20, 2022 3:18 am
by mischakolbe
Ciao Pixel Crushers team,

Really sorry to ask this question, which was probably asked before. I spent a few hours looking around and just can't find it...

Ultimately I want to progress a monologue when a custom event happens: For example a VR button being pressed would send an Event/run a function.

* I tried to access DialogueManager.StartConversation() to trigger a conversation via script, but I'm getting the compiler error "'DialogueManager' in explicit interface declaration is not an interface." which I'm not managing to sort out.
* I can't find a way to "pause" at certain stages in a monologue, waiting for a custom Event or so to trigger the continuation of the monologue.

Any help with this is massively appreciated <3

Re: Trigger Conversation/Continuation via C# script

Posted: Sat Aug 20, 2022 7:50 am
by Tony Li
Hi,
mischakolbe wrote: Sat Aug 20, 2022 3:18 am* I tried to access DialogueManager.StartConversation() to trigger a conversation via script, but I'm getting the compiler error "'DialogueManager' in explicit interface declaration is not an interface." which I'm not managing to sort out.
In your project, do you have another script named Dialogue Manager?

You can disambiguate the Dialogue System's Dialogue Manager by specifying the namespace:

Code: Select all

PixelCrushers.DialogueSystem.DialogueManagerStartConversation("Title");
mischakolbe wrote: Sat Aug 20, 2022 3:18 am* I can't find a way to "pause" at certain stages in a monologue, waiting for a custom Event or so to trigger the continuation of the monologue.
Add a WaitForMessage(message) or Continue()@Message(message) sequencer command to the dialogue entry's Sequence. (Use Continue() if you require the player to click a continue button to advance the conversation.) Example:
  • Dialogue Text: "Press the red button."
  • Sequence: WaitForMessage(PressedButton)
When the player triggers the event, use Sequencer.Message() to send the message:

Code: Select all

PixelCrushers.DialogueSystem.Sequencer.Message("PressedButton");

Re: Trigger Conversation/Continuation via C# script

Posted: Sat Aug 20, 2022 5:23 pm
by mischakolbe
Tony Li, you absolute legend! Thank you so, so much!

I'm ashamed to say, but I had an old DialogueManager script of mine indeed. Completely forgot about it and didn't even cross my mind.

The WaitForMessage seems to work great as well.

I can keep working from here - thank you again for the immediate help! <3

Re: Trigger Conversation/Continuation via C# script

Posted: Sat Aug 20, 2022 7:25 pm
by Tony Li
Glad to help!