Control the order of conversation and trigger in different areas
Control the order of conversation and trigger in different areas
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.
Re: Control the order of conversation and trigger in different areas
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.)
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.)
Re: Control the order of conversation and trigger in different areas
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!
Re: Control the order of conversation and trigger in different areas
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.
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.
Re: Control the order of conversation and trigger in different areas
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?
Re: Control the order of conversation and trigger in different areas
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.
Re: Control the order of conversation and trigger in different areas
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
If you want more details for my scripts I can take a screenshot
Re: Control the order of conversation and trigger in different areas
Perhaps you can use a process like in the video above. Use a Dialogue System Events component to disable the state machine scripts.