conversation in a script

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
fuakda
Posts: 27
Joined: Fri Sep 01, 2023 12:32 am

conversation in a script

Post by fuakda »

Sorry for the basic question.
Can you tell me about starting a conversation in a script?
DialogueManager.StartConversation()

In the above, PauseGameOnConversation does not work.
I know that the settings in Trigger don't work, but I'm having trouble because the game won't stop during a conversation.

How to script DialogueSystemTrigger to start a conversation?
Or do you need another way to stop the game time?

Code: Select all

//PlaySequenceInConversation();
            //DialogueManager.StartConversation("gatanas/talk01");

            //GameObject player = GameObject.FindGameObjectWithTag("Player");
            //dialogueSystemTrigger = this.GetComponent<DialogueSystemTrigger>();
            //dialogueSystemTrigger.OnConversationStart(player.transform);
            //Debug.Log(dialogueSystemTrigger + " / " + this.transform);

            PixelCrushers.DialogueSystem.DialogueManager.StartConversation("gatanas/talk01");
            // PauseGameOnConversation(true);
            
User avatar
Tony Li
Posts: 20771
Joined: Thu Jul 18, 2013 1:27 pm

Re: conversation in a script

Post by Tony Li »

Hi,

DialogueManager.StartConversation() is the way to start a conversation in script. It doesn't pause; it just starts the conversation. You can pause the game yourself before or after calling that method.

Alternatively, you can also configure a Dialogue System Trigger and call its OnUse() method.
fuakda
Posts: 27
Joined: Fri Sep 01, 2023 12:32 am

Re: conversation in a script

Post by fuakda »

I set OnUse and was able to have a conversation.
Because the Trigger was held by a child object of the player, an error occurred when setting the actor or interlocutor.
Once it was resolved, we were able to have a conversation. thank you.
User avatar
Tony Li
Posts: 20771
Joined: Thu Jul 18, 2013 1:27 pm

Re: conversation in a script

Post by Tony Li »

Hi,

Thanks for explaining. I'm glad you found a solution.
Post Reply