Forum rules - please read before posting.

Appending/adding to dialogue subtitles instead of having a new instance of subtitles appear?

Sorry if this is something easy to figure out and I'm being silly!

I want some images on screen to update while a line of dialogue is happening. As of now, I can only seem to have the first line of dialogue play, have the images on screen update/change, and then have the second line of dialogue appear, replacing the first line entirely. Is there any way to retain the previous line and just append the second line of dialogue with programming events happening in between updates?

Comments

  • There's a couple of ways you can do this.

    One way is to just have all your speech be in a single line of dialogue, and use [wait:X] tokens to separate them (X being the time to wait, in seconds).

    When such a token is reached, the display text will wait the given time before continuing. The Manual's "Speech tokens" chapter desribes all available tokens.

    The other way would be to use events, as you say. The OnStartSpeech custom event will fire any time a character speaks, passing the speech as a parameter that you can use in a custom script.

    The tutorial covering events also makes use of this event - you can find it here.

    A ready-made script that takes this concept and uses it to create a "Chat log" feature can be found on the AC wiki here.

    For mixing animation and speech together, though, you might also want to look into the use of Timeline. AC provides a "Speech track" type that can be used to play speech using Timeline, and can be useful when you want to sync it with other animations - a technique used by the 3D Demo's opening cutscene.

  • edited July 2023

    Hi Chris, thanks for the quick response! I think I might not have been clear in describing what I wanted so I apologize for that. I'll try again!

    I don't think the [wait] token will work for what I'm aiming to do, because I am attempting to script on screen image changes via Object:Visibility functions at certain points in the dialogue, without the dialogue clearing.

    For even more clarity--I'm attempting to change a GameObject's visibility mid-dialogue the same way I can change character portrait images mid-dialogue with the [expression] token.

    As I have it now, like this, what happens is that the text is split up after the Object Visibility actions take place.

    What I want is for the Object Visibility functions to happen, and then have the dialogue appear like this in the box--just continued after the Object Visibility functions. I don't want the first line of text that happens before the Object Visibility functions to clear, and want the second line to append onto the same subtitle after the Object Visibility functions.

    I was reading the manual and other forum posts about custom text tokens and I think this seems like it might be the way to achieve what I want, but I'll be honest, I don't understand how/where to actually implement custom text tokens? I apologize if it's super obvious, I have no scripting background other than just messing around and trying to figure things out, so your guidance is very appreciated!

    EDIT: Just as an update, I just now attempted to do this with the [line:ID] function, and it calls the previous text, but still scrolls it through as if it's being spoken for the first time, so it doesn't achieve what I'm going for.

  • Posting an update because I might have figured out how to do this myself! Just in case anyone searches for a solution to a similar problem.

    I figured out how to make custom speech tokens work and so I am now accomplishing this with custom speech tokens that affect the text scroll speed. See below:

    I have a textspeed value of "instant" assigned to change the text scroll speed to 1000000000000000000000f, which causes the text under this speed to appear instantly, then reset the textspeed value to the default value (marked as 10) on the part of the line I want to play on as normal.

    Effectively what this allows me to do is run action list actions between lines of dialogue seamlessly without the text breaking up into a new instance of dialogue on screen.

    If anyone has a more elegant way of approaching this via custom speech tokens, I'd be happy to take it, but for now this seems to be working!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.