questions about dialogues for textline
questions about dialogues for textline
I'm testing the texline example and it looks great! I have some questions about modifying it though:
1. How can I get the saved last sentence? I want to show the last sentence I had with a character in the lobby.
2. would it slow down if one character has a super long dialogue(say 1000 entries) would the game get slow since I assume it needs to load all sentences at the same time?
3. I noticed it currently used a waitForMessage to block the next conversation. it works for me if I send a message when money>100, it would go to the next conversation. But if the dialogue after that requests money>1000, and I finish both, then only the first one (money>100) would get the message and go to the next dialogue, but the next dialogue would not get unblocked. Is there a better way to provide a more stable system to check conditions and go to the next dialogue?
4. Similar in the above case, if I want to achieve something like "show an icon when new dialogues are triggered" or "show an icon when dialogues are not finished reading", is there a suggestion on how to achieve this?
5. Is there a way to add some entries that can be triggered between any dialogue sections? so it's like the character's dialogue is a long linear one with multiple sections that are unlocked with conditions, but there are some side-conversations that happen in between as long as the condition is met. Is there a way to like "check all side entry conditions"? And they would also show players the icon that new dialogues are available. It feels like I need a waitForMessage at the beginning of a section of dialogue?
Thanks in advance!
1. How can I get the saved last sentence? I want to show the last sentence I had with a character in the lobby.
2. would it slow down if one character has a super long dialogue(say 1000 entries) would the game get slow since I assume it needs to load all sentences at the same time?
3. I noticed it currently used a waitForMessage to block the next conversation. it works for me if I send a message when money>100, it would go to the next conversation. But if the dialogue after that requests money>1000, and I finish both, then only the first one (money>100) would get the message and go to the next dialogue, but the next dialogue would not get unblocked. Is there a better way to provide a more stable system to check conditions and go to the next dialogue?
4. Similar in the above case, if I want to achieve something like "show an icon when new dialogues are triggered" or "show an icon when dialogues are not finished reading", is there a suggestion on how to achieve this?
5. Is there a way to add some entries that can be triggered between any dialogue sections? so it's like the character's dialogue is a long linear one with multiple sections that are unlocked with conditions, but there are some side-conversations that happen in between as long as the condition is met. Is there a way to like "check all side entry conditions"? And they would also show players the icon that new dialogues are available. It feels like I need a waitForMessage at the beginning of a section of dialogue?
Thanks in advance!
Re: questions about dialogues for textline
Hi,
> 1. How can I get the saved last sentence? I want to show the last sentence I had with a character in the lobby.
If the TextlineDialogueUI's Use Conversation Variable checkbox is UNticked, the saved info is in a Dialogue System variable named "DialogueEntryRecords".
If the checkbox is ticked, then the saved info is in a variable named "DialogueEntryRecords_conversation" where conversation is the value that you set the "Conversation" variable to. (The checkbox is typically only ticked when you need to track ongoing conversations with multiple characters.)
Get the variable value, split it on the ';' character, and use the last two numbers. For example:
> 2. would it slow down if one character has a super long dialogue(say 1000 entries) would the game get slow since I assume it needs to load all sentences at the same time?
Not necessarily. You can set the TextlineDialogueUI's Max Messages to limit the number of messages that are recorded, or you can use Textline's integration for the separate EnhancedScroller asset. The integration is in the subfolder Supplemental / EnhancedScroller Support. If you use EnhancedScroller, you don't need to limit the message history.
> 3. I noticed it currently used a waitForMessage to block the next conversation. it works for me if I send a message when money>100, it would go to the next conversation. But if the dialogue after that requests money>1000, and I finish both, then only the first one (money>100) would get the message and go to the next dialogue, but the next dialogue would not get unblocked. Is there a better way to provide a more stable system to check conditions and go to the next dialogue?
Tutorial conversations often do something similar. Here's an example:
The tutorial asks the player to build a farm and then a barracks -- but if the farm was already built before starting the tutorial, it bypasses the farm task.
Assume the act of building a farm does two additional things: set a DS variable "Built Farm" true, and send a sequence message "Built Farm":
The left branch checks if the DS variable has already been set true. If so, it skips to the barracks stage.
Otherwise the conversation follows the right branch, which waits for the sequencer message.
> 4. Similar in the above case, if I want to achieve something like "show an icon when new dialogues are triggered" or "show an icon when dialogues are not finished reading", is there a suggestion on how to achieve this?
It really depends on your criteria for new dialogues / not finished reading. You could check if the last shown sentence of a conversation has any outgoing links that are currently true. To do this, you need to create a ConversationModel and evaluate the last dialogue entry's state. Example:
> 5. Is there a way to add some entries that can be triggered between any dialogue sections? so it's like the character's dialogue is a long linear one with multiple sections that are unlocked with conditions, but there are some side-conversations that happen in between as long as the condition is met. Is there a way to like "check all side entry conditions"? And they would also show players the icon that new dialogues are available. It feels like I need a waitForMessage at the beginning of a section of dialogue?
You could structure your conversation to check side conversations at certain points using Conditions.
> 1. How can I get the saved last sentence? I want to show the last sentence I had with a character in the lobby.
If the TextlineDialogueUI's Use Conversation Variable checkbox is UNticked, the saved info is in a Dialogue System variable named "DialogueEntryRecords".
If the checkbox is ticked, then the saved info is in a variable named "DialogueEntryRecords_conversation" where conversation is the value that you set the "Conversation" variable to. (The checkbox is typically only ticked when you need to track ongoing conversations with multiple characters.)
Get the variable value, split it on the ';' character, and use the last two numbers. For example:
Code: Select all
var s = DialogueLua.GetVariable("DialogueEntryRecords").asString; // Assumes Use Conversation Variable is UNticked.
string[] ints = s.Split(';');
int conversationID = Tools.StringToInt(ints[ints.Length - 2]);
int entryID = Tools.StringToInt(ints[ints.Length - 1]);
DialogueEntry entry = DialogueManager.masterDatabase.GetDialogueEntry(conversationID, entryID);
Debug.Log("Last sentence was: " + entry.DialogueText);
> 2. would it slow down if one character has a super long dialogue(say 1000 entries) would the game get slow since I assume it needs to load all sentences at the same time?
Not necessarily. You can set the TextlineDialogueUI's Max Messages to limit the number of messages that are recorded, or you can use Textline's integration for the separate EnhancedScroller asset. The integration is in the subfolder Supplemental / EnhancedScroller Support. If you use EnhancedScroller, you don't need to limit the message history.
> 3. I noticed it currently used a waitForMessage to block the next conversation. it works for me if I send a message when money>100, it would go to the next conversation. But if the dialogue after that requests money>1000, and I finish both, then only the first one (money>100) would get the message and go to the next dialogue, but the next dialogue would not get unblocked. Is there a better way to provide a more stable system to check conditions and go to the next dialogue?
Tutorial conversations often do something similar. Here's an example:
The tutorial asks the player to build a farm and then a barracks -- but if the farm was already built before starting the tutorial, it bypasses the farm task.
Assume the act of building a farm does two additional things: set a DS variable "Built Farm" true, and send a sequence message "Built Farm":
Code: Select all
void OnFarmBuilt()
{
DialogueLua.SetVariable("Built Farm", true);
Sequencer.Message("Built Farm");
}
Otherwise the conversation follows the right branch, which waits for the sequencer message.
> 4. Similar in the above case, if I want to achieve something like "show an icon when new dialogues are triggered" or "show an icon when dialogues are not finished reading", is there a suggestion on how to achieve this?
It really depends on your criteria for new dialogues / not finished reading. You could check if the last shown sentence of a conversation has any outgoing links that are currently true. To do this, you need to create a ConversationModel and evaluate the last dialogue entry's state. Example:
Code: Select all
...
Debug.Log("Last sentence was: " + entry.DialogueText);
var model = new ConversationModel(DialogueManager.masterDatabase, DialogueManager.masterDatabase.GetConversation(entry.conversationID).Title, null, null, false, null);
var state = model.GetState(entry, true, true, true);
var isThereMore = state.hasAnyResponses;
> 5. Is there a way to add some entries that can be triggered between any dialogue sections? so it's like the character's dialogue is a long linear one with multiple sections that are unlocked with conditions, but there are some side-conversations that happen in between as long as the condition is met. Is there a way to like "check all side entry conditions"? And they would also show players the icon that new dialogues are available. It feels like I need a waitForMessage at the beginning of a section of dialogue?
You could structure your conversation to check side conversations at certain points using Conditions.
Re: questions about dialogues for textline
Thanks for your answers! they are really helpful!
I met another issue when I set up the WaitForMessage though. It works as it paused when come to the sentence. But if I restart the game, or if I get back to the lobby, it would get to the next sentence even the message was never sent.
I also tried to not use the WaitForMessage, but use only a variable to control it, but it seems if the sentence with the condition is the only next entry, and the condition does not match, the whole dialogue would not show.
any suggestions? Did I miss some settings? Thanks!
I met another issue when I set up the WaitForMessage though. It works as it paused when come to the sentence. But if I restart the game, or if I get back to the lobby, it would get to the next sentence even the message was never sent.
I also tried to not use the WaitForMessage, but use only a variable to control it, but it seems if the sentence with the condition is the only next entry, and the condition does not match, the whole dialogue would not show.
any suggestions? Did I miss some settings? Thanks!
Re: questions about dialogues for textline
Hi,
Are you using the Textline project and TextlineDialogueUI, or are you using the SMSDialogueUI?
There will soon be an update to the Textline project so it uses SMSDialogueUI and offers an option to re-play the last sequence -- e.g., WaitForMessage() in your case.
Are you using the Textline project and TextlineDialogueUI, or are you using the SMSDialogueUI?
There will soon be an update to the Textline project so it uses SMSDialogueUI and offers an option to re-play the last sequence -- e.g., WaitForMessage() in your case.
Re: questions about dialogues for textline
I'm using the Textline project and TextlineDialogueUI.
That would be helpful. When would that be and where can I get the update? And can you reply to this thread when it is available? Thank you very much!
That would be helpful. When would that be and where can I get the update? And can you reply to this thread when it is available? Thank you very much!
Re: questions about dialogues for textline
And a not so related question..
How to call sequence? I want to transfer the current Sequence Trigger into c# script, and I added something like
Sequencer.Message("SetVariable(Conversation,Adam);LoadLevel(wechat dialogue)");
But it does not work when I linked the button's action to this.
How to call sequence? I want to transfer the current Sequence Trigger into c# script, and I added something like
Sequencer.Message("SetVariable(Conversation,Adam);LoadLevel(wechat dialogue)");
But it does not work when I linked the button's action to this.
- Attachments
-
- sequence.png (45.06 KiB) Viewed 1077 times
Re: questions about dialogues for textline
Hi,
Try this C#:
Try this C#:
Code: Select all
using PixelCrushers.DialogueSystem; // (Put at top of script)
...
DialogueLua.SetVariable("Conversation", "Adam");
PixelCrushers.SaveSystem.LoadScene("wechat dialogue");
Re: questions about dialogues for textline
Yes it works! thank you! Why the sequence one not work? was it supposed to work? I remember using it before...
And do we have a estimate for the update of the textline? and where can I get the information about that update? thanks!
And do we have a estimate for the update of the textline? and where can I get the information about that update? thanks!
Re: questions about dialogues for textline
And.. another question(sorry)
I try to set the conversation value and when I get into a dialogue scene, I start the conversation directly from c#
void Start()
{
var converstaionName = DialogueLua.GetVariable("Conversation").AsString;
DialogueManager.StartConversation(converstaionName);
}
it seems work for the first dialogue, but if I return to the lobby and select another dialogue, it still shows the previous dialogue. Do I have to do what the example in the lobby one does? to create objects and conversation activator for each dialogue?
I try to set the conversation value and when I get into a dialogue scene, I start the conversation directly from c#
void Start()
{
var converstaionName = DialogueLua.GetVariable("Conversation").AsString;
DialogueManager.StartConversation(converstaionName);
}
it seems work for the first dialogue, but if I return to the lobby and select another dialogue, it still shows the previous dialogue. Do I have to do what the example in the lobby one does? to create objects and conversation activator for each dialogue?
Re: questions about dialogues for textline
Hi,
Make sure you're setting the "Conversation" variable before going to the next scene. You can do it in a script; you don't have to use GameObjects like the Lobby scene does.
The Sequencer.Message() that you were using won't work because Sequencer.Message() just sends a message to the sequencer. It looks like you were trying to make it run C# code instead.
Make sure you're setting the "Conversation" variable before going to the next scene. You can do it in a script; you don't have to use GameObjects like the Lobby scene does.
The Sequencer.Message() that you were using won't work because Sequencer.Message() just sends a message to the sequencer. It looks like you were trying to make it run C# code instead.