Two instances of DM

Announcements, support questions, and discussion for the Dialogue System.
Escara
Posts: 78
Joined: Sun Dec 30, 2018 4:55 am

Two instances of DM

Post by Escara »

Hi Tony

I hope you're well.

I was wondering how to go about having 2 different versions of DM in my game please.

My default setting is to have the PC, NPC and Response Panels displayed middle bottom of the scene but in some scenarios I need it positioned at the top middle of the screen.

I duplicated the in-scene version and positioned the panels where I want them which is great, however, is there way for me to switch between them when I need to? I don't seem to be able to save the new copy as a prefab either. I can't see anything that's like an 'enable Dialogue' for this as in AC. I see there is a 'remember Dialogue System'. Is the best way to use the 'Add or Remove' Object action list for this? Or is there a better way?

Many thanks

Caroline
Escara
Posts: 78
Joined: Sun Dec 30, 2018 4:55 am

Re: Two instances of DM

Post by Escara »

I've just noticed your Highlander comment. So I should have only one DM so I need a way to switch between the panels when needed. I honestly haven't got a clue how to go about that. :?
allisonrose
Posts: 32
Joined: Wed Nov 14, 2018 8:27 pm

Re: Two instances of DM

Post by allisonrose »

Hey! I'm not Tony, but I may be able to help as I'm doing exactly what you are doing - I have multiple subtitle panels that are located in different spots (and have different appearances) and I switch between them in conversation using the SetPanel sequencer command.

So I basically made an instance of the UI in my hierarchy, duplicated a subtitle panel, and re positioned it to where I wanted it to be.

Then when you select your Dialogue UI in the hierarchy, you'll see the Standard Dialogue UI component. This is where you assign your newly created subtitle panel to be associated with a number. So then when you want to change this subtitle panel during a conversation, put something like this in the sequencer:

Code: Select all

SetPanel(Narrator, 3);
Where Narrator is the actor, and 3 is the number of the subtitle as assigned in the previous component.

Note that you have to set the panel in the node BEFORE you want them to start speaking.

If Tony knows a better way, he can chime in. But this has worked for me!
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Two instances of DM

Post by Tony Li »

Thanks, @allisonrose! That's exactly what you do. Duplicate a subtitle panel and assign it to the Standard Dialogue UI component's Subtitle Panels list. It will have a number in this list (0, 1, 2, etc.). If you always want a character to use a specific subtitle panel, add a Dialogue Actor component to the character's GameObject, and set Dialogue UI Settings > Subtitle Panel Number.

If you want to change the panel a character uses going forward, use the SetPanel() sequencer command that allosonrose mentioned.

If you want to use a specific panel only for a single dialogue entry node, use the [panel=#] markup tag.

If you want a character to use an entirely different dialogue UI -- and not just a specific subtitle panel in your regular UI -- then add an Override Dialogue UI component to the character's GameObject, and assign the dialogue UI you want it to use. It can be a dialogue UI in the scene or a prefab.
Escara
Posts: 78
Joined: Sun Dec 30, 2018 4:55 am

Re: Two instances of DM

Post by Escara »

Thank you both!

I think the ' SetPanel() sequencer command is the one I want.

Sometimes in the scene I'll want the panels to appear above them during conversations because when they're below they cover up the Player and NPC. But only sometimes.

So in the Sequencer at the START of the conversation I would type:

Code: Select all

SetPanel(Dawes,2); SetPanel(Dink,3); 
1. Or is there a better place to type this?
2. Or should I not use the actors names but use 'PC Subtitle Panel Above' etc?

A few more questions.

3. I've duplicated the Response panel and increased the Menu panel size to 2 and assigned that. How do I assign this?

Code: Select all

SetPanel(Response Menu, 1)


4. How to revert back to the default panels? Similar set up?

Thanks again,

Caroline
Escara
Posts: 78
Joined: Sun Dec 30, 2018 4:55 am

Re: Two instances of DM

Post by Escara »

I've just seen the Set Response Panel tick box!
Escara
Posts: 78
Joined: Sun Dec 30, 2018 4:55 am

Re: Two instances of DM

Post by Escara »

Hmm, I'm still having issues. Do I need to create an AC action list 'Third Party Dialogue System Sequencer Message' before the conversation starts? It's weird as the new positions kick in on the second conversation only.

I still can't seem to be able to switch to the new response menu either.

Any help much appreciated.

Thank you
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Two instances of DM

Post by Tony Li »

Hi Caroline,

I just tested without AC and my test scene works. I'll put together an AC scene to make sure it works there. Then I'll send you the test scene so you can compare it with your own scene.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Two instances of DM

Post by Tony Li »

Hi Caroline,

Here's an example:

DS_AC_SetPanel_Example_2019-05-27.unitypackage

It's based on AC's 2D Demo. To play it, you'll need to import the package, inspect the 2D Demo's ManagerPackage, and click Assign managers. When you're done, remember to inspect your own game's ManagerPackage and click Assign managers again.

If you click on the bird, it will start a conversation. To make the bird appear, you'll need to pick up the worm and put it on the bench. You can press 'i' (Interrupt) to skip the intro cutscene and the putting-worm-on-bench cutscene.

Here are some notes I jotted down when setting up the scene:
  • Make sure your characters have Dialogue Actor components. I added an instance of the player prefab, Brain2D, to the scene so I could add a Dialogue Actor to it. Then I set it to menu panel 1. I also added a Dialogue Actor to the Bird.
  • Assign your new subtitle panels to your dialogue UI's Subtitle Panels list, and your new menu panels to the Menu Panels list.
  • This one is the key, and it tripped me up at first, too: The <START> node should almost always be treated as an empty pass-through node. Don't put the SetPanel() sequencer command in its Sequence field. Instead, link <START> to a blank node, and put the SetPanel() sequencer command in the blank node's Sequence. If you use a continue button, add a Continue() command to the Sequence, too. Then link that blank node to your first real conversation node. (Despite the big yellow warning that I myself programmed onto the <START> node, I ignored the warning at first and put the sequencer command on it. :oops:)
Escara
Posts: 78
Joined: Sun Dec 30, 2018 4:55 am

Re: Two instances of DM

Post by Escara »

Thanks Tony, you are a star.

Everything is working how I wanted now. For reference this is the sequence I used in the empty node:

Code: Select all

SetPanel(Dawes,2); SetPanel(Dink,3); SetMenuPanel(Dawes,1); Continue()
:D
Post Reply