Forum rules - please read before posting.

Extend conversation after choosing dialogue option

Hi,

So I’m looking to add some actions after the dialogue option has been chosen, I’d like for the menu to stay active and to fire off an animation and update a text element. Then the player clicks on the mouse, the menu closes and the player says his dialogue line. How would I implement this?

Thanks!

Comments

  • Rather than having the Dialogue Option trigger the Player's response directly, you'd need to instead run a custom script that runs the response from there.

    What kind of animation and update to text?

  • So I want to update a string var in my unity ui menu, and animate a menu element. Then wit for player input to close menu (click anywhere)
  • Make an ActionList asset (e.g. ClickDialogueOption) that handles the menu turning on, string variable update and animation call. Define parameters for any field you want to be dynamic, and then set those parameter values inside an ActionList: Run Action that is called when the dialogue option is chosen.

    The Player's actual response should be in a separate ActionList, detached from the Conversation.

    To have it run when the player clicks, define another ActionList asset (RunPlayerResponse) that turns the menu off (Menu: Change state) and runs the Player's response ActionList (ActionList: Run). This second Action should rely on a GameObject parameter that can be used to control which response ActionList should be run.

    Next, define an Active Input that response to an input mapped to "mouse 0", and assign it the RunPlayerResponse ActionList, so that it gets run when the player clicks. Leave it disabled by default, and have ClickDialogueOption enable it with Input: Toggle active.

    To control which "player response" ActionList should be run when RunPlayerResponse is called, create another GameObject parameter in ClickDialogueOption to represent it, and set it in the ActionList: Run Action triggered when clicking a Conversation's dialogue option.

    Then, end your ClickDialogueOption ActionList with an ActionList: Set parameter Action that transfers this GameObject parameter value to that of RunPlayerResponse.

  • edited November 2021

    Hi,

    So where would I call this? From the menu? Or from my undefined Conversation cutscene?

    and then set those parameter values inside an ActionList: Run Action that is called when the dialogue option is chosen.

    Here are screenshots to see if I am doing it right!

    https://www.dropbox.com/sh/l9oa0v8bwidv4j5/AAA27cWx-M5HmrDL8PlX1wbTa?dl=0

    I got a bit confused with the last two instructions.

    Thanks

    • Your Active Input's "Input button" should be the name of an input listed in your Input Manager - not the input key itself.
    • Your Active Input should also be disabled by default
    • Your "Dialogue: Conversation" Action should only run ClickDialogueOption - the responses from the Player (i.e. the "Dialogue: Play speech" Action) should be moved to separate ActionLists
    • Your "ActionList: Run" Action(s) run after the "Dialogue: Conversation" Action need their "Run mode" set to "Set Parameters And Run", so that you can assign the string variable, which animation to play, and which player response ActionList should be run afterwards
    • Your "ActionList: Set parameter" Action should not set its own parameter value, but transfer its "ActionList run" parameter to the "RunPlayerResponse" ActionList's "Run ActionList" parameter
  • edited November 2021

    Right, so for point 3, once the player clicks on the InGame menu, a variable is checked, and if it matches to a specific number an action list 'OutsideOffice' is called, within that is my Dialogue:Start Conversation, so, when you say:

    Your "Dialogue: Conversation" Action should only run ClickDialogueOption - the responses from the Player (i.e. the "Dialogue: Play speech" Action) should be moved to separate ActionLists

    Do you mean that my override dialogue options should each have a seperate action list? or both into one action list? This is how it is currently set up:

    https://www.dropbox.com/s/97r7bryc2z8t7ky/Dialogue - Start Conversation.png?dl=0

    Then when you say:

    Your "ActionList: Run" Action(s) run after the "Dialogue: Conversation" Action need their "Run mode" set to "Set Parameters And Run", so that you can assign the string variable, which animation to play, and which player response ActionList should be run afterwards

    Which action lists are these? As RunPlayerResponse doesn't have any parameters that are needed (string, animation, which player response) it is just turn off menu and runaction list? As described here:

    define another ActionList asset (RunPlayerResponse) that turns the menu off (Menu: Change state) and runs the Player's response ActionList (ActionList: Run).

    See screenshot of my RunPlayerResponse actionlists available parameters:

    https://www.dropbox.com/s/j2b0ki563tohp9z/RunPlayerResponse - parameter options.png?dl=0

    And this, which response should be run? Am i creating other action lists outside of the action lists you have described (ClickDialogueOption, RunPlayerResponse)

    This second Action should rely on a GameObject parameter that can be used to control which response ActionList should be run.

    Without screenshots from your good self I am really finding it hard to understand what actionlists are being referred to as it is actionlists within action list and getting a bit rabbit hole.

    Really appreciate all your help on this.

  • Ok so ensured that my action lists are identical to yours in the screenshots you shared, and the MobileTextConversation (the conversation menu) menu turned off immediately on clicking the response. This is the menu that would have the animation in it. There was a blank screen where i need to click (with no cutscene cursor - that I need to) then have the response, but my animation didn't play because the menu turned off.

    Finding this very hard to follow. Sequence of events needs to be:

    1. dialogue options come up as normal in conversation menu (MobileTextConversation)
    2. click on response causes animation to run and string in animation to update in MobileTextConversation menu and this menu to stay visible until player clicks
    3. player clicks which closes the MobileTextConversation menu and player response dialogue plays

    Current sequence of events following your guide is:
    1. dialogue options come up as normal in conversation menu (MobileTextConversation)
    2. click on response causes menu to disappear
    4. click again with no cutscene cursor for prompt causes player response dialogue to play

    see my video here:

    https://www.dropbox.com/s/035gkuwoaeiyob3/DialogueExtend.mov?dl=0

  • edited November 2021

    If you want your Menu to remain active once the dialogue option has been chosen, you need to change your Menu's Appear type to Manual, so that it doesn't close when the Conversation ends.

    You then need to turn on your Conversation menu manually once the Conversation has begun. This can be done through scripting, or with the ActionList: Run in parallel Action:

    https://imgur.com/a/Wuwody5

    You can turn the Menu off again manually inside RunPlayerResponse.

    If you wish to place the game in "cutscene" mode during this time, you can force a cutscene by looping an Engine: Wait Action of 1 second on itself at the end of the ClickDialogueOption asset:

    https://imgur.com/a/ysSYC4T

    Inside your RunPlayerResponse asset, you'd then need an ActionList: Kill Action to kill ClickDialogueOption. You'd also need to set your Active Input's Available when game is to Cutscene.

    The reason for this complicated approach is that you want the player to click again, after the animation, to prompt the response. If there was instead a fixed time between clicking the option and showing the response, you would be able to simplify things drastically by altering the GameEngine's Dialog component's Conversation Delay slider.

    Currently, this can't be adjusted once an option has been clicked. I shall look into changing this - that way, it should be possible to artificially inflate this value until the user clicks, allowing for the Actions involved to be simplified (no need for parameters etc).

  • ok so this is all working except my dialogue options are not showing? i can press 1 or 2 to choose the option, but they are not visible as they were before making the new changes above?

    see video:

    https://www.dropbox.com/s/iu5i7ka6zvho6hv/almostthere!.mov?dl=0

  • Swap your ActionList: Run in parallel Action's sockets around, so that the menu is opened in the second (bottom) socket, not the first.

  • boom! it works! THANK YOU!

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.