Hello, I've got a few brief questions here:
- If I want to wait until a conversation has finished playing, what's the best way of going about it? I know there's an OnConversationEnd function in the dialogue system, but I don't know how to hook it up to the most recently played conversation, for example. (More specifically, I want to set a popup active AFTER a conversation ends, without using the Sequence to set it active, since I think that's still within the conversation itself.)
- How do I pause mid-conversation when I set the game to timescale 0?
- More of a reminder, but how do I call C# Script functions mid-conversation again?
Conversation End, Pausing Convos with Timescale and calling C# Script Functions
-
- Posts: 31
- Joined: Tue May 16, 2023 10:37 pm
Re: Conversation End, Pausing Convos with Timescale and calling C# Script Functions
Hi,
Here are some ways to do it:2linescrossed wrote: ↑Tue Dec 12, 2023 3:31 am- If I want to wait until a conversation has finished playing, what's the best way of going about it? I know there's an OnConversationEnd function in the dialogue system, but I don't know how to hook it up to the most recently played conversation, for example. (More specifically, I want to set a popup active AFTER a conversation ends, without using the Sequence to set it active, since I think that's still within the conversation itself.)
- Hook into the C# event DialogueManager.instance.conversationEnded:
Code: Select all
DialogueManager.instance.conversationEnded += OnConversationEnded; ... void OnConversationEnded(Transform actor) { DialogueManager.instance.conversationEnded -= OnConversationEnded; // (Do your thing here.) }
- Or add a Dialogue System Events component to the Dialogue Manager or one of the participants, and configure the OnConversationEnd() event.
- Or add a script with an OnConversationEnd(Transform actor) to the Dialogue Manager or one of the participants.
- Or add a Dialogue System Trigger to the Dialogue Manager or one of the participants, and set its Trigger to OnConversationEnd.
See: How To: Pause Dialogue In Pause Menu2linescrossed wrote: ↑Tue Dec 12, 2023 3:31 am- How do I pause mid-conversation when I set the game to timescale 0?
The best way is to register your C# function with Lua. Then call your C# function in a dialogue entry node's Script field (or Conditions field if you're checking a condition).2linescrossed wrote: ↑Tue Dec 12, 2023 3:31 am- More of a reminder, but how do I call C# Script functions mid-conversation again?