messaging-app-like UI
-
- Posts: 45
- Joined: Wed Jan 09, 2019 7:49 am
Re: messaging-app-like UI
Thanks, it works perfectly! Thanks for all your help
-
- Posts: 45
- Joined: Wed Jan 09, 2019 7:49 am
Re: messaging-app-like UI
I've got a question about Lua conditions.
I've added a bool for a NPC line to be played, the value of this bool being set to true when another NPC line in another conversation is executed.
The line under condition is the first line of a conversation. If I try to go to this conversation while the bool is false, the conversation does not open. If I add some lines before, the conversation closes when it reaches the line under condition.
I've tried putting "passthrough" in the false condition field : it doesn't display the line, let the conversation open but shows the next node. I've tried putting "WaitForMessage(Forever)" but in this case I can't go on when the bool is true.
I'd just like to open the conversation, see that nothing happens, and go on with my game. What could I do?
Another thing, I've tried to work around this by script, checking the value of my bool, but it doesn't seem to be returning any value :
Doesn't it work that way?
I've added a bool for a NPC line to be played, the value of this bool being set to true when another NPC line in another conversation is executed.
The line under condition is the first line of a conversation. If I try to go to this conversation while the bool is false, the conversation does not open. If I add some lines before, the conversation closes when it reaches the line under condition.
I've tried putting "passthrough" in the false condition field : it doesn't display the line, let the conversation open but shows the next node. I've tried putting "WaitForMessage(Forever)" but in this case I can't go on when the bool is true.
I'd just like to open the conversation, see that nothing happens, and go on with my game. What could I do?
Another thing, I've tried to work around this by script, checking the value of my bool, but it doesn't seem to be returning any value :
Code: Select all
private bool myBool;
void Start()
{
myBool = PixelCrushers.DialogueSystem.DialogueLua.GetVariable("myVariable").asBool;
}
void Method()
if(myBool == true)
{
//do something
}
Re: messaging-app-like UI
If the first node's Conditions are false, and if you still want to start the conversation, untick your Dialogue System Trigger's Skip If No Valid Entries checkbox. If this is unticked, the conversation will start no matter what, so recipients will receive OnConversationStart and OnConversationEnd messages.
If you're not using a Dialogue System Trigger, you can query DialogueManager.ConversationHasValidEntry() to see if the conversation would have anything to say.
If I misunderstood what you're looking for, can you please rephrase or give an example?
Bools should work like you describe. Maybe "myVariable" isn't true yet in the Start method. Can you change it to this?
To check the value of "myVariable" interactively, you can use a Lua Console or the Dialogue Editor's Watches section.
If you're not using a Dialogue System Trigger, you can query DialogueManager.ConversationHasValidEntry() to see if the conversation would have anything to say.
If I misunderstood what you're looking for, can you please rephrase or give an example?
Bools should work like you describe. Maybe "myVariable" isn't true yet in the Start method. Can you change it to this?
Code: Select all
void Method()
{
if(PixelCrushers.DialogueSystem.DialogueLua.GetVariable("myVariable").asBool == true)
{
//do something
}
}
-
- Posts: 45
- Joined: Wed Jan 09, 2019 7:49 am
Re: messaging-app-like UI
I've unticked Skip If No Valid Entries but it didn't change a thing.
To be more precise, I'm using a Dialogue System Trigger on an empty game object :
and I call OnUse() when clicking on an UI button :
So, in-game, in a normal situation, I click on the button, it shuts down this canvas and starts the conversation :
But, if the conversation's entry node's condition is false, nothing happens :
And i'd like this to happen :
Again, I've unticked Skip If No Valid Entries.
To be more precise, I'm using a Dialogue System Trigger on an empty game object :
and I call OnUse() when clicking on an UI button :
So, in-game, in a normal situation, I click on the button, it shuts down this canvas and starts the conversation :
But, if the conversation's entry node's condition is false, nothing happens :
And i'd like this to happen :
Again, I've unticked Skip If No Valid Entries.
Re: messaging-app-like UI
Hi,
If you temporarily set the Dialogue Manager's Debug Level to Info, does it report that it's starting the (empty) conversation?
BTW, if you're using TextlineDialogueUI, you may want to use the included MenuUtility script to start conversations. This checks if the conversation has a previously-saved history. If so, it restores the history. Otherwise it starts the conversation from the beginning.
The Dialogue System Extras page has an updated Textline package with an updated MenuUtility script that was updated on January 30.
If you temporarily set the Dialogue Manager's Debug Level to Info, does it report that it's starting the (empty) conversation?
BTW, if you're using TextlineDialogueUI, you may want to use the included MenuUtility script to start conversations. This checks if the conversation has a previously-saved history. If so, it restores the history. Otherwise it starts the conversation from the beginning.
The Dialogue System Extras page has an updated Textline package with an updated MenuUtility script that was updated on January 30.
-
- Posts: 45
- Joined: Wed Jan 09, 2019 7:49 am
Re: messaging-app-like UI
Hi,
The conversation seems to be starting when I use the Dialog System Trigger's OnUse(), but it's still blocked by the false condition :If you temporarily set the Dialogue Manager's Debug Level to Info, does it report that it's starting the (empty) conversation?
For saving/history, I use the OnRecordPersistentData() and OnApplyPersistentData() methods, because I have only one scene in my game. Does MenuUtility.cs does any different?BTW, if you're using TextlineDialogueUI, you may want to use the included MenuUtility script to start conversations. This checks if the conversation has a previously-saved history. If so, it restores the history. Otherwise it starts the conversation from the beginning.
Re: messaging-app-like UI
Hi,
Tetralogia wrote: ↑Sat Feb 02, 2019 3:55 amThe conversation seems to be starting when I use the Dialog System Trigger's OnUse(), but it's still blocked by the false condition[/code]
Let's try to figure out why the variable isn't true at the time that the conversation starts. What sets the variable true?
(I'm going to be offline for about 6 hours; I'll reply as soon as I can.)
-
- Posts: 45
- Joined: Wed Jan 09, 2019 7:49 am
Re: messaging-app-like UI
The variable is set true when a node in another conversation is executed. But I'd just like to be able to open the conversation even if the condition is false (meaning, that the Dialogue Panel is set active). I've tried unticking Skip If No Valid Entries but nothing happens.
Re: messaging-app-like UI
Sorry it took me so long to catch on! If there's nothing to show, the Dialogue System won't open the dialogue UI. I think you will need to use a few lines of custom code. If there is something to show, start the conversation. Otherwise just open the dialogue UI. Example:
Configure the Menu button in the heading bar to close the dialogue UI in addition to stopping the conversation. Example:
Code: Select all
if (DialogueManager.ConversationHasValidEntry("My Conversation")) {
DialogueManager.StartConversation("My Conversation");
}
else {
DialogueManager.dialogueUI.Open();
}
Code: Select all
DialogueManager.StopConversation(); // If conversation is active, stop it.
DialogueManager.dialogueUI.Close(); // Make sure to close dialogue UI is no conversation was active.