UFPS/ any username uses the Dialogue system

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
r3vivo
Posts: 3
Joined: Sat Feb 13, 2016 9:48 pm

UFPS/ any username uses the Dialogue system

Post by r3vivo »

Hello ! :)

I would like to create an AI ,with who the Player can talk and I will probably use Text to speech (but it is not so important)
My question,
Is that possible to create the AI will be able to use the USERNAME ( what the player random choose for himself) in the dialogue?

I would like to create somehow in the script " %USERNAME%, how are you today?"
I try to avoid /solve , I will must write same sentences with many different name .
I hope clear what would I like to do , if it is not let me know :)
I am glad for any help
Thank You !
Cheers :)
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: UFPS/ any username uses the Dialogue system

Post by Tony Li »

Hi,

Yes, use the [var=variableName] markup tag:
  • Dialogue Text: "[var=USERNAME], how are you today?"
You can set the variable "USERNAME" in your own C# code, PlayMaker action, etc., or using the TextInput() sequencer command during a conversation:
  • Dialogue Text: "What is your name?"
  • Sequence: TextInput(TextFieldUI, Name, USERNAME)[/b]
r3vivo
Posts: 3
Joined: Sat Feb 13, 2016 9:48 pm

Re: UFPS/ any username uses the Dialogue system

Post by r3vivo »

Hi ,
Thank you for the response :)

Is there any tutorial how to add audio or voice to the dialogue text ? I have searched a lot but I did not find anything.
Or Can not I add voice/audio files to my dialogues?
Thanks for any help
Cheers :)
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: UFPS/ any username uses the Dialogue system

Post by Tony Li »

Hi,

Yes, you can add voice/audio files to your dialogues. If you just want to play audio without lipsync animation, here are the basic steps:

1. Record the audio files.

2. Create a folder named "Resources" anywhere in your project, and put the audio files in the folder. You can use subfolders. For example:

Code: Select all

Assets/
    _MyGame/
        Resources/
            Lincoln/
                four_score_etc
            McClellan/
                vote_for_me
(Side note: The Dialogue System supports using asset bundles in addition to Resources folders.)

3. In your dialogue entry, add an AudioWait() sequencer command to the Sequence field to play the audio clip:
  • Dialogue Text: "Four score and seven years ago..."
  • Sequence: AudioWait(Lincoln/four_score_etc)
Notes:
  • AudioWait() waits for the audio to finish playing before progressing to the next dialogue entry. Audio() starts playback and immediately progresses to the next entry.
  • You can see that it would be tedious to manually add each AudioWait() command. Once you get the hang of using sequences, you can read about How to Use Entrytags to simplify the process.
If you don't have prerecorded audio, you can use a product like RT-Voice to play synthesized voices using your OS's robotic-sounding voice synthesizer features. (See RT-Voice Support.)


If you want to play lipsync animation that moves the NPC's mouth in time with the words, you have several options. The Dialogue System is not a lipsync tool. Instead, it provides support for other lipsync plugins that you can get on the Unity Asset Store and elsewhere. The easiest plugin in my opinion is SALSA (see SALSA Support). Rogo LipSync is also an excellent lipsync product. It requires an additional setup step, but the mouth motions are slightly more realistic. (See LipSync Support.)

See How To Add Lipsync for a general overview of using lipsync in the Dialogue System with various products.
r3vivo
Posts: 3
Joined: Sat Feb 13, 2016 9:48 pm

Re: UFPS/ any username uses the Dialogue system

Post by r3vivo »

THank You so much for the detailed description :) It helps a lot :)
I would like to use Text to speech robotic svoice for AI
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: UFPS/ any username uses the Dialogue system

Post by Tony Li »

RT-Voice is a good choice for that. After you buy RT-Voice and import it into your project, import the RT-Voice Support package in the Dialogue System's Third Party Support folder. It contains an example scene.
Post Reply