Auto-Advance Subtitle variability

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Kieddo
Posts: 2
Joined: Mon Aug 17, 2020 6:03 pm

Auto-Advance Subtitle variability

Post by Kieddo »

I'm working on an RPG and I have three subtitle Panels underneath a single Dialogue Manager.
The first one is the generic discussion panel (appears when talking to NPCs)
The second one is the NPC portrait itself (changes alongside discussion panel)
The third one is the Battle Activity (when you take a turn it will auto-advance through dialog; "You attack for 40 damage!" -> "The Enemy attacks for 32 damage!" -> next turn).

My issue is I want the Battle Activity subtitle panel to auto-advance while the others don't. Since I was working with the generic discussion panel previously I have Min Subtitle Second set to some ridiculous amount (>80000). I only want the Battle Activity Subtitle panel to auto advance. How would I go about achieving this?

Sorry If this is terribly vague, this is my first time asking such a question.
User avatar
digiwombat
Posts: 50
Joined: Sun Jun 16, 2019 4:59 am

Re: Auto-Advance Subtitle variability

Post by digiwombat »

There are a few ways to do this.

One is to use Sequences in a conversation to have it automatically continue:
https://www.pixelcrushers.com/dialogue_ ... ndContinue
And do something like Continue()@3 like in the example there.

Another is to use Alerts (which I can't find a tutorial for in the version 2x docs):
DialogueManager.ShowAlert("Player used Slash for 20 Damage!", 1f);

There might be some other ways Tony can point out, but I'd probably go with an Alert box since you can just pass a string into it from your attack code rather than having to deal with a conversation at all.

Though obviously if you want the attack to be acknowledged by the user/stop the flow of the fight, you will need to use a conversation box, I think, since Alerts just pop over.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Auto-Advance Subtitle variability

Post by Tony Li »

Alerts should work pretty well, unless you want to keep a scrolling history of battle results. In that case, use a subtitle panel with Accumulate Text ticked.

If the battle is a separate conversation, inspect the conversation's properties by clicking on blank canvas space. In the inspector, tick Override Display Settings > Camera & Cutscene Settings. Set the Default Sequence to: Continue()@3
Kieddo
Posts: 2
Joined: Mon Aug 17, 2020 6:03 pm

Re: Auto-Advance Subtitle variability

Post by Kieddo »

Thank you two! I decided to use the sequence since it seemed a bit easier. Right now I have it to where it disables the buttons (so you can't ruin the continue press/has to wait for the turn) then waits @3 for Continue and SetEnabled.

Code: Select all

SetEnabled(Canvas, false, tag=Buttons);
SetEnabled(Canvas, true, tag=Buttons)@3;
Continue()@3;
SetEnabled(DialogueSystemTrigger, false, tag=BattleHandler);
I'm not sure if this is the easiest (or even the best) way to do this, but for right now it seems to be the only reasonable way (since "pause game During Conversation" on DialogueSystemTrigger doesn't seem to disable the buttons).

Is there a way to dynamically change this @3 wait by the way? So if the player maybe wants a faster dialogue/no wait they can set it to 1 or none in the menu?
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Auto-Advance Subtitle variability

Post by Tony Li »

You can set a Dialogue System variable. C# code:

Code: Select all

DialogueLua.SetVariable("NodeDelay", 3);
Then use that variable in the sequencer command:

Code: Select all

Continue()@[var=NodeDelay]
Post Reply