Control the order of conversation and trigger in different areas

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
sam0302
Posts: 11
Joined: Tue Feb 06, 2024 3:30 am

Control the order of conversation and trigger in different areas

Post by sam0302 »

Hi everyone, I am new to this plugin and I am learning this. I want to use this plugin for the conversations in my 2d platformer game. I want to ask how to control the conversations triggered in different trigger zones in one dialogue manager? I want to trigger conversations when the player enters the specific zones in one level.
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Control the order of conversation and trigger in different areas

Post by Tony Li »

Hi,

Are you using an Asset Store framework such as Corgi Platformer Engine? If so, let me know. I'll explain how to set it up.

If you're not using an Asset Store framework, set the player GameObject's tag to Player. Then create an empty GameObject with a trigger collider in the location where you want to trigger a conversation. Add a Dialogue System Trigger component to the GameObject that has the trigger collider. Set the Trigger dropdown to OnTriggerEnter. Click the "Add 'Player' Tag" button. Select Add Action > Start Conversation, and select a conversation from the dropdown. (Make sure you've added a Dialogue Manager GameObject to the scene and assigned your dialogue database to it.)
sam0302
Posts: 11
Joined: Tue Feb 06, 2024 3:30 am

Re: Control the order of conversation and trigger in different areas

Post by sam0302 »

Thank you! It works perfectly. Also I want to ask how to stop the player movement when in a conversation. I know the dialogue event helps but my player is controlled by state machine scripts system. I don’t know what should be disabled to stop player movement when chatting. Please help, thank you so much!
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Control the order of conversation and trigger in different areas

Post by Tony Li »

Hi,

The Interaction Tutorial below covers stopping the player in general. (Jump to 07:00.). The specific details depend on how your state machine works. For example, you may need to transition it into an idle state and then disable player input. Or, if possible, add a dialogue state that's similar to the idle state but doesn't respond to player input, and use that state.

sam0302
Posts: 11
Joined: Tue Feb 06, 2024 3:30 am

Re: Control the order of conversation and trigger in different areas

Post by sam0302 »

Oh, I get a bit, but I think the exact thing I want to achieve is to stay idle state when in conversation as now my player would keep running when enter the conversation. How can I achieve this. Should I need to code for this?
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Control the order of conversation and trigger in different areas

Post by Tony Li »

Is your player controller state machine an Asset Store asset? If so, which asset? If not, you may need to write a little code. You can use OnConversationStart and OnConversationEnd special script methods to know when a conversation has started and ended.
sam0302
Posts: 11
Joined: Tue Feb 06, 2024 3:30 am

Re: Control the order of conversation and trigger in different areas

Post by sam0302 »

My player state machine is only built by scripts, but I don’t know how to code with the methods and state machine and where to attach to make this codes work. According to my codes of state machine, the function I want would be only enable idle state and stick on this when the conversation starts and return to normal when it ends.
If you want more details for my scripts I can take a screenshot
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Control the order of conversation and trigger in different areas

Post by Tony Li »

Perhaps you can use a process like in the video above. Use a Dialogue System Events component to disable the state machine scripts.
Post Reply