Page 1 of 2
Show responses before the end of the default delay
Posted: Mon Jun 19, 2023 5:29 pm
by lgarczyn
Hello, I have nice animations for my response buttons, but they take enough time that I want to start them before the end of the usual dialogue delay
I don't want to set Delay(0) on every node before a PC choice, and besides, this command somehow breaks the typewriter animation.
The only somewhat satisfying result was to set every pre-response node sequence to Delay({{end}}/2) followed by a response sequence of Delay({{end}}/2)
Re: Show responses before the end of the default delay
Posted: Mon Jun 19, 2023 10:31 pm
by Tony Li
Hi,
Replace your subtitle panel's StandardUISubtitlePanel with this subclass, which doesn't stop the typewriter when advancing to the response menu:
Code: Select all
public class MenuWhileTypingSubtitlePanel : PixelCrushers.DialogueSystem.StandardUISubtitlePanel
{
public override void FinishSubtitle()
{
HideContinueButton();
}
}
Re: Show responses before the end of the default delay
Posted: Tue Jun 20, 2023 5:39 am
by lgarczyn
Clean, elegant, I love it.
Don't know why I was set on using sequences.
Re: Show responses before the end of the default delay
Posted: Thu Jun 22, 2023 5:01 am
by lgarczyn
I've set it up as described, but I do not get any different result, unless I manually set every single dialog entries with answers to have a delay of 0.
Is there any way to detect the number of responses in a Sequence ?
Re: Show responses before the end of the default delay
Posted: Thu Jun 22, 2023 8:51 am
by Tony Li
Hi,
You could modify the Sequence in an
OnConversationLine method in a script on your Dialogue Manager. For example, the method below checks if the current subtitle will lead to a response menu. If so, it modifies the Sequence to continue after 1 second:
Code: Select all
void OnConversationLine(Subtitle subtitle)
{
var state = DialogueManager.currentConversationState;
bool isMenuNext = !state.hasNPCResponse && state.hasPCResponses && !state.hasPCAutoResponse;
if (isMenuNext)
{
subtitle.sequence = $"Continue()@1; {subtitle.sequence}";
}
}
Re: Show responses before the end of the default delay
Posted: Fri Jun 23, 2023 7:03 pm
by lgarczyn
What's the purpose of the @1 ? To add a minimum delay before the response appears?
Re: Show responses before the end of the default delay
Posted: Fri Jun 23, 2023 9:12 pm
by Tony Li
Hi,
Yes, exactly. It simulates clicking the continue button after 1 second.
Re: Show responses before the end of the default delay
Posted: Tue Dec 12, 2023 7:34 am
by lgarczyn
I found that it causes a lot less issues to run a separate sequencer command:
Code: Select all
public void SkipSubtitleAnimationIfResponses(Subtitle subtitle)
{
ConversationState state = DialogueManager.currentConversationState;
bool isMenuNext = !state.hasNPCResponse && state.hasPCResponses;
if (isMenuNext) SkipSubtitleAnimation();
}
void SkipSubtitleAnimation()
{
string delay = minDelay.ToString(CultureInfo.InvariantCulture);
string continueSequence = $"Continue()@{delay}";
DialogueManager.PlaySequence(continueSequence);
}
Re: Show responses before the end of the default delay
Posted: Tue Dec 12, 2023 8:48 am
by Tony Li
Hi,
What if you just set the Dialogue Manager's Subtitle Settings > Continue Button mode to "Not Before Response Menu"? Or "Optional Before Response Menu" if you want allow the player to click the continue button to skip to the response menu early.
Re: Show responses before the end of the default delay
Posted: Thu Dec 14, 2023 8:38 am
by lgarczyn
No, that would cause more issues.
The continue button would disappear just before that actual part I wanted to skip in the first place.