Forum rules - please read before posting.

Dialog Speech Rewind, Replay and Forward

I have three buttons
1.Pre (when press Button then play previous Dialog speech .)
2.Replay (when press Button then replay the Current Dialog speech .)
3.Next (when press Button then play Next Dialog speech .)
how i will do this any Help
thanks

Comments

  • Starting with 3, you can use the Variable: Run sequence Action to play a different Action each time its run. For example:

    Here, a sequence is used to play a different speech line each time the ActionList is run. The sequence's state is also recorded in a Local integer variable named "MySequence", which we can later manipulate to replay the current/previous lines.

    To run this from a Button menu element, set the Button's Click type to Run Action List, and assign an ActionList asset with the same Actions as above. You'll have to rely on Global Variables instead, however, since you can't access Local variables from an asset file.

    To play the previous/current speech, we can then manipulate the "MySequence" variable to change what Action is triggered when the ActionList is re-run. So that we can set this variable back to its correct state afterwards, create another Integer Variable named "TempSequence" that we'll used to backup/restore it.

    An example ActionList to replay the current line:

    And the previous line:

    Again, here I'm demonstrating local variables and ActionLists ("Cutscene" is the name of the top ActionList with the sequence), but the same principle applies to ActionList assets.

    To run these ActionLists, you can create Button menu elements that run these as well.

  • thank you for your brief answer.this is for single cutscene.but I have multiple cutscene how I will apply different cut Scene .
    image
    https://imgur.com/a/Y7kCzIO

  • If you're limiting it to one Hotspot per scene, you could have the ActionList asset refer to the in-scene Cutscene by Constant ID, and just make sure the relevant Cutscene in each scene shares the same ID. That technique is covered in these tutorials.

    If you have multiple Hotspots in a scene, there's a couple of ways you can do it:

    1. Use another Variable to determine which Cutscene to affect. This could be an Integer set when the Hotspot is interacted with, e.g. HotspotA sets its value to 1, HotspotB to 2, etc. You could then read this variable value and run a different ActionList: Run Action accordingly.

    2. By defining a GameObject parameter in your ActionList, you can override the ActionList: Run Action's ActionList field so that its value can be set using the ActionList: Set parameter Action within the Hotspot's Interaction. For more on parameters, see this tutorial. Alternatively, a script could be written to automatically set the parameter's value to the last-clicked Hotspot:

    http://pasteall.org/1443197/csharp

  • Thank you Chris. let me Try

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.