Response Button space too short

Announcements, support questions, and discussion for the Dialogue System.
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Response Button space too short

Post by mandi »

I have this problem. My PC character speaks a lot (his quite talkative), and the space offered by Response Buttons is often too short to show his entire response. I tried using the approach with continue button, but it's not productive for me - each line is being repeated, completely disrupting the flow of conversation. Is there a mechanism (or, at least, where to apply it) to "switch on" continue button only for those PC responses, that are longer than some arbitrary value? This is the most obvious workaround to the issue that came to my mind, I would be grateful if you had an even better idea.
Thanks in advance!
alfonso
Posts: 104
Joined: Mon Jul 13, 2015 6:31 am

Re: Response Button space too short

Post by alfonso »

Hi you can use Menu Text as a resumen of the response and the dialogue Text put all the response. in the case you have a response situation Dialogue System take the MenuText as title of the buttons and then if the player click on it show the dialogue Text as a response.

Hope work for you :)
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Response Button space too short

Post by Tony Li »

Hi,

Pardon the long response. I want to make sure you have all the info you need. (If I missed anything, let me know!)

I'll include some simple suggestions below that use the Dialogue System's built-in Unity UI system. Keep in mind that the Dialogue System is modular. The built-in Unity UI system is pretty flexible and extensible, but if you don't like the way it's designed you can always provide your own UI module. The rest of the Dialogue System -- the data model, the quest and save systems, the Lua environment -- will all work happily with any UI module that implements the handful of methods in the IDialogueUI C# interface.

That said, what you're asking for is fairly easy to do with the built-in UI.

I'm not sure whether you're talking about the text in the response buttons when the response menu is shown, or the subtitle text that's shown after the player has selected a response. I'll cover both cases.


If the buttons are too small:
As alfonso suggested above, use Menu Text. Personally, this is my preferred solution, too.

Every dialogue entry has a Menu Text field and a Dialogue Text field. Menu Text is shown in the response button menu. Dialogue Text is shown when the PC speaks the response that the player has selected. If either field is blank, the Dialogue System uses the other field. For example, if Menu Text is blank, the response button will use Dialogue Text instead.

One way to make the response buttons shorter is to use a short paraphrase for Menu Text and an expanded version for Dialogue Text. For example:
  • Menu Text: "[shrug]"
  • Dialogue Text: "[shrugs] I don't know. I just got here last night, and I've never been in this city before."
If you really need to keep the long text in the response button, try out some of the Unity UI prefabs such as Nuke and Generic. Their response buttons grow to fit the entire Menu Text. The response menu panel has a scrollbar in case the buttons are too big to all fit on the screen.


If the player response subtitle line is too small:
If the response subtitle line shows onscreen for too short a time before moving to the next stage in the conversation, inspect the Dialogue Manager. Decrease Display Settings > Subtitle Settings > Subtitle Chars Per Second. This will make the line stay on screen for longer. For example, say the line is 90 characters. If you set Subtitle Chars Per Second to 10, then the line will display for 9 seconds (90 / 10 = 9). If you need extra time in a specific dialogue entry, use the Delay() sequencer command -- for example, Delay(10) to wait 10 seconds.

To only enable the continue button for specific dialogue entries, use the SetContinueMode() sequencer command. For example, use this Sequence:

Code: Select all

SetContinueMode(true);
required SetContinueMode(false)@99999
This first command turns on the continue button at the beginning of the dialogue entry. The second command turns off the continue button just before moving to the next stage in the conversation.

If none of these suggestions help, please feel free to post follow-up questions or send an example project to tony (at) pixelcrushers.com. I'll be happy to take a look.
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Re: Response Button space too short

Post by mandi »

Alfonso, Tony,
thank you for the answers! Yes, the issue is with the button space being too short. I am very busy right now, and will let you know whether I was able to resolve the issue in about a week. Thank you again!
Best
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Re: Response Button space too short

Post by mandi »

Hello,
I have a question: Provided I want a short response in Menu Text and long one in Dialogue Text, when the full response is shown - how to enable showing it after the player pushes the response button containing the shorter version of the dialogue?
Thanks!
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Re: Response Button space too short

Post by mandi »

And a second question: do these scalable prefab UIs (Generic and Nuke) are based on the new Unity UI? I ask because I made myself a nice UI based exactly on the new Unity UI, and would love scroll and scale cababilities there.
Best!
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Response Button space too short

Post by Tony Li »

Hi,

It's automatic. The Menu Text is always shown in the button if it's assigned. The Dialogue Text is shown in the PC Subtitle Line text element; to show it, on the Dialogue Manager tick Subtitle Settings > Show PC Subtitles During Line.

The scalable prefabs are based on the new UI. You can use them as examples to add the features to your own UI.
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Re: Response Button space too short

Post by mandi »

Tony,
thanks for help!
mandi
Posts: 77
Joined: Wed Sep 16, 2015 4:05 am

Re: Response Button space too short

Post by mandi »

Hello,
I have a problem adjusting Generic UI Dialogue Panel to my earlier, working panel (where I had 3 response buttons instead of a scroll rect with a template button). Namely, I had recreated all components from the Generic UI on my own, and linked all gameobjects to proper fields in UnityUIDialogueUI component, still when I run the game and enter a dialog, there is no button shown, and there is an error "Dialogue System: In ShowResponses(): Object reference not set to an instance of an object
UnityEngine.Debug:LogError(Object)" . Certainly I am missing something. The Response Panel root is not being activated when it should.

Thank you in advance,

PS. In the example scene, the Generic UI works fine.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Response Button space too short

Post by Tony Li »

Hello,

In the Generic UI, a template response button is assigned to Button Template. The Scroll Content is assigned to Button Template Holder:
Image
Unassign both of these fields.

Instead:

1. Make sure your three new buttons have UnityUIResponseButton components.

2. Add your three new buttons to the Buttons list.

3. Make sure there are no empty, unassigned elements in the Buttons list.

If that doesn't help, please post a screenshot or send an example to tony (at) pixelcrushers.com.
Post Reply