Skip/Auto Button Help

Announcements, support questions, and discussion for the Dialogue System.
User avatar
HawkX
Posts: 147
Joined: Mon Feb 27, 2017 1:50 pm
Location: Quebec
Contact:

Re: Skip/Auto Button Help

Post by HawkX »

You never answered this little bit here (probably got sidetracked with other things) :)
my only question for that last part is : Where do i enter that line? :) hehe... sorry still learning!
Delay(3)@{{end}}
EDIT : I actually found out why (or how) the next line of text would appear fully before starting to type! I had a checkbox ticked "wait 1 frame to allow layout elements to setup first"... when i UNchecked that it fixed the issue!
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Skip/Auto Button Help

Post by Tony Li »

Oops, sorry about forgetting to answer that part. Inspect the Dialogue Manager GameObject. Expand Display Settings > Camera Settings, and enter the line in the Default Sequence field.

Each dialogue entry node has its own Sequence field. But if its Sequence field is blank, it will use the Dialogue Manager's Default Sequence.
User avatar
HawkX
Posts: 147
Joined: Mon Feb 27, 2017 1:50 pm
Location: Quebec
Contact:

Re: Skip/Auto Button Help

Post by HawkX »

Thats really perfect! (everything worked out fine!)

Sorry to keep bugging with one followup question after another... but this got me thinking... is there a way in C# to change that line?

or more accurately to change the number value "X" of wait time in

Code: Select all

Delay(X)@{{end}}
I'd love to offer the player the option to select both the speed (of the typewriter/dialoguemanager write speed) as well as the time to wait after a subtitle is fully written before the next comes around :)
I am of those gamers/creators that really enjoy when there are a lot of meaningfull options to give the player control :)


EDIT : and i think i got some kind of bug in that "auto button" code you provided... somehow it skips to the next line when auto is toggled on (even if the line is not finished writing and "end" is not reached yet) I tried writing a super long line, set both typewriter/dialoguemanager to 45 chars speed... the subtitle was about 1/3 of the way written, i clicked "auto" and it skipped to the next line right away
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Skip/Auto Button Help

Post by Tony Li »

Hi,
HawkX wrote:is there a way in C# to change that line?

or more accurately to change the number value "X" of wait time in

Code: Select all

Delay(X)@{{end}}
Here are two ways to accomplish this:

1. In your C# script, set a Dialogue System variable -- for example, let's call it "finalDelay":

Code: Select all

DialogueLua.SetVariable("finalDelay", 3); 
Then change the sequence to:

Code: Select all

Delay([var=finalDelay])@{{end}}

2. Alternatively, you can add an OnConversationLine method to a script on the Dialogue Manager. In the method, modify the sequence:

Code: Select all

public float myCustomDelay;

public void OnConversationLine(Subtitle subtitle) {
    subtitle.sequence += "; Delay(" + myCustomDelay + ")@{{end}}";
} 
HawkX wrote:EDIT : and i think i got some kind of bug in that "auto button" code you provided... somehow it skips to the next line when auto is toggled on (even if the line is not finished writing and "end" is not reached yet) I tried writing a super long line, set both typewriter/dialoguemanager to 45 chars speed... the subtitle was about 1/3 of the way written, i clicked "auto" and it skipped to the next line right away
I'll look into this and get back to you.
User avatar
HawkX
Posts: 147
Joined: Mon Feb 27, 2017 1:50 pm
Location: Quebec
Contact:

Re: Skip/Auto Button Help

Post by HawkX »

Thanks again (as always) for great info!!

adding the finaldelay setvariable worked perfectly! :)

as of now, the only thing remaining is to not auto skip 1 line when i turn auto-mode-on
im 99% sure its something in this line... but im not sure what :)

Code: Select all

if (DialogueManager.Instance.GetComponent<PixelCrushers.DialogueSystem.SequencerCommands.SequencerCommand>() == null)
perhaps my SequencerCommand is always == null and therefore always skip to the next when i turn auto on?
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Skip/Auto Button Help

Post by Tony Li »

I see the error in my logic there. Since Delay() is queued to run at the time specified by {{end}}, it's not active yet, so the line you indicated returns null.

I have an updated line in mind. I'm out of the office right now, but as soon as I get back I'll test it and post it here.
User avatar
HawkX
Posts: 147
Joined: Mon Feb 27, 2017 1:50 pm
Location: Quebec
Contact:

Re: Skip/Auto Button Help

Post by HawkX »

wow thats dedication!! not even at the office and taking the time to reply!!! :P hehehhe...

no rush!! you exceed every expectation i ever had for the best support of all time!
I just wish I could hire you part time to help me out on other stuff non-dialogue-system-related!!
My game would be done in no time!! LOL
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Skip/Auto Button Help

Post by Tony Li »

Okay, thanks for your patience. I updated the script and example scene in my previous post. Instead of looking for active sequencer commands, it grabs the sequencer itself and checks its "isPlaying" property, which is the right way to do it.
User avatar
HawkX
Posts: 147
Joined: Mon Feb 27, 2017 1:50 pm
Location: Quebec
Contact:

Re: Skip/Auto Button Help

Post by HawkX »

AND.... it works!!! :)

Not that i had doubt! Thanks again for everything!

I will most likely be back before this is over... creating a game with only 3 people is really hard work! If we're lucky we very well might "strike gold" though... ;)
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Skip/Auto Button Help

Post by Tony Li »

Definitely keep us updated. It's always exciting to see what projects everyone's working on!
Post Reply