2d rpg

Announcements, support questions, and discussion for the Dialogue System.
tony_lance
Posts: 14
Joined: Thu Jun 07, 2018 12:08 am

2d rpg

Post by tony_lance »

Hello! I'm trying to get a grip on the dialogue manager. It seems like a really great tool!

I'm trying to make a pretty traditional 2d top down jrpg. This involves a lot of npc's droning on and on at the player. Maybe the player responds but 99% of the time it's a scripted response that you have no control over.

One issue I'm having is the continue button. How can I make that activated via a keypress, since I'm not using the mouse at all? It seems to activate with esc, but that's set up to "cancel" by default, so changing that cancel action to another key (like space) seems like the wrong approach..

I'm also trying to use the speech bubble ui that comes included. (going for a ff9 look-- ) This seems to complicate things a bit further because the npc's each need their own canvases with their own continue button reference... Not sure if that's the same continue button or if the idea is that it would be on their bubble only!

Thanks for the assistance!!
User avatar
Tony Li
Posts: 22058
Joined: Thu Jul 18, 2013 1:27 pm

Re: 2d rpg

Post by Tony Li »

Hi,

What version of the Dialogue System for Unity are you using?

Version 2.0 has a new Standard Dialogue UI that makes things a bit easier to set up:

First, the speech bubbles:

1. Add a Dialogue Actor component to the character.

2. In the Dialogue UI Settings section, change the Subtitle Panel Number to Custom.

3. To the Custom Subtitle Panel field, assign this prefab: Plugins / Pixel Crushers / Dialogue System / Prefabs / Standard UI Prefabs / Templates / Bubble / Bubble Template Standard UI Subtitle Panel. You can assign a customized version of this prefab later. For now, this will get you a basic overhead cartoon bubble. Test this to make sure it works in general.


Second, the continue button:

In version 2.0, the Dialogue Manager prefab has a component called Input Device Manager. Make sure its Control Mode is set to Joystick or Keyboard. This will tell the UI panels to auto-focus buttons so you can navigate and click them with the keyboard or joystick. When a subtitle panel appears (such as the bubble one above), its continue button will be auto-focused. To click it, you can press whatever input button is defined for "Submit" in Edit > Project Settings > Input. By default, this is Space and Return. Note: If you're playing on a device that has a mouse, and you move the mouse during play, the Input Device Manager will automatically switch Control Mode to Mouse.

You may also want to explicitly set a hotkey for the continue button. To do this:

1. Make a copy of the Bubble Template Standard UI Subtitle Panel so we can customize it, and assign this copy to your Dialogue Actors.

2. While you're working on the copy, you might as well delete the Always Face Camera component. This isn't necessary for 2D and at best can only cause problems.

3. Then drill down into the copy to find the continue button. You may need to temporarily put an instance in a scene so you can expand it. (I'm out of the office right now. I'm pretty sure I added a continue button to this prefab. If not, I'll send you an updated prefab later today.) Assuming the continue button is there, inspect it and add a UI Button Key Trigger component. Then assign the keycode and/or input button that will serve as a hotkey that clicks the button.

If you don't want the continue button to be visible, you can set its size to 0 or image alpha color to 0.
tony_lance
Posts: 14
Joined: Thu Jun 07, 2018 12:08 am

Re: 2d rpg

Post by tony_lance »

I'm on 1.8.2 (that was the version in the asset store) but it sounds like I should upgrade! Thanks for the help, I'll let you know if I have any trouble.
tony_lance
Posts: 14
Joined: Thu Jun 07, 2018 12:08 am

Re: 2d rpg

Post by tony_lance »

Ok I've switched to v2 and I've tried to follow your instructions. I have the bubbles coming up ok, but I'm still having issues with the continue button. You're right, it often switches to mouse mode while I'm playing... is there a way to disable that??

I've made my own bubble subtitle ui and added a continue button with space as the hotkey. I've assigned that button to the "continue button" field in the prefab, then I've assigned the prefab to the actors. I can see my continue button flash when I press space, but it doesn't advance the text. Any ideas?
User avatar
Tony Li
Posts: 22058
Joined: Thu Jul 18, 2013 1:27 pm

Re: 2d rpg

Post by Tony Li »

Hi,

In version 2.0.0, there was a bug which prevented continue buttons from working if the panel was not located inside the Dialogue Manager's main dialogue UI hierarchy. But not to worry! It's fixed in patch 20180607. I PM'ed you your download access.

Here's an example scene with a working continue button (assuming you've imported patch 20180607):

BubbleSubtitleExample_2018-06-07.unitypackage

A couple other notes:
  • I set the bubble subtitle panel's Visibility to Until Superceded since it didn't make sense to hide and reappear between every line.
  • The patch adds an option to the Dialogue Manager's Input Device Manager component to not detect mouse control. (Thanks for that suggestion.) I didn't tick it in the example scene, though.
tony_lance
Posts: 14
Joined: Thu Jun 07, 2018 12:08 am

Re: 2d rpg

Post by tony_lance »

Ah, this works great. Thanks so much!
User avatar
Tony Li
Posts: 22058
Joined: Thu Jul 18, 2013 1:27 pm

Re: 2d rpg

Post by Tony Li »

Glad to help!
tony_lance
Posts: 14
Joined: Thu Jun 07, 2018 12:08 am

Re: 2d rpg

Post by tony_lance »

I'm having trouble showing the player responses as a speech bubble. I don't want to give the player a choice of what to say (at least so far) I just want to put words in her mouth and have them show up in the same style as the NPCs. Is that a simple change?
User avatar
Tony Li
Posts: 22058
Joined: Thu Jul 18, 2013 1:27 pm

Re: 2d rpg

Post by Tony Li »

You can set up the player the same way -- add a Dialogue Actor, assign your bubble subtitle panel prefab, and make sure the Actor dropdown is set to the player.
tony_lance
Posts: 14
Joined: Thu Jun 07, 2018 12:08 am

Re: 2d rpg

Post by tony_lance »

Sorry I should have mentioned what I've tried.. I have it set up the way you describe but when it comes time for the player to speak the game shows the (standard dialogue ui?) bar at the bottom of the screen with the one option selectable with the mouse.

One more question! I have the Unity UI Typewriter Effect on the bubble text object. That works fine, but once I use the continue button the subsequent dialogue bubbles don't use the typewriter effect. I'd like to have it so that pressing continue skips to the end of the typewriter effect, or if it's already finished then move on to the next bit of dialogue.
Post Reply