Player Name Input Field issues

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
katubug
Posts: 6
Joined: Wed Feb 01, 2023 9:11 am

Player Name Input Field issues

Post by katubug »

Hi! I have a few issues with some dialogue I'm working on. I want the player to input their player name, and then display the name to confirm it. I am following this post: https://www.pixelcrushers.com/phpbb/vie ... f=3&t=6338

1) The first issue is that the text input field is visible at all times, even before it's meant to be: vs

Here's how it's set up:

2) I can't seem to change the Actor's name to the playerName variable. Here is how the dialogue is set: and here is the variable I created:

When I play through the dialogue, it *sometimes* works if I use [var=playerName] instead of [var=Actor], but that's not what the guide says to do, and it doesn't always seem to work. I'm not sure why.

3) I want the continue button to appear BEFORE the player is prompted for a response, but not DURING the response. Because when that happens, it looks like this:

And the player can hit "Continue" which seems like it doesn't save the name variable, since you're supposed to hit enter? But it's hard to tell because I'm having trouble getting the variable to work properly at all.

I'm sure I'm doing a million things wrong, and would really appreciate the help. Thanks!
User avatar
Tony Li
Posts: 21954
Joined: Thu Jul 18, 2013 1:27 pm

Re: Player Name Input Field issues

Post by Tony Li »

Hi,

> 1) The first issue is that the text input field is visible at all times, even before it's meant to be:

Make "InputField (TMP)" a child of InputFieldPanel. Then deactivate InputFieldPanel. The Text Field UI GameObject's StandardUIInputField component will activate it as needed.


> 2) I can't seem to change the Actor's name to the playerName variable. Here is how the dialogue is set: and here is the variable I created:

Move the Script field's content to the next node (the "My name is [var=Actor]!") node. And, in this one case only, use "My name is [var=playerName]!" This is because the Actor variable gets set at the beginning of the conversation. Alternatively, you can include this line in your Script field: (the second line)

Code: Select all

ChangeActorName("Player", Variable["playerName"])
Variable["Actor"] = Variable["playerName"]

> 3) I want the continue button to appear BEFORE the player is prompted for a response, but not DURING the response.

Try splitting it up into two nodes. In the first node, just have the text ("If you're Wren, then..."). In the second node (a new node), have no text, but use the TextInput() command in the Sequence field. And in the third node ("My name is..."), use the Script field.
katubug
Posts: 6
Joined: Wed Feb 01, 2023 9:11 am

Re: Player Name Input Field issues

Post by katubug »

Hi, thank you!

1) That worked! Thank you.

2) This is now sort of working. Here's the setup:
- the prompt configuration
- the confirmation configuration

But when I play it, it does this:
- prompting
- the prompt result
- the confirmation result

I guess that the initial "my name is ____" option is loading before the variable is properly set, and it's using the default value (Katu). But I'm not sure how to fix it.

3) As you can see above, and also here:

The Continue button is still shown even though I put in an empty buffer as you suggested. Instead, I get a blank prompt. Here's a video of how it plays out:

After some thought, it's not too bad if the Continue button shows up in that situation, as long as it also saves (and validates - once this is working I want to make sure it won't take blank input) the input value. Right now, hitting enter confirms the input AND continues the dialogue, which is perfectly fine by me.

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

Re: Player Name Input Field issues

Post by Tony Li »

Here's an example scene:

DS_KatubugInputNameExample_2023-02-06.unitypackage

On the Dialogue Manager, in the Subtitle Settings section I ticked Show PC Subtitles During Line, unticked Skip PC Subtitle After Response Menu, and set Continue Button to Always.

In the Input Settings section, I unticked Always Force Response Menu.

In the "If you're Wren, then yes! I'm..." node, I set the Sequence to:

Code: Select all

SetContinueMode(false);
TextInput(Text Field UI, Your Name:, playerName, 50, clear)
The first line is equivalent to setting the Dialogue Manager's Subtitle Settings > Continue Button to Never. The second line inputs the player's name.

In the next node, I set the Sequence to:

Code: Select all

SetContinueMode(true);
{{default}}
This sets the Continue Button back to Always and also plays the Dialogue Manager's Camera & Cutscene Settings > Default Sequence. I also set the Script to:

Code: Select all

Variable["Actor"] = Variable["playerName"];
ChangeActorName("Player", Variable["playerName"])
If this example scene works the way you want, you can compare its configuration to your own current setup.
katubug
Posts: 6
Joined: Wed Feb 01, 2023 9:11 am

Re: Player Name Input Field issues

Post by katubug »

Hello! Sorry for my delay in responding. This is perfect, I think I will need to brush up on the documentation more, as I didn't know about the sequence options you mentioned. Those were the missing piece! Thanks again! :)
User avatar
Tony Li
Posts: 21954
Joined: Thu Jul 18, 2013 1:27 pm

Re: Player Name Input Field issues

Post by Tony Li »

Glad to help!
Post Reply