Textline sounds
-
- Posts: 45
- Joined: Wed Jan 09, 2019 7:49 am
Textline sounds
Hi,
How can I play sounds when receiving and sending texts in the Textline Package? I noticed that in the sample scene "3 Gameplay", an audio source is attached to the Player and the NPC when playing the game, but I can't find the script that does that.
Thanks!
How can I play sounds when receiving and sending texts in the Textline Package? I noticed that in the sample scene "3 Gameplay", an audio source is attached to the Player and the NPC when playing the game, but I can't find the script that does that.
Thanks!
Re: Textline sounds
Hi,
It uses the Dialogue System's cutscene sequencer. Inspect the Dialogue Manager. Set Display Settings > Camera & Cutscene Settings > Default Sequence for when the NPC sends a text. Set Default Player Sequence for when the player sends a text.
The initial value of Default Sequence is: Audio(ReceiveText)
This plays the audio clip named "ReceiveText" located in a Resources folder. (It's in Assets / Dialogue System Extras / Textline / Data / Resources.) You can replace this audio clip or add a new one and update the Default Sequence.
(Side note: Technically you can use asset bundles instead of a Resources folder. But since the audio clip is generally a small file, it would be way too much hassle for no benefit.)
It uses the Dialogue System's cutscene sequencer. Inspect the Dialogue Manager. Set Display Settings > Camera & Cutscene Settings > Default Sequence for when the NPC sends a text. Set Default Player Sequence for when the player sends a text.
The initial value of Default Sequence is: Audio(ReceiveText)
This plays the audio clip named "ReceiveText" located in a Resources folder. (It's in Assets / Dialogue System Extras / Textline / Data / Resources.) You can replace this audio clip or add a new one and update the Default Sequence.
(Side note: Technically you can use asset bundles instead of a Resources folder. But since the audio clip is generally a small file, it would be way too much hassle for no benefit.)
-
- Posts: 45
- Joined: Wed Jan 09, 2019 7:49 am
Re: Textline sounds
I see, thank you. I've got three issues with this:
1) I'm using a pre delay of 2 seconds for the NPC subtitle lines to be played, with the "NPC PreDelay Icon" of the textline package.
If I just write "Audio(ReceiveText)" it plays the sound immediately when the pre delay icon appears ; so I wrote "Audio(ReceiveText) @2". Is there a way to ask to wait for the message to be actually sent to play the sound?
2) I have multiple conversations in one scene, so I'm using OnRecordPersistentData() and OnApplyPersistentData() to switch between them. Whenever I open a conversation, it plays the sequence of the last entry in the record. So I have a sound whenever I open a conversation.
3) It never plays the audio clip on the last entry of the conversation, wether it's from the PC or the NPC.
1) I'm using a pre delay of 2 seconds for the NPC subtitle lines to be played, with the "NPC PreDelay Icon" of the textline package.
If I just write "Audio(ReceiveText)" it plays the sound immediately when the pre delay icon appears ; so I wrote "Audio(ReceiveText) @2". Is there a way to ask to wait for the message to be actually sent to play the sound?
2) I have multiple conversations in one scene, so I'm using OnRecordPersistentData() and OnApplyPersistentData() to switch between them. Whenever I open a conversation, it plays the sequence of the last entry in the record. So I have a sound whenever I open a conversation.
3) It never plays the audio clip on the last entry of the conversation, wether it's from the PC or the NPC.
Re: Textline sounds
Hi,
Textline is getting some updates soon. In the meantime, you can download this interim update: Textline_2019-03-06.unitypackage
If you've customized some of the files, you really only need to import TextlineDialogueUI.cs. This way you won't lose your customizations.
Temporarily set the Dialogue Manager's Debug Level to Info. Play through, and verify that it runs the last entry's Sequence. BTW, in the example conversation, the last entry's Sequence doesn't play audio; it returns to the main menu.
Textline is getting some updates soon. In the meantime, you can download this interim update: Textline_2019-03-06.unitypackage
If you've customized some of the files, you really only need to import TextlineDialogueUI.cs. This way you won't lose your customizations.
The update now sends a sequencer message "Received" when an NPC subtitle actually plays, and "Sent" when a PC subtitle plays. After importing the update, change the Dialogue Manager's Default Sequence to:Tetralogia wrote: ↑Wed Mar 06, 2019 7:43 am1) I'm using a pre delay of 2 seconds for the NPC subtitle lines to be played, with the "NPC PreDelay Icon" of the textline package.
If I just write "Audio(ReceiveText)" it plays the sound immediately when the pre delay icon appears ; so I wrote "Audio(ReceiveText) @2". Is there a way to ask to wait for the message to be actually sent to play the sound?
Code: Select all
Audio(ReceiveText)@Message(Received)
Set the TextlineDialogueUI's dontRepeatLastSequence before OnApplyPersistentData(). Example:Tetralogia wrote: ↑Wed Mar 06, 2019 7:43 am2) I have multiple conversations in one scene, so I'm using OnRecordPersistentData() and OnApplyPersistentData() to switch between them. Whenever I open a conversation, it plays the sequence of the last entry in the record. So I have a sound whenever I open a conversation.
Code: Select all
var ui = FindObjectOfType<TextlineDialogueUI>();
ui.dontRepeatLastSequence = true;
ui.OnApplyPersistentData();
Is this in a regular conversation playthrough, or when loading an old conversation that has ended?Tetralogia wrote: ↑Wed Mar 06, 2019 7:43 am3) It never plays the audio clip on the last entry of the conversation, wether it's from the PC or the NPC.
Temporarily set the Dialogue Manager's Debug Level to Info. Play through, and verify that it runs the last entry's Sequence. BTW, in the example conversation, the last entry's Sequence doesn't play audio; it returns to the main menu.
-
- Posts: 45
- Joined: Wed Jan 09, 2019 7:49 am
Re: Textline sounds
Perfect, thanks!The update now sends a sequencer message "Received" when an NPC subtitle actually plays, and "Sent" when a PC subtitle plays. After importing the update, change the Dialogue Manager's Default Sequence to:Code: Select all
Audio(ReceiveText)@Message(Received)
If I do that, the last message just straight up disappears when I open/re-open the conversation.Set the TextlineDialogueUI's dontRepeatLastSequence before OnApplyPersistentData(). Example:Code: Select all
var ui = FindObjectOfType<TextlineDialogueUI>(); ui.dontRepeatLastSequence = true; ui.OnApplyPersistentData();
It's in a regular playthrough. I think I know why that's so: the last entries of my conversations have the sequence WaitForMessage(Forever) so it doesn't close the conversation when all the nodes have been played:Is this in a regular conversation playthrough, or when loading an old conversation that has ended?
Code: Select all
Dialogue System: J says 'Let me know :)'
Dialogue System: Sequencer.Play( WaitForMessage(Forever)@0 )
Dialogue System: Sequencer: WaitForMessage(Forever)
Re: Textline sounds
What shows up in the Console if you temporarily set the Dialogue Manager's Debug Level to Info first?Tetralogia wrote: ↑Wed Mar 06, 2019 10:12 amIf I do that, the last message just straight up disappears when I open/re-open the conversation.Set the TextlineDialogueUI's dontRepeatLastSequence before OnApplyPersistentData(). Example:Code: Select all
var ui = FindObjectOfType<TextlineDialogueUI>(); ui.dontRepeatLastSequence = true; ui.OnApplyPersistentData();
Set the Sequence to:Tetralogia wrote: ↑Wed Mar 06, 2019 10:12 amI think I know why that's so: the last entries of my conversations have the sequence WaitForMessage(Forever) so it doesn't close the conversation when all the nodes have been played:
Code: Select all
Dialogue System: J says 'Let me know :)' Dialogue System: Sequencer.Play( WaitForMessage(Forever)@0 ) Dialogue System: Sequencer: WaitForMessage(Forever)
Code: Select all
{{default}}; WaitForMessage(Forever)
-
- Posts: 45
- Joined: Wed Jan 09, 2019 7:49 am
Re: Textline sounds
What shows up in the Console if you temporarily set the Dialogue Manager's Debug Level to Info first?
Code: Select all
TextlineDialogueUI.OnApplyPersistentData: Restoring current conversation from DialogueEntryRecords_J: 3;1;46;1;47;1;3
Resuming 'J' at entry 3
Dialogue System: Ending conversation.
Dialogue System: Starting conversation 'J', actor=Player (UnityEngine.Transform), conversant=J (UnityEngine.Transform).
Dialogue System: Add Link (Player): ID=1:5 'Hey!' (True)
Dialogue System: J says 'Hi :)'
Dialogue System: Sequencer.Play( None()@0 )
It's working, thanks!Set the Sequence to:
Code: Select all
{{default}}; WaitForMessage(Forever)