When using Text Mesh Pro in a Unity UI-based Menu, check Use TMPro components? in the Menu's properties to make use of them.
For dynamic elements, such as speech text, you may need a custom script to have the speech be updated from AC directly. This will vary based on your situation, but a couple of samples can be found in this discussion:
Yes, I need it for dynamic elements, such as speech text. I followed your script example in the above discussion but I keep getting an error.
1) I used this script https://prnt.sc/37VF2VTZiJYo and attached it to the UI prefab
Error: Assets/jd/Scripts/TextAnimator.cs(7,23): error CS0234: The type or namespace name 'TextAnimator' does not exist in the namespace 'Febucci.UI' (are you missing an assembly reference?)
Are you using speech-scrolling? If so, what is the effect of disabling that feature?
If you're speech-scrolling, you'll likely need the second script in that thread. Bear in mind, however, that you'll need to detach the Text object from AC's Speech Manager so that only the script is affecting it.
Yes, I'm using speech-scrolling, however, using the 2nd script or just remove the scrolling function from AC doesn't solve the issue.
When you say "detach the Text object from AC's Speech Manager" are you referring to this one https://prnt.sc/e0IcGbrF-8nZ ? If yes, then I can't remove it. It always shows the Text object.
If that's the same object you're affecting with the script, yes.
You can clear it by deleting the Line Element itself in the Menu Manager, or by just removing the Constant ID component from the GameObject - it's this that creates the link with AC.
Unfortunately, I did all the above but it still doesn't work.
1) I deleted the line Element in the Menu Manager = same issue
2) Removed the Constant ID component = Same issue
3) Removed the line element and Constant ID component = same issue
However, the new approach has created two new dialogue-related issues:
1) All dialogue expression tokens are now visible in the dialogue. [expression:normal_v1] etc
2) It seems that the number of characters is limited, with most dialogues showing only half of the text.
It's a conflict with AC's tag-processing. You can prevent it, however, by clearing the "Rich Text Tags" array in the Dialog component of the scene's GameEngine object.
Comments
Indirectly. Text Animator relies on Text Mesh Pro UGUI components to work, which AC does support.
In most cases, for static text boxes e.g Pause menus etc, this should be enough:
https://docs.febucci.com/text-animator-unity/welcome/quick-start
When using Text Mesh Pro in a Unity UI-based Menu, check Use TMPro components? in the Menu's properties to make use of them.
For dynamic elements, such as speech text, you may need a custom script to have the speech be updated from AC directly. This will vary based on your situation, but a couple of samples can be found in this discussion:
https://adventurecreator.org/forum/discussion/13732/
Yes, I need it for dynamic elements, such as speech text. I followed your script example in the above discussion but I keep getting an error.
1) I used this script https://prnt.sc/37VF2VTZiJYo and attached it to the UI prefab
Error: Assets/jd/Scripts/TextAnimator.cs(7,23): error CS0234: The type or namespace name 'TextAnimator' does not exist in the namespace 'Febucci.UI' (are you missing an assembly reference?)
2) I tried the other script https://prnt.sc/wzMDMs4-dlto and didn't get any error, however, when adding effects like "shake" the whole line will disappear https://prnt.sc/Hb7nsAPg6ltT
https://prnt.sc/rfFm5p2bEweW
Any idea what's going on?
Use the first script but replace
Febucci.UI.TextAnimator
withFebucci.UI.TextAnimator_TMP
.Thank you, Chris. That fixed the error. However, when adding effect to text the whole dialogue will disappear https://prnt.sc/iJuulzV1XANm
https://prnt.sc/Hb7nsAPg6ltT
It works fine with Unity Canvas text but not with Adventure Creator dialogue.
It shows this: https://prnt.sc/IalItFfByoDT
https://prnt.sc/u0ryV0VESds2
https://prnt.sc/8SVYKbiVVBpL
https://prnt.sc/-ktCQfc-h9Lb
No. Removing the tags / expression tokens doesn't fix the issue.
Are you using speech-scrolling? If so, what is the effect of disabling that feature?
If you're speech-scrolling, you'll likely need the second script in that thread. Bear in mind, however, that you'll need to detach the Text object from AC's Speech Manager so that only the script is affecting it.
Yes, I'm using speech-scrolling, however, using the 2nd script or just remove the scrolling function from AC doesn't solve the issue.
When you say "detach the Text object from AC's Speech Manager" are you referring to this one https://prnt.sc/e0IcGbrF-8nZ ? If yes, then I can't remove it. It always shows the Text object.
My prefab: https://prnt.sc/9ZZP5drUOyrh
If that's the same object you're affecting with the script, yes.
You can clear it by deleting the Line Element itself in the Menu Manager, or by just removing the Constant ID component from the GameObject - it's this that creates the link with AC.
Unfortunately, I did all the above but it still doesn't work.
1) I deleted the line Element in the Menu Manager = same issue
2) Removed the Constant ID component = Same issue
3) Removed the line element and Constant ID component = same issue
Can you PM me your Managers, Subtitles UI prefab and script?
Sure
Thanks for the files. I've updated the script and provided a guide for it on the AC wiki:
https://adventure-creator.fandom.com/wiki/Text_Animator_speech
Thank you, Chris. I can confirm that the above guide worked perfectly. https://prnt.sc/O7AtLXRyB5yj
However, the new approach has created two new dialogue-related issues:
1) All dialogue expression tokens are now visible in the dialogue. [expression:normal_v1] etc
2) It seems that the number of characters is limited, with most dialogues showing only half of the text.
https://prnt.sc/c17kQwaL4wnr
https://prnt.sc/z_i2Gd50n5Co
https://prnt.sc/Hb6qz-tomOsz
P.S. If I don't use dialogue expression tokens isuue 2. will be removed
I've updated the script, try it now.
Thank you, Chris. The new script worked 100%
Hey Chris,
The animated tags like , , , and are working fine.
But I’ve run into an issue — tags like , <color=red>, and don’t seem to do anything.
It looks like the animation stuff works, but styling tags like bolding, fading, or changing color just get ignored.
Is this a limitation with Adventure Creator's integration, or is there something I need to tweak in the script to make those tags work too?
It's a conflict with AC's tag-processing. You can prevent it, however, by clearing the "Rich Text Tags" array in the Dialog component of the scene's GameEngine object.
Thank you, Chris. It worked. I've also informed the creator of Text Animator about the new AC script.