Page 1 of 1
Having Different Default Actions on Different Conversation Types
Posted: Fri Jan 03, 2025 11:01 am
by SmallMistake
Hello I have a game that is going to have two different types of conversations those that are more cutscene esc where I want the in game time to stop and for the player to lose control of the character and those that play in the background while the player still has control.
Right now I have to add the same couple of lines of code to every conversation start and end node of conversations of type one which seems very dangerous if I ever need to add another line or miss one in a large dialogue tree. Is there a way to denote conversations of type one or two as different that will have each conversation have different default start and end code run?
Re: Having Different Default Actions on Different Conversation Types
Posted: Fri Jan 03, 2025 11:34 am
by Tony Li
Hi,
Here are two approaches:
1. Normally to stop the player's control you'll set up a Dialogue System Events component on the player GameObject as explained at 07:00 of the
Interaction Tutorial.
The Dialogue System Events' OnConversationStart/End events will only run when the player GameObject is used as the active conversation's actor or conversant. (See
Character GameObject Assignments for more info.)
If your background conversations don't use the player GameObject, then they won't pause the player.
---
Alternatively, if you don't mind a little scripting, you can use an
OnConversationStart(Transform) method in a script on your Dialogue Manager.
1. Add a custom field to your conversation
template -- for example, a Boolean field named "Cutscene" that's false by default.
2. For your cutscene conversations, set the field to true.
3. In your OnConversationStart(Transform) method, look up the value of this field and pause if it's true:
Code: Select all
void OnConversationStart(Transform actor)
{
var conversation = DialogueManager.masterDatabase.GetConversation(DialogueManager.lastConversationStarted);
if (conversation.LookupBool("Cutscene"))
{
// (Run your MMFeedback or whatever else here to pause the player)
}
}
Re: Having Different Default Actions on Different Conversation Types
Posted: Fri Jan 03, 2025 4:06 pm
by SmallMistake
Thank you for pointing me to the template. That seems to be what I was looking for. Have a good rest of the day

Re: Having Different Default Actions on Different Conversation Types
Posted: Fri Jan 03, 2025 4:54 pm
by Tony Li
Glad to help!