Hey,
So I'm putting together a cutscene (not using Dialogue System, we have our own cutscene system that starts dialogue system conversations through API call) and we want to be able to do something like this:
1. Character begins some dialogue
2. Character moves to some position
3. Character continues the dialogue from where they left off
What would be the best way of doing this? These would be 100% scripted so there's no need to dynamically pause at different points or anything like that.
I suppose we could break it up into multiple Conversations, but that seems like it'd get messy very quickly and would be annoying to work with. I would like to keep all the dialogue of this cutscene into 1 Conversation ideally.
So far I've got it kind of working by having a Conversation that has unlinked nodes, so the first bit of dialogue would reach an end node, then carry out the movement and then start the same conversation but from a specific entry ID. This isn't really that good of a solution though as it means we need to either know the specific entry ID to pick up from or keep track of the last entry ID that was spoken.
Thanks!
Suggestion for breaking up conversation into parts?
Re: Suggestion for breaking up conversation into parts?
You could make two branches from the START node. Set a dialogue database variable that specifies which branch to play, and use the Conditions field on the first node of each branch.
Then just play the conversation from the beginning each time, but make sure to set the variable first using DialogueLua.SetVariable().
Alternatively, you could make it all one straight conversation branch and in step #2 set the Sequence field to something like:
This will hide the Dialogue Panel and wait. When your character is in position, call Sequencer.Message("DoneMovingCharacter").
Then just play the conversation from the beginning each time, but make sure to set the variable first using DialogueLua.SetVariable().
Alternatively, you could make it all one straight conversation branch and in step #2 set the Sequence field to something like:
Code: Select all
SetActive(Dialogue Panel,false);
SetActive(Dialogue Panel,true)@Message(DoneMovingCharacter)
Re: Suggestion for breaking up conversation into parts?
Hey Tony,
If I put everything in 1 branch, is it possible to send OnConversationEnd message in the middle where it pauses? My scripts rely on that message to know when to do some things
If I put everything in 1 branch, is it possible to send OnConversationEnd message in the middle where it pauses? My scripts rely on that message to know when to do some things
Re: Suggestion for breaking up conversation into parts?
No, but you could send a different message using the SendMessage() sequencer command, or write a custom sequencer command that calls your cutscene.
Using SendMessage():
Using a custom sequencer command:
This assumes MyCutscene runs until the cutscene finishes, and that it also temporarily hides the Dialogue Panel. For example, it might look like:
Using SendMessage():
Code: Select all
SetActive(Dialogue Panel,false);
SendMessage(StartCutscene,,MyGameObject);
SetActive(Dialogue Panel,true)@Message(DoneMovingCharacter)
Code: Select all
MyCutscene()
Code: Select all
public class SequencerCommandMyCutscene : SequencerCommand {
public IEnumerator Start() {
GameObject.Find("Dialogue Panel").SetActive(false); // (Kludge for this example.)
while (/*character is moving*/) {
yield return null;
}
GameObject.Find("Dialogue Panel").SetActive(true);
Stop();
}
}
Re: Suggestion for breaking up conversation into parts?
So couldn't I just go
That'd send an OnConversationEnd message to both actor and conversant wouldn't it?
Code: Select all
SetActive(Dialogue Panel,false);
SendMessage(OnConversationEnd);
SetActive(Dialogue Panel,true)@Message(DoneMovingCharacter)
Re: Suggestion for breaking up conversation into parts?
No, sorry. The SendMessage() sequencer command is only designed to send a string or nothing as the parameter. But the OnConversationEnd method expects a Transform as the parameter. You could add something like this to your script:
and use this Sequence:
Code: Select all
public void OnConversationEnd2() {
OnConversationEnd(this.transform);
}
Code: Select all
SetActive(Dialogue Panel,false);
SendMessage(OnConversationEnd2);
SetActive(Dialogue Panel,true)@Message(DoneMovingCharacter)