Text Input

Announcements, support questions, and discussion for the Dialogue System.
MathBlade
Posts: 12
Joined: Sun Jul 15, 2018 12:32 pm

Text Input

Post by MathBlade »

Good morning,

I know you're patiently at work on some stuff this weekend, and I apologize if this was asked somewhere else.

I'm attempting to do something like have a dialogue window that would have a text field with a Up Down arrow
OR
a text field with a user entered field that I could validate is a number between a given range.

However, with the new system I cannot seem to figure out how to do text input. I've tried using
TextInput(TextFieldUI,Rank,rank) under the Sequence field {{format borrowed from the demo}} with the latter being the variable attached to the text field in the conversation.

However when the conversation runs, it stays a button instead of having header text and then the text box. Do you have any recommendations for what I am doing wrong? I'm pretty sure it's something simple but I didn't see a video on it or another sample I could look at.

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

Re: Text Input

Post by Tony Li »

Hi,

Thanks for bringing this to my attention. In many of the dialogue UI prefabs, the input field's Rect Transforms could use a little tweaking to make them visible. I added some last minute layout groups that I thought would be helpful, and they ended up collapsing the size of the input field to zero. I'll fix this in the next release.

In the meantime, if you're using the Basic Standard Dialogue UI, inspect Dialogue Panel > Text Field UI > Text Field Panel > InputField. Add a Layout Element component. Tick Min Width and Min Height. Set Min Height to 30. Set Min Width to an acceptable width for your input, such as 100. If you're using a different dialogue UI, you can adjust it similarly.

Since you're reading numbers, you can change the Input Field component's Content Type to Integer Number.

When you use the TextInput() sequencer command, make sure the first parameter ("Text Field UI") matches the name of the text field UI GameObject exactly, including blank spaces and capitalization.
MathBlade
Posts: 12
Joined: Sun Jul 15, 2018 12:32 pm

Re: Text Input

Post by MathBlade »

You're welcome!

I appreciate your fast response! I figured out the getting the box to show up, and how to make a custom text interface. I have a feeling I'm doing something the system wasn't designed to do. I've attached a screenshot that may help to explain my question a bit better.
TransformationTrinitySkillSmall.png
TransformationTrinitySkillSmall.png (186.31 KiB) Viewed 2107 times
In general it seems that text input fields (the default with text or my own custom updown arrows) that stack on each other
OR I can have buttons that vertically stack.

Regardless of which option I go with, it seems the "continue" button always defaults to the top instead of the bottom.

What I'm going for is to have a mass amount of input on a single screen and a continue button, then a "None()" step so that way I can process that info with whatever booleans/conditions are appropriate, and if they mess something up in a way my validators do not catch, send them back to the skills page.
User avatar
Tony Li
Posts: 22058
Joined: Thu Jul 18, 2013 1:27 pm

Re: Text Input

Post by Tony Li »

Hi,

For these nodes:
  • "Choose your skill ranks"
  • "Skill Name 1MT"
  • "Skill Name 2MT"
1. What actors are assigned as the node's Actor and Conversant?

2. What is in the Sequence field (if anything)?

3. What is in the Script field (if anything)?
MathBlade wrote: Sun Jul 15, 2018 4:17 pmIn general it seems that text input fields (the default with text or my own custom updown arrows) that stack on each other
OR I can have buttons that vertically stack.
That's correct. In the Dialogue System, the buttons that vertically stack are called the response menu. A conversation can be in one of two states: showing a subtitle, or showing a response menu. A subtitle stays onscreen as long as its node's sequence lasts. If the node's Sequence field is set to Delay(5), then the subtitle will stay onscreen for 5 seconds*. The exception is if you've set the Dialogue Manager to use a continue button mode. In this case, the dialogue UI shows the continue button, and the subtitle continues to stay onscreen (even after the sequence ends) until the player clicks the continue button**.

* If the player presses the cancel input or continue button before 5 seconds, the subtitle will end early.

** You can simulate a continue button click in the Sequence field by using the Continue() command.

MathBlade wrote: Sun Jul 15, 2018 4:17 pmRegardless of which option I go with, it seems the "continue" button always defaults to the top instead of the bottom.
Sorry, more questions:

Are you using a dialogue UI where the NPC subtitle panel is at the top and the player subtitle panel is at the bottom (such as the Basic Standard Dialogue UI)?

When you inspect the Dialogue Manager, what are the values of Display Settings > Subtitle Settings > Show PC Subtitles During Line? Skip PC Subtitle After Response Menu? Continue Button dropdown?

If the Dialogue Manager isn't configured to show PC subtitles, then it won't show the subtitle panel or its continue button at the bottom. Also, if the Continue Button dropdown is set to a value that specifies to omit the continue button for player subtitles, it won't show the continue button.
MathBlade
Posts: 12
Joined: Sun Jul 15, 2018 12:32 pm

Re: Text Input

Post by MathBlade »

1.
A: "Choose your skill ranks" = Actor is Character Creation, Conversant is Player.
B1: Skill 1MT/Skill2 MT are both set to : Actor is Player, Conversant is Character Creation the result is two clickable buttons with the text displaying Skill 1MT and Skill2MT respectively, with the Sequence set to

Code: Select all

TextInput(Incrementer UI,Skill Name 1,rank1)
and

Code: Select all

TextInput(Incrementer UI,Skill Name 2,rank2)
respectively
B2: Skill 1MT/Skill2 MT are both set to : Actor is Character Creation, Conversant is Player, and Sequence texts as above the result seems to be two custom Incrementer UI objects spawn in the same place, one overlapping the other. (I say seems to be as it doesn't show either in the GameObject listing in debug mode unless I missed it. There aren't any errors)

What I would like is for a lot of response menu items that are not limited to just buttons and then just have the user click the "continue" button when done setting all of them.

2-3) "Choose your skill ranks" << There is no sequence set here and nothing in the script field.
2-3) ""Skill Name 1MT/2MT" << There is a sequence set as described above. Nothing in the script field. However, I may end up putting things in the script field once I get the core architecture going.

-----------------------------------------------

Continue command answers
I am using the dialogue manager that is in the prefabs folder. Inside of the object called "My Dialogue UI" there is an object called "Dialogue Panel" inside of that without removing any default items, I have made my own Incrementer UI that has a Label called Label (so that it can inherit from what gets put in Sequence) and then a Text field for value and two UI buttons that are ^ and V respectively, without the written functionality yet.

When you inspect the Dialogue Manager, what are the values of Display Settings > Subtitle Settings > Show PC Subtitles During Line?
((I have tried checked and unchecked))


Skip PC Subtitle After Response Menu?
((Always unchecked, when checked sometimes it shows the Continue button on the response afterward, but not on the original menu. ))


Continue Button dropdown?

((I have tried Never and Optional. If I set the sequence and response menu to have SetContinueMode(true); then it says "Always" on this step. ))

---------------------

If it helps here is a screenshot of what is going on in debug mode for Unity for the following

Skill 1MT/Skill2 MT are both set to : Actor is Character Creation, Conversant is Player, and Sequence texts as above the result seems to be two custom Incrementer UI objects spawn in the same place, one overlapping the other. (I say seems to be as it doesn't show either in the GameObject listing in debug mode unless I missed it. There aren't any errors)

And both Sequence and Response Menu Sequence are set to show the Continue Button.
Question Two.png
Question Two.png (245.32 KiB) Viewed 2102 times
Mainly I'd love to have my own customizable response menu that doesn't always necessarily have to be vertical buttons and that I force the user to press "Continue" or whatever I set the text to be.
MathBlade
Posts: 12
Joined: Sun Jul 15, 2018 12:32 pm

Re: Text Input

Post by MathBlade »

Here's the screenshot if I only swap the conversant and the player.

It's closer but not quite what's desired.
Question TwoB.png
Question TwoB.png (95.72 KiB) Viewed 2102 times
User avatar
Tony Li
Posts: 22058
Joined: Thu Jul 18, 2013 1:27 pm

Re: Text Input

Post by Tony Li »

Thanks for the details! I'll check this out and reply back as soon as I can. My dogs are dragging me away to feed them. :-)
MathBlade
Posts: 12
Joined: Sun Jul 15, 2018 12:32 pm

Re: Text Input

Post by MathBlade »

You're welcome. Assuming what I'd like to do is possible (this again if it's not then I would just need to spawn the items through script and "hackify" it. ) Then I can send you a "incrementer UI" that I think would mesh well with your current system so that way it's not always just TextInput. I'd rather not just "hack" the system if what I want to do is possible out of the box and I am just missing something.
User avatar
Tony Li
Posts: 22058
Joined: Thu Jul 18, 2013 1:27 pm

Re: Text Input

Post by Tony Li »

Can you post a screenshot of your Dialogue System Trigger, or however you're starting the conversation? Also, if you click on blank canvas space in the Dialogue Editor to view the conversation's properties, which actors are assigned as the conversation's Actor and Conversant? I want to make sure that the "NPC" (CharacterCreation) that's set on the trigger lines up with the actor that's assigned to the conversation (e.g., both assigned to Conversant and not Actor).

It may be better to have the incrementers as a separate subpanel. If that works for you, then there's no need to post screenshots.

First I'll try to explain what's going on with the current setup:

When the conversation is on a node (let's say the "Wizard" node), it makes a list of all linked nodes -- in this case, just "Choose your skill ranks". If the list contains any NPC nodes (gray), it shows the first one as an NPC subtitle. If the list contains only Player nodes (blue), it always shows them as a response menu*. "Choose your skill ranks" links to two Player nodes. So it will always show them as a response menu -- or at least it should, as in the last screenshot where you swapped the conversant and player.

* If you've unticked the Dialogue Manager's Always Force Response Menu checkbox and there's only one Player node, or if one of the nodes has the [auto] tag, it will bypass the response menu and show that node.

When you click on a response menu button, it will hide the response menu and play the node's Sequence. The continue button is tied to the subtitle panel. Since player subtitles are turned off, the continue button won't appear either.


Instead of this, what if you create a skill panel in the dialogue UI? (It doesn't actually have to be in the dialogue UI, but that seems like a good place to put it.) Let's say you call it SkillPanel. Leave it inactive at design time. Set the Sequence for "Choose your skill ranks" to:

Code: Select all

SetActive(SkillPanel);
required SetActive(SkillPanel,false)@99999
The first command will show the skill panel. The second command will hide the skill panel after 99999 seconds (essentially forever) -- but the "required" keyword guarantees that it will run when the player clicks the NPC Subtitle Panel's continue button.

Add all your incrementer UIs to the skill panel and arrange them however you like.
MathBlade
Posts: 12
Joined: Sun Jul 15, 2018 12:32 pm

Re: Text Input

Post by MathBlade »

Sorry for the late reply Tony.

So far it looks like the core idea will work. I'm working on the panel now, mainly the biggest struggle I am having right now is with the second command, the one starting "required". I'm going to try to clean up my code today and tomorrow so that way I can show you a super clean version. (Right now my UI is atrocious) but the main problem is with the second line the panel never shows up but with the first line it does. There is no warning or error in the console either. I'm hoping it's an error with my visual layout "code".
Post Reply