The sequence of a Player's conversation line does not run at the beginning?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
doneykoo
Posts: 7
Joined: Fri Sep 29, 2017 4:29 am

The sequence of a Player's conversation line does not run at the beginning?

Post by doneykoo »

The sequence of a Player's conversation line does not run at the beginning (of player choice), but it runs at the end after choice, what's wrong?

For example:

Npc1: blabla1
Sequence: SetActive(something, true)

Npc1: blabla2

Player: choice a
with Sequence: SetActive(something, false)
Player: choice b
with Sequence: SetActive(something, false)

Now the Sequences written in the player choice never runs at the beginning when the choice lines displayed. But instead, it runs after user choice.
How to solve it?
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: The sequence of a Player's conversation line does not run at the beginning?

Post by Tony Li »

Hi,

That's intentional. It shouldn't run the sequence until the player has actually selected the choice.

If you want to run a sequence as soon as the player response menu appears, there are two ways:

1. On the preceding NPC node, tick the Add Response Menu Sequence checkbox, and enter the sequence in the Response Menu Sequence field.
  • Response Menu Sequence: Audio(Jeopardy_Music)
2. Or, if you don't want to add a Response Menu Sequence, add a "required" command to the end of the NPC node's regular Sequence, like this:
  • Dialogue Text: "What's your answer?"
  • Sequence: Camera(Closeup); required Audio(Jeopardy_Music)@99999
The "@99999" tells the Audio() command to wait until 99999 seconds have passed, but the "required" keyword guarantees that the sequencer command runs even if the player clicks the continue button before the time has passed.


If you want to run a sequencer command when the player hovers over a choice but hasn't clicked it yet, you'll need to use a script. You can use this example script which is on the Dialogue System Extras page.
Post Reply