Do something when specific text is reached

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
SealDev
Posts: 85
Joined: Thu Jun 24, 2021 5:45 am

Do something when specific text is reached

Post 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?
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: Do something when specific text is reached

Post 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.
Post Reply