Starting New Conversation From Sequence

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Itilos
Posts: 21
Joined: Thu Oct 20, 2022 12:03 am

Starting New Conversation From Sequence

Post by Itilos »

I'm currently looking to set up a Sequence like this (pseudocode):

FadeIn();
[Wait for fade to complete]
StartConversation();

My Trigger object looks like this:
Screenshot 2023-07-13 205305.png
Screenshot 2023-07-13 205305.png (48.63 KiB) Viewed 872 times
My issue is, the Fade occurs, but immediately, the conversation Action starts.

I have two questions:
  1. How do I delay an action to wait on the one above?
  2. Is it possible to trigger a conversation from a sequence? Say I have triggers A and B, can A run a sequence that start's B's conversation? I was looking through the docs and couldn't figure out how to do this.
Thanks!
User avatar
Tony Li
Posts: 22125
Joined: Thu Jul 18, 2013 1:27 pm

Re: Starting New Conversation From Sequence

Post by Tony Li »

Hi,

There are a few ways you can do this. Here's one way:
chainedTriggers.png
chainedTriggers.png (57.61 KiB) Viewed 869 times

When you interact (use) this GameObject, the first Dialogue System Trigger plays a sequence containing "Fade(out, 3)".

The second Dialogue System Trigger fires when a sequence on this GameObject ends. It plays a sequence to fade in and starts the conversation.
Itilos
Posts: 21
Joined: Thu Oct 20, 2022 12:03 am

Re: Starting New Conversation From Sequence

Post by Itilos »

Thanks! This works fine.

As per my second question - is it possible for a Dialogue Trigger to start a Conversation on a different object?

AKA is there any way for a sequence or something to call a different GameObject's DialogueTrigger StartConversation Action, or do they need to be on the same object?
User avatar
Tony Li
Posts: 22125
Joined: Thu Jul 18, 2013 1:27 pm

Re: Starting New Conversation From Sequence

Post by Tony Li »

Hi,

It's possible. Set the other GameObject's Dialogue System Trigger to OnUse. Then you'll use the SendMessage() sequencer command to trigger it. There are two ways to specify the other GameObject:

1. If you're playing the sequence in a Dialogue System Trigger's Action > Play Sequence, assign the other GameObject as the Sequence Speaker. Then use this sequencer command: SendMessage(OnUse)

2. If you can't specify the sequence speaker, give the other GameObject a unique name. For example, say it's named Foo. Then use this command: SendMessage(OnUse, , Foo)
Itilos
Posts: 21
Joined: Thu Oct 20, 2022 12:03 am

Re: Starting New Conversation From Sequence

Post by Itilos »

Thank you! This is very helpful.
User avatar
Tony Li
Posts: 22125
Joined: Thu Jul 18, 2013 1:27 pm

Re: Starting New Conversation From Sequence

Post by Tony Li »

Glad to help!
Itilos
Posts: 21
Joined: Thu Oct 20, 2022 12:03 am

Re: Starting New Conversation From Sequence

Post by Itilos »

One other thing that just came up along same lines -

Is there an easy way to pass in a child of a gameobject for the SetEnabled() sequence command?

Ie lets say a gameobject looks like this

Player(speaker)
|- Sprite (child of Player, contains component A)

I want to SetEnabled() component A.

Am I able to do something like SetEnabled(A, true, speaker.Sprite) ?
User avatar
Tony Li
Posts: 22125
Joined: Thu Jul 18, 2013 1:27 pm

Re: Starting New Conversation From Sequence

Post by Tony Li »

Hi,

Unfortunately no. If you know the GameObject is named exactly "Player", you could do this:

Code: Select all

SetEnabled(A, true, Player/Sprite)
If you know the speaker is the conversation actor and that its GameObject name is exactly the same as the actor's Display Name field in your dialogue database, you could do this:

Code: Select all

SetEnabled(A, true, [var=Actor]/Sprite)
(If you haven't ticked the actor's Use Display Name field, the Display Name will be the value of its Name field.)

If that doesn't meet your needs, you could write a custom sequencer command.
(See Part 6 of the Cutscene Sequence Tutorials.)
Itilos
Posts: 21
Joined: Thu Oct 20, 2022 12:03 am

Re: Starting New Conversation From Sequence

Post by Itilos »

This is helpful! Thank you!
User avatar
Tony Li
Posts: 22125
Joined: Thu Jul 18, 2013 1:27 pm

Re: Starting New Conversation From Sequence

Post by Tony Li »

Glad to help!
Post Reply