Page 1 of 1

conversation in a script

Posted: Tue May 07, 2024 2:01 am
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);
            

Re: conversation in a script

Posted: Tue May 07, 2024 8:26 am
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.

Re: conversation in a script

Posted: Thu May 09, 2024 12:24 am
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.

Re: conversation in a script

Posted: Thu May 09, 2024 1:03 am
by Tony Li
Hi,

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