Page 1 of 1

Do something when specific text is reached

Posted: Thu Dec 21, 2023 8:39 am
by SealDev
I'm using SendMessage() to play a character SFX on a dialogue node with the following text:

"......ok"

If I do SendMessage() it plays the character sound too soon.

Or I can try to find the specific timing after which all the dots are displayed, then play the SFX using @.5 or @.3, but this guessing it time consuming and takes too many attempts.

In my game, players can also press the "E" key to skip to the end of the line of the dialogue instantly, but if I used delay @, it will still wait until the time is met. (making this option, also not viable)


Is there a command I can add to my "Dialogue Text" field right after the dots to trigger a message at the right time, whether players choose to skip the dialogue or not?

Re: Do something when specific text is reached

Posted: Thu Dec 21, 2023 10:00 am
by Tony Li
If it's alright to play the character SFX on the last letter ('k'), then you can use the sequencer's "@Message(Typed)" syntax. Example:

Code: Select all

SendMessage(PlayCharacterSFX)@Message(Typed)
Otherwise you'll have to write some code or use Text Animator. It has the ability to specify in-line event hooks in your text.