Hello!
I am making a custom Sequence that plays a facial expression for a character. And since I need to call this sequence in every NPC dialogue line it would be tedious to have to write include {{default}} every time.
So I am trying to call Default Sequence from the new custom Sequence class SequencerCommandSetExpression. But I'm running in circles trying to find a way to do it and I finally decided to ask for help.
I noticed Sequencer.PlaySequence() method but I don't know how to make it call the default one. Is there some way of doing this?
Thanks!
How to call Default Sequence from new custom Sequence I'm making?
-
- Posts: 23
- Joined: Sun Nov 29, 2020 8:50 pm
Re: How to call Default Sequence from new custom Sequence I'm making?
Hi,
Use an OnConversationLine method. For example, add a script with this method to the Dialogue Manager:
You could define your own special keyword -- maybe {{nodefault}} -- to indicate that the line shouldn't incorporate the default:
Use an OnConversationLine method. For example, add a script with this method to the Dialogue Manager:
Code: Select all
void OnConversationLine(Subtitle subtitle)
{
if (subtitle.speakerInfo.isNPC && !subtitle.sequence.Contains("{{default}}")
{
subtitle.sequence = "{{default}}; " + subtitle.sequence;
}
}
Code: Select all
void OnConversationLine(Subtitle subtitle)
{
if (subtitle.speakerInfo.isNPC && !subtitle.sequence.Contains("{{default}}" &&
!subtitle.sequence.Contains("{{nodefault}}")
{
subtitle.sequence = "{{default}}; " + subtitle.sequence;
}
}
-
- Posts: 23
- Joined: Sun Nov 29, 2020 8:50 pm
Re: How to call Default Sequence from new custom Sequence I'm making?
Thank you! This solved the problem. I adjusted the code a little bit and I'm gonna post here in case anyone else runs into same problem:
I check if "SetExpression" is contained in sequence to check if line needs adding {{default}}, so I don't have to add {{nodefault}} on all other lines.
Code: Select all
void OnConversationLine(Subtitle subtitle)
{
if ((subtitle.speakerInfo.isNPC && !subtitle.sequence.Contains("{{default}}")) && subtitle.sequence.Contains("SetExpression"))
{
subtitle.sequence = "{{default}}; " + subtitle.sequence;
}
}
Re: How to call Default Sequence from new custom Sequence I'm making?
Glad to help, and thanks for sharing your solution.