Super Text Mesh Integration
Re: Super Text Mesh Integration
Hi! Sorry to bother with this again after such a long time. I was just wondering if a full integration is still in the works or planned.
The current wip package is great but even though I haven't gone too deep into it I've already seen some bugs. The "min subtitle seconds" ignores STM's delay tags, "subtitle chars per second" doesn't take into account the typing speed (I think it's using Dialogue System's own typewriter settings for the calculation and not STM's "read delay" variable), the "always" continue button option sometimes skips lines and the last line in a conversation doesn't show the continue button and gets cut short.. there might be more, that's just from a quick look.
I could attempt to go more into it and try to fix these, but it's probably not gonna be as clean and thorough as an official support package, and I wouldn't want it to be redundant work if one is already in progress. Thanks again for all your help so far!
The current wip package is great but even though I haven't gone too deep into it I've already seen some bugs. The "min subtitle seconds" ignores STM's delay tags, "subtitle chars per second" doesn't take into account the typing speed (I think it's using Dialogue System's own typewriter settings for the calculation and not STM's "read delay" variable), the "always" continue button option sometimes skips lines and the last line in a conversation doesn't show the continue button and gets cut short.. there might be more, that's just from a quick look.
I could attempt to go more into it and try to fix these, but it's probably not gonna be as clean and thorough as an official support package, and I wouldn't want it to be redundant work if one is already in progress. Thanks again for all your help so far!
Re: Super Text Mesh Integration
Hi,
Given Unity's focus on TextMesh Pro, and the Dialogue System's extensive support for it, this is probably as far as I'll be able to go with Super Text Mesh integration. I wish I had time to do everything, but there are only so many hours in a day for a solo developer. Feel free to take the existing integration as a launching point to make your own changes and additions.
I don't think there should be continue button issues, though. We can take a look at that as a possible bug, or a configuration issue with your Dialogue Manager or dialogue UI. Can you provide reproduction steps or, better yet, an example scene?
Given Unity's focus on TextMesh Pro, and the Dialogue System's extensive support for it, this is probably as far as I'll be able to go with Super Text Mesh integration. I wish I had time to do everything, but there are only so many hours in a day for a solo developer. Feel free to take the existing integration as a launching point to make your own changes and additions.
I don't think there should be continue button issues, though. We can take a look at that as a possible bug, or a configuration issue with your Dialogue Manager or dialogue UI. Can you provide reproduction steps or, better yet, an example scene?
Re: Super Text Mesh Integration
I understand, you already do a ton!
I do want to check the continue button issue though. I made a package with my test scene and a couple files I needed for the UI, other than that I just had the Dialogue System and STM assets and the STM support package.
Hopefully it's just a configuration issue like you mentioned!
I do want to check the continue button issue though. I made a package with my test scene and a couple files I needed for the UI, other than that I just had the Dialogue System and STM assets and the STM support package.
Hopefully it's just a configuration issue like you mentioned!
- Attachments
-
- STM_DialogueTest.zip
- (32.29 KiB) Downloaded 155 times
Re: Super Text Mesh Integration
I forgot to ask earlier: What version of Unity are you using?
Re: Super Text Mesh Integration
Thanks for the info.
Configure your Continue Button's OnClick() event to call the STM Balloon Dialogue UI's StandardDialogueUI.OnContinue method.
The weird behavior is because the Continue Button's OnClick() event didn't have anything assigned. If it doesn't have anything assigned, by default it adds a StandardUIContinueButtonFastForward component and configures OnClick() to call this component's OnFastForward() method. But this method assumes the text is UI Text or TextMesh Pro.
Alternatively, if you want the first click to fast forward the text, you can make a copy of the StandardUIContinueButtonFastForward script, customize it for Super Text Mesh, add it to the Continue Button, and configure OnClick() to call it.
Configure your Continue Button's OnClick() event to call the STM Balloon Dialogue UI's StandardDialogueUI.OnContinue method.
The weird behavior is because the Continue Button's OnClick() event didn't have anything assigned. If it doesn't have anything assigned, by default it adds a StandardUIContinueButtonFastForward component and configures OnClick() to call this component's OnFastForward() method. But this method assumes the text is UI Text or TextMesh Pro.
Alternatively, if you want the first click to fast forward the text, you can make a copy of the StandardUIContinueButtonFastForward script, customize it for Super Text Mesh, add it to the Continue Button, and configure OnClick() to call it.
Re: Super Text Mesh Integration
It's all working now, thank you for the help and for the tip on adding the extra functionality!
Re: Super Text Mesh Integration
Happy to help!
Re: Super Text Mesh Integration
Hi! Sorry to bother, I'm actually making good progress though! Just needed a bit of help with a quick thing.
The {{end}} keyword isn't always accurate for me since it uses 'chars per second' and doesn't take STM delay tags and draw animation lengths into account. STM has a variable that gives that duration though. What script would I need to modify for {{end}} to get its value from that variable?
Thank you!
The {{end}} keyword isn't always accurate for me since it uses 'chars per second' and doesn't take STM delay tags and draw animation lengths into account. STM has a variable that gives that duration though. What script would I need to modify for {{end}} to get its value from that variable?
Thank you!
Re: Super Text Mesh Integration
Hi,
Instead of using {{end}}, which strips rich text and RPG Maker codes but not STM codes, you can set a variable. For example, add a script like this to the Dialogue Manager:
Then in your Sequences use [var=end] instead of {{end}}, such as:
or:
You can globally replace {{end}} with [var=end] in the Dialogue Editor using Database > Global Search & Replace.
In a future update, I'll add a delegate to which you can assign a method that computes an alternate value for {{end}}. This way you can continue to use {{end}}.
Instead of using {{end}}, which strips rich text and RPG Maker codes but not STM codes, you can set a variable. For example, add a script like this to the Dialogue Manager:
Code: Select all
public class SetSTMEndValue : MonoBehaviour
{
void OnConversationLine(Subtitle subtitle)
{
int numVisibleChars = // (Compute based on STM drawText)
float minSeconds = DialogueManager.displaySettings.GetMinSubtitleSeconds();
float charsPerSecond = settings.GetSubtitleCharsPerSecond();
float endValue = Mathf.Max(minSeconds, numVisibleCharacters / Mathf.Max(1, charsPerSecond));
DialogueLua.SetVariable("end", endValue);
}
}
Code: Select all
Delay([var=end])
Code: Select all
AnimatorPlay(MoveMouth);
required AnimatorPlay(Idle)@[var=end]
In a future update, I'll add a delegate to which you can assign a method that computes an alternate value for {{end}}. This way you can continue to use {{end}}.