Use Playmaker to select a Dialogue Node
Use Playmaker to select a Dialogue Node
Hello
I have a question regarding Playmaker and Dialogue System.
I'm going to explain my situation briefly:
At some point, the player has to give a password through a TextInput box. They can try as much as they want until the Countdown reaches 0. If the Countdown reaches 0, the TextInput is removed and a dialogue line is displayed like "You failed".
To trigger the countdown I use Playmaker. Everything works fine (the way I've done it is maybe ugly haha) except the very last part ("dialogue line is displayed like "You failed".)
But, I don't know what kind of Action I should add to the Status "Time's up" ("Etat1" here, sorry it's in French, but it just means "State 1") in Playmaker to trigger a specific node in Dialogue System.
I would like to know if it's possible to select a spefic node through Playmaker.
I assume it's easy to (in case of challenge based on Countdown) but I've not found information regarding it.
Thanks a lot and Happy New Year
I have a question regarding Playmaker and Dialogue System.
I'm going to explain my situation briefly:
At some point, the player has to give a password through a TextInput box. They can try as much as they want until the Countdown reaches 0. If the Countdown reaches 0, the TextInput is removed and a dialogue line is displayed like "You failed".
To trigger the countdown I use Playmaker. Everything works fine (the way I've done it is maybe ugly haha) except the very last part ("dialogue line is displayed like "You failed".)
But, I don't know what kind of Action I should add to the Status "Time's up" ("Etat1" here, sorry it's in French, but it just means "State 1") in Playmaker to trigger a specific node in Dialogue System.
I would like to know if it's possible to select a spefic node through Playmaker.
I assume it's easy to (in case of challenge based on Countdown) but I've not found information regarding it.
Thanks a lot and Happy New Year
Re: Use Playmaker to select a Dialogue Node
Hi,
What about stopping the conversation and then restarting it at the "You failed" node? Example:
There are no built-in actions to jump to a specific entry. If you or a programmer want to write one, the C# code would look similar to this:
What about stopping the conversation and then restarting it at the "You failed" node? Example:
There are no built-in actions to jump to a specific entry. If you or a programmer want to write one, the C# code would look similar to this:
Code: Select all
var state = DialogueManager.conversationModel.GetState(dialogueEntry);
DialogueManager.conversationController.GotoState(state);
Re: Use Playmaker to select a Dialogue Node
Hello Tony, thanks your you reply.
In fact, Stop/StartConversation would delete the previous conversation (reset the conversation) and that's not what I expect.
I have not tried to create playmaker action yet. I can try (or ask a programmer indeed). Just a question "State" means "Entry/ID" in this case ?
In fact, Stop/StartConversation would delete the previous conversation (reset the conversation) and that's not what I expect.
I have not tried to create playmaker action yet. I can try (or ask a programmer indeed). Just a question "State" means "Entry/ID" in this case ?
Re: Use Playmaker to select a Dialogue Node
Hi,
A state corresponds to a dialogue entry. But it also specifies which links are currently valid, and markup tags in the text have been processed.
Here's an action to jump to a specific entry ID:
JumpToEntry.cs
I'll add it to the next release's integration package.
A state corresponds to a dialogue entry. But it also specifies which links are currently valid, and markup tags in the text have been processed.
Here's an action to jump to a specific entry ID:
JumpToEntry.cs
Code: Select all
using UnityEngine;
using HutongGames.PlayMaker;
namespace PixelCrushers.DialogueSystem.PlayMaker
{
[ActionCategory("Dialogue System")]
[HutongGames.PlayMaker.TooltipAttribute("Jumps the active conversation to a specific entry.")]
public class JumpToEntry : FsmStateAction
{
[HutongGames.PlayMaker.TooltipAttribute("The starting dialogue entry ID. Leave at -1 to start at the beginning")]
public FsmInt entryID;
public override void Reset()
{
entryID = new FsmInt();
entryID.Value = -1;
}
public override void OnEnter()
{
if (!DialogueManager.isConversationActive)
{
LogError("Can't jump to entry " + entryID.Value + ". No conversation is active.");
}
else
{
var id = (entryID != null) ? entryID.Value : -1;
var conversation = DialogueManager.masterDatabase.GetConversation(DialogueManager.lastConversationID);
var entry = (conversation != null) ? conversation.GetDialogueEntry(id) : null;
if (entry == null)
{
LogError("Can't find entry " + entryID.Value + " to jump to it.");
}
else
{
var state = DialogueManager.conversationModel.GetState(entry);
DialogueManager.conversationController.GotoState(state);
}
}
Finish();
}
}
}
Re: Use Playmaker to select a Dialogue Node
Oh thank you so much for this solution.
I wasn't expected it but that is so cool. I'm very thankful for it.
Thanks a lot!
I wasn't expected it but that is so cool. I'm very thankful for it.
Thanks a lot!
Re: Use Playmaker to select a Dialogue Node
Happy to help!
Re: Use Playmaker to select a Dialogue Node
Hey, just to let you know:
I've tested your solution, it works almost perfectly in my case (at least i can find now a workaround thanks to it) but if you want to make it more efficient/handy in the next update:
The solution allows the user to "see" the entry but not to jump: indeed, the node is displayed, but it does not drive to its related node:
Let's say, I have:
node A driving to
node B driving to
node C driving to
node D
If the Node A "jump to" the node D, then the Node will be shown this way "Node A > Node D > Node B > Node C".
I don't know if this was the result you were expected But thanks you a lot anyway
I've tested your solution, it works almost perfectly in my case (at least i can find now a workaround thanks to it) but if you want to make it more efficient/handy in the next update:
The solution allows the user to "see" the entry but not to jump: indeed, the node is displayed, but it does not drive to its related node:
Let's say, I have:
node A driving to
node B driving to
node C driving to
node D
If the Node A "jump to" the node D, then the Node will be shown this way "Node A > Node D > Node B > Node C".
I don't know if this was the result you were expected But thanks you a lot anyway
Re: Use Playmaker to select a Dialogue Node
Hmm, it should evaluate node D's links (which are none) and end the conversation there. If you're not able to get it to work and want to investigate further, please feel free to send a reproduction project to tony (at) pixelcrushers.com.
Re: Use Playmaker to select a Dialogue Node
Thank you Tony
I'll try to find a solution, and if I can't, I'll send you something. Thanks a lot for your help
I'll try to find a solution, and if I can't, I'll send you something. Thanks a lot for your help