Hi, I'm running into an issue where it's becoming very tedious/time consuming to add sequencers to dialogue snippets.
As things are I have speech bubbles that can be changed/rotated depending on who is speaking (with a custom sequencer) and their emotions/state. I currently write the dialogue in excel and import that using the package that supports it.
Is there a way to translate this extra field for the character's emotion into something that can be picked up automatically? Or at the least be available as a dropdown here that can trigger a sequencer?
Excel import/DIalogue Entry customization
-
- Posts: 9
- Joined: Fri May 20, 2022 10:15 pm
Re: Excel import/DIalogue Entry customization
Hi,
Have you modified the importer code to import that third column as a custom field in your dialogue entries? If so, then you can add an OnConversationLine(Subtitle) method to a script on your Dialogue Manager. Let's say you've modified the Excel importer to add a custom field named "Emotion". Your method might look something like:
Have you modified the importer code to import that third column as a custom field in your dialogue entries? If so, then you can add an OnConversationLine(Subtitle) method to a script on your Dialogue Manager. Let's say you've modified the Excel importer to add a custom field named "Emotion". Your method might look something like:
Code: Select all
void OnConversationLine(Subtitle subtitle)
{
string emotion = Field.LookupValue(subtitle.dialogueEntry.fields, "Emotion);
string emotionSequence = GetEmotionSequence(emotion);
if (!string.IsNullOrEmpty(emotionSequence))
{
subtitle.sequence = $"{emotionSequence}; {subtitle.sequence}";
}
}
string GetEmotionSequence(string emotion)
{
switch (emotion)
{
case "Neutral": return "SetTextBubbleImage(0, 1);"
case "Happy": return "SetTextBubbleImage(0, 2);"
case "Sad": return "SetTextBubbleImage(0, 3);"
default: return string.Empty;
}
}
-
- Posts: 9
- Joined: Fri May 20, 2022 10:15 pm
Re: Excel import/DIalogue Entry customization
Yup, this worked like a charm. Thank you!
Re: Excel import/DIalogue Entry customization
Glad to help!