Page 5 of 6
Re: Auto Play and Skip All buttons
Posted: Fri May 07, 2021 3:15 pm
by Tony Li
Hi,
That doesn't make any sense. You're defining it here:
Code: Select all
public class CustomDialogueSystemTrigger : DialogueSystemTrigger
{
public static DialogueSystemTrigger LastInteractedDialogueSystemTrigger = null;
Re: Auto Play and Skip All buttons
Posted: Fri May 07, 2021 10:52 pm
by mac
Well, I'm not sure what to do now, I did everything like you said and the script doesn't want to compile, the sequencer cant find 'LastInteractedSystemTrigger' no matter what.
I also tried adding this to the Custom Dialogue System Trigger for testing:
Code: Select all
public static GameObject TriggerObj;
Inside the sequencer (Awake method):
Code: Select all
CustomDialogueSystemTrigger dialogueTrigger = FindObjectOfType<CustomDialogueSystemTrigger>();
dialogueTrigger.TriggerObj.SetActive(true);
And still could not reference it on the Sequencer. But the error now is different:
error CS0176: Member 'CustomDialogueSystemTrigger.TriggerObj' cannot be accessed with an instance reference; qualify it with a type name instead
Not sure if this helps.
Re: Auto Play and Skip All buttons
Posted: Fri May 07, 2021 11:12 pm
by Tony Li
Hi,
It looks like you just had a typo (which I then copied when I copied your code into my replies).
Here are scripts that I just tested:
Code: Select all
using UnityEngine;
namespace PixelCrushers.DialogueSystem
{
public class CustomDialogueSystemTrigger : DialogueSystemTrigger
{
public static DialogueSystemTrigger LastInteractedDialogueSystemTrigger = null;
protected override void DoConversationAction(Transform actor)
{
Debug.Log("Recording LastInteractedDialogueSystemTrigger = " + this);
LastInteractedDialogueSystemTrigger = this;
base.DoConversationAction(actor);
}
}
}
Code: Select all
using UnityEngine;
namespace PixelCrushers.DialogueSystem.SequencerCommands
{
public class SequencerCommandReenableDialogue : SequencerCommand
{
public void Awake()
{
Debug.Log("Re-enabling: " + CustomDialogueSystemTrigger.LastInteractedDialogueSystemTrigger, CustomDialogueSystemTrigger.LastInteractedDialogueSystemTrigger);
if (CustomDialogueSystemTrigger.LastInteractedDialogueSystemTrigger != null)
{
CustomDialogueSystemTrigger.LastInteractedDialogueSystemTrigger.enabled = true;
}
Stop();
}
}
}
Re: Auto Play and Skip All buttons
Posted: Sat May 08, 2021 3:59 pm
by mac
Awesome, the compile error is gone, but I noticed the 'DoConversationAction' method never gets called currently (attached a screenshot of what I get on console after the conversation is done and I execute the sequencer command, as you will see, only the sequencer Debug.Log runs), do I have to call the DoConversationAction along where I start the dialogue?
This is currently how I start the dialogue:
Code: Select all
private void OnTriggerStay(Collider other)
{
if (other.tag == "Player")
{
if (Input.GetKeyDown(KeyCode.F))
{
print("PRESSED");
var conversation = dialogueTrigger.conversation;
var actor = dialogueTrigger.conversationActor;
var conversant = dialogueTrigger.conversationConversant;
DialogueManager.StartConversation(conversation, actor, conversant);
interactSign.isInteractable = false;
disableDialogueTrigger();
}
if (dialogueTrigger.enabled)
{
interactSign.isInteractable = true;
}
}
}
Re: Auto Play and Skip All buttons
Posted: Sat May 08, 2021 8:05 pm
by Tony Li
Hi,
You're starting a conversation manually by calling DialogueManager.StartConversation(). Do you want to use the Dialogue System Trigger instead? If so, change these line:
Code: Select all
var conversation = dialogueTrigger.conversation;
var actor = dialogueTrigger.conversationActor;
var conversant = dialogueTrigger.conversationConversant;
DialogueManager.StartConversation(conversation, actor, conversant);
to this:
Re: Auto Play and Skip All buttons
Posted: Sun May 09, 2021 7:26 pm
by mac
Awesome, everything works like inteded now! Thank you again Tony!
Re: Auto Play and Skip All buttons
Posted: Sun May 09, 2021 7:35 pm
by Tony Li
Whew! Glad to help.
Re: Auto Play and Skip All buttons
Posted: Sun May 16, 2021 6:41 pm
by mac
So Tony, I've been playing around with Skip All and Auto Play a bit and they seem clunky:
Both buttons can't be clicked during dialogue when the dialogue starts with a line, I'm only able to click the buttons when a response panel pops up.
Turning Auto Play on breaks focus/unfocus portrait sequences.
I can't see a clear pattern or tell you whats causing those issues but they are pretty self explanatory, I compiled a small example showing those problems, you can download this example and check how they behave for yourself here:
https://drive.google.com/drive/folders/ ... sp=sharing
Re: Auto Play and Skip All buttons
Posted: Sun May 16, 2021 8:10 pm
by Tony Li
Hi,
In that build, neither Auto Play nor Skip All seem to be hooked up correctly. They both appear to behave like the continue button.
Did you hook up Auto Play to ConversationControl.AutoPlay, and Skip All to Conversation.SkipAll?
Take a look at the Visual Novel Starter Framework on the Dialogue System Extras page for an example.
Re: Auto Play and Skip All buttons
Posted: Sun May 30, 2021 4:08 pm
by mac
I have found the reason why Skip All and Auto Play didn't respond properly and acted as the continue button, the problem with focus/unfocus animation breaking are still present, but I will leave that for another time;
I have a small question, how can I reset a dialogue condition? For instance I want to set a dialogue condition back to false when I go back to the game main menu.