Auto Play and Skip All buttons
Re: Auto Play and Skip All buttons
Thanks Tony, I just noticed that whenever I interact with Skip All or Auto Play buttons (doesn't matter if they are turned on or off, simply using these buttons seem to do it), the dialogue continues normally, but sequences don't play. I have attached a video where you can see a comparison, in the first case I interact with Skip All and my sequence where the NPC moves doesn't play, and in the second where I don't click on Skip All, the sequence plays like it should.
Re: Auto Play and Skip All buttons
Auto Play shouldn't affect sequences since it just sets the continue mode to Never, but Skip All definitely will.
There are two ways to handle that. If all of your sequencer commands can run immediately, instead of over time, you can change the ConversationControl script's OnConversationLine method to:
Make sure commands that must run have 'required' in front of them, or change the line in the method above to something like:
to give them a frame to run.
But if sequences play over time -- e.g., MoveTo(Stairs,,3) or AnimatorPlayWait(Dance) -- you'll need to handle it differently since you won't really be skipping. The easiest may be to add a 'required' command that plays at the end to make sure things are in the right state. For example, change this:
to:
There are two ways to handle that. If all of your sequencer commands can run immediately, instead of over time, you can change the ConversationControl script's OnConversationLine method to:
Code: Select all
void OnConversationLine(Subtitle subtitle)
{
if (skipAll)
{
subtitle.sequence = "Continue(); " + subtitle.sequence;
}
}
Code: Select all
subtitle.sequence = "Continue()@0.01; " + subtitle.sequence;
But if sequences play over time -- e.g., MoveTo(Stairs,,3) or AnimatorPlayWait(Dance) -- you'll need to handle it differently since you won't really be skipping. The easiest may be to add a 'required' command that plays at the end to make sure things are in the right state. For example, change this:
Code: Select all
MoveTo(Stairs,,3); // Move speaker to stairs over 3 seconds
Code: Select all
MoveTo(Stairs,,3); // Move speaker to Stairs over 3 seconds
required MoveTo(Stairs)@3; // At the 3-second mark (or earlier if skipping), snap speaker to Stairs
Re: Auto Play and Skip All buttons
Understood, worked
While we are here, can you tell me why do I have to click continue two times here to end the dialogue?
My Continue button is set to always here, if I have it set to Optional, everything works normally, after PC line, the dialogue ends and closes without having to click on continue twice. Attached a picture of my current dialogue setup
Code: Select all
subtitle.sequence = "Continue()@0.01; " + subtitle.sequence;
While we are here, can you tell me why do I have to click continue two times here to end the dialogue?
My Continue button is set to always here, if I have it set to Optional, everything works normally, after PC line, the dialogue ends and closes without having to click on continue twice. Attached a picture of my current dialogue setup
- Attachments
-
- Screenshot_3.png (13.08 KiB) Viewed 1404 times
Re: Auto Play and Skip All buttons
Hi,
I don't know. It looks like the typewriter is done typing. If the typewriter were still going, the first click would generally fast-forward the typewriter, and the second click would advance the conversation. But that doesn't look to be the case here.
I see the final <End> node has a Sequence. What's the Sequence?
If you temporarily set the Dialogue Manager's Debug Level to Info and reproduce the issue, does the Console window shed any light on the issue?
I don't know. It looks like the typewriter is done typing. If the typewriter were still going, the first click would generally fast-forward the typewriter, and the second click would advance the conversation. But that doesn't look to be the case here.
I see the final <End> node has a Sequence. What's the Sequence?
If you temporarily set the Dialogue Manager's Debug Level to Info and reproduce the issue, does the Console window shed any light on the issue?
Re: Auto Play and Skip All buttons
This is what my sequencer does:
Attached image of how the info debug looks in this case.
Code: Select all
public class SequencerCommandAudreyMove : SequencerCommand
{
public void Awake()
{
GameObject directressObj = GameObject.Find("Audrey");
DirectressMovement dirMove = directressObj.GetComponent<DirectressMovement>();
dirMove.Move();
print("MOVING EVENT PLAYED");
Stop();
}
}
- Attachments
-
- Screenshot_2.png (36.67 KiB) Viewed 1398 times
Re: Auto Play and Skip All buttons
I don't know. Feel free to send a reproduction project to tony (at) pixelcrushers.com.
Or you could try adding a Continue() to the last node's Sequence. If SequencerCommandAudreyMove waits until Audrey has finished moving before calling Stop(), you could do something like:
Or you could try adding a Continue() to the last node's Sequence. If SequencerCommandAudreyMove waits until Audrey has finished moving before calling Stop(), you could do something like:
Code: Select all
AudreyMove()->Message(Moved);
Continue()@Message(Moved)
Re: Auto Play and Skip All buttons
Adding Continue() to the last node Sequence worked! Thank you Tony
Re: Auto Play and Skip All buttons
Another question, is there any stored reference to the Dialogue System Trigger that called the ongoing dialogue? Because I want to reenable the Dialogue System Trigger when the player answers something like "Not now, we can continue later." I know I could make a sequencer for each Dialogue System Trigger but it would be very handy if instead of having a different sequencer for each trigger, I had a universal sequencer like this: (Pseudocode)
Code: Select all
SequencerCommandReenableTrigger: SequencerCommand
void Awake()
{
DialogueManager.LastInteractedDialogueSystemTrigger.enabled = true;
Stop();
}
Re: Auto Play and Skip All buttons
No, but you can make a subclass of DialogueSystemTrigger that stores a reference. Example:
Code: Select all
public class CustomDialogueSystemTrigger : DialogueSystemTrigger
{
public static DialogueSystemTrigger LastInteractedDialogueSystemTrigger = null;
protected override void DoConversationAction(Transform actor)
{
LastInteractedDialogueSystemTrigger = this;
base.DoConversationAction(actor);
}
}
Re: Auto Play and Skip All buttons
Alright, but how do I get this stored reference now?
The sequencer I'm trying is not working
The sequencer I'm trying is not working
Code: Select all
using UnityEngine;
using System.Collections;
using PixelCrushers.DialogueSystem;
namespace PixelCrushers.DialogueSystem.SequencerCommands
{
public class SequencerCommandReenableDialogue : SequencerCommand
{
public void Awake()
{
DialogueSystemTrigger dialogueTrigger = FindObjectOfType<DialogueSystemTrigger>();
dialogueTrigger.LastInteractedSystemTrigger.enabled = true; //Missing reference (LastInteractedSystemTrigger)
Stop();
}
}
}