Email Validation and Trigger different variants of OnScreen Keyboard for Mobile
-
- Posts: 42
- Joined: Sun Jul 26, 2020 3:51 pm
Email Validation and Trigger different variants of OnScreen Keyboard for Mobile
Hello!
Dialogue System is a great tool, which provides a lot of functionality!
I'm relatively new to Dialogue System, and a beginner programmer!
I came across a situation, where I require User Input, at certain instances of an ongoing conversation!
I have used "TextField" at certain instances in the conversation, and when I use it for mobile platform, the default alpha-numeric variant of OnScreen Keyboard does pop-up, when TextField is triggered.
That works fine for instances where like I am asking user to provide their First Name and Last Name, where only Text Input is required.
How could I validate the Input provided by user, at that instance itself? For example: I require a condition where First Name has to be a minimum of 3 characters and it cannot include numbers or any other special characters. The user cannot progress ahead unless proper input is provided. Same applies with Last Name, where it cannot include numbers or special characters & cannot proceed ahead, unless proper input is provided! Is there any way by which I could do that?
Also, some of the other attributes which I require from user, are email and mobile number. Is there any way by which I could trigger the email variant of OnScreen Keyboard, when TextField for email is triggered, and trigger the Numpad variant of OnScreen keyboard, when TextField for Mobile Number is triggered?
Also, I wanted to know if there's any way by which I could validate email address provided by user [using Regex maybe]. Like, the user cannot proceed ahead, unless proper email is provided.
Apart from that, I also require user to provide their Birth Date. Is there any proper way, by which we could provide a date-picker at certain instance in the conversation, similar to that of providing TextField?
Any help would be much appreciated!
Kind Regards,
Bhavin
Dialogue System is a great tool, which provides a lot of functionality!
I'm relatively new to Dialogue System, and a beginner programmer!
I came across a situation, where I require User Input, at certain instances of an ongoing conversation!
I have used "TextField" at certain instances in the conversation, and when I use it for mobile platform, the default alpha-numeric variant of OnScreen Keyboard does pop-up, when TextField is triggered.
That works fine for instances where like I am asking user to provide their First Name and Last Name, where only Text Input is required.
How could I validate the Input provided by user, at that instance itself? For example: I require a condition where First Name has to be a minimum of 3 characters and it cannot include numbers or any other special characters. The user cannot progress ahead unless proper input is provided. Same applies with Last Name, where it cannot include numbers or special characters & cannot proceed ahead, unless proper input is provided! Is there any way by which I could do that?
Also, some of the other attributes which I require from user, are email and mobile number. Is there any way by which I could trigger the email variant of OnScreen Keyboard, when TextField for email is triggered, and trigger the Numpad variant of OnScreen keyboard, when TextField for Mobile Number is triggered?
Also, I wanted to know if there's any way by which I could validate email address provided by user [using Regex maybe]. Like, the user cannot proceed ahead, unless proper email is provided.
Apart from that, I also require user to provide their Birth Date. Is there any proper way, by which we could provide a date-picker at certain instance in the conversation, similar to that of providing TextField?
Any help would be much appreciated!
Kind Regards,
Bhavin
Re: Email Validation and Trigger different variants of OnScreen Keyboard for Mobile
Hi Bhavin,
Those features require some scripting, but they're supported with a little scripting.
The example dialogue UI prefabs that are included with the Dialogue System all have a single Text Field UI named "Text Field UI".
You can create additional additional copies and customize the Input Field component to allow different types of input such as numbers. For example, to create a password input field, duplicate Text Field UI and name it "Password Field UI". Inspect the InputField child GameObject, and set Content Type to Password. Then use "Password Field UI" in your TextInput() sequencer command, such as:
If you need to further validate input, write a script to validate the input and assign its method to the InputField's OnValueChanged event. You can make your script a subclass of StandardUIInputField if you want to override some of its methods -- for example, to prevent it from accepting input unless certain conditions are met.
For date pickers, you will have to do something different. You can use a date picker UI asset from the Asset Store or write your own. Then write a custom sequencer command to use it.
Those features require some scripting, but they're supported with a little scripting.
The example dialogue UI prefabs that are included with the Dialogue System all have a single Text Field UI named "Text Field UI".
You can create additional additional copies and customize the Input Field component to allow different types of input such as numbers. For example, to create a password input field, duplicate Text Field UI and name it "Password Field UI". Inspect the InputField child GameObject, and set Content Type to Password. Then use "Password Field UI" in your TextInput() sequencer command, such as:
Code: Select all
TextInput(Password Field UI, Password:, password)
For date pickers, you will have to do something different. You can use a date picker UI asset from the Asset Store or write your own. Then write a custom sequencer command to use it.
-
- Posts: 42
- Joined: Sun Jul 26, 2020 3:51 pm
Re: Email Validation and Trigger different variants of OnScreen Keyboard for Mobile
Thank you very much Tony.
I would surely try and apply what you've suggested!
Your help is much appreciated.
I would surely try and apply what you've suggested!
Your help is much appreciated.
-
- Posts: 42
- Joined: Sun Jul 26, 2020 3:51 pm
Re: Email Validation and Trigger different variants of OnScreen Keyboard for Mobile
Your help is much appreciated Tony!
Thanks a ton!
And I recently came across a situation, where I need continue button after dialogue subtitles are displayed!
Currently, I have set "Dialogue System Prefab > Subtitle Settings > Continue Button" to "Never". And I am triggering the "Continue Button" manually, in the conversation using "SetContinueMode(true)" command in the Sequence attribute of Dialogue Entry Editor, at places where I require continue button.
That is working perfectly, except for the fact that my continue button is available since beginning of subtitle. What I want, is the subtitle of NPC to be completed and then when the dialogue is finished, I require continue button.
Is there any way by which I could delay the appearance of continue button, till the dialogue is completed?
Thanks a ton!
And I recently came across a situation, where I need continue button after dialogue subtitles are displayed!
Currently, I have set "Dialogue System Prefab > Subtitle Settings > Continue Button" to "Never". And I am triggering the "Continue Button" manually, in the conversation using "SetContinueMode(true)" command in the Sequence attribute of Dialogue Entry Editor, at places where I require continue button.
That is working perfectly, except for the fact that my continue button is available since beginning of subtitle. What I want, is the subtitle of NPC to be completed and then when the dialogue is finished, I require continue button.
Is there any way by which I could delay the appearance of continue button, till the dialogue is completed?
Re: Email Validation and Trigger different variants of OnScreen Keyboard for Mobile
To wait until the text has finished typing:
If you're playing audio and you want to wait until the audio has finished, example:
Code: Select all
SetContinueMode(true)@Message(Typed)
Code: Select all
AudioWait(entrytag)->Message(Done);
SetContinueMode(true)@Message(Done)
-
- Posts: 42
- Joined: Sun Jul 26, 2020 3:51 pm
Re: Email Validation and Trigger different variants of OnScreen Keyboard for Mobile
Thank you for sharing the instructions!
I did try that out, by replacing the regular "SetContinueMode(true)" command with "SetContinueMode(true)@Message(Typed)".
But that only worked once, at the beginning of the conversation. After that, the continue button was always active beforehand, at instances where I had given the continue button commands!
Though, I almost require continue button after completion of each NPC dialogue.
In that scenario, I guess setting "Dialogue Manager > Dialogue Controller > Display Settings > Continue Button to Always" might be more appropriate. In case if I proceed with that, is there any way by which we could give a default setting for continue button to appear after message has been typed, ALWAYS?
I did try that out, by replacing the regular "SetContinueMode(true)" command with "SetContinueMode(true)@Message(Typed)".
But that only worked once, at the beginning of the conversation. After that, the continue button was always active beforehand, at instances where I had given the continue button commands!
Though, I almost require continue button after completion of each NPC dialogue.
In that scenario, I guess setting "Dialogue Manager > Dialogue Controller > Display Settings > Continue Button to Always" might be more appropriate. In case if I proceed with that, is there any way by which we could give a default setting for continue button to appear after message has been typed, ALWAYS?
Re: Email Validation and Trigger different variants of OnScreen Keyboard for Mobile
Hi,
In that case, configure the typewriter effect's OnCharacter() event to deactivate the continue button GameObject and OnEnd() to activate it.
Alternatively, you can set the Default Sequence to:
In that case, configure the typewriter effect's OnCharacter() event to deactivate the continue button GameObject and OnEnd() to activate it.
Alternatively, you can set the Default Sequence to:
Code: Select all
SetContinueMode(false);
SetContinueMode(true)@Message(Typed)
-
- Posts: 42
- Joined: Sun Jul 26, 2020 3:51 pm
Re: Email Validation and Trigger different variants of OnScreen Keyboard for Mobile
Thank You very much Tony!
That works like a charm.
Your help is much appreciated!
That works like a charm.
Your help is much appreciated!