Page 1 of 2

[Ink Integration] SetTimeout doesn't work anymore

Posted: Fri Oct 15, 2021 2:25 pm
by nehvaleem
Hi!
Somewhere between versions 2.2.15 - 2.2.21 there was some regression introduced I think.

I am unable to call SetTimeout() from a Sequencer command in Ink. I was able to do it in 2.2.15, but after upgrading to 2.2.21 it doesn't work anymore. I mean it clearly sets the timeout because it is visible in the Dialogue System Controller Editor, but it just doesn't do anything anymore.

It is reproducible in the demo contents, just add:

Code: Select all

EXTERNAL Sequence(x)                  // Sequence("sequence"): Plays sequencer commands in string x. Note: Use [[x]] instead of {{x}} for shortcuts.
to the beginning of the story.ink file and then alter the first line of the dialogue like this:

Code: Select all

- I looked at Monsieur Fogg {Sequence("[[default]]; SetTimeout(5);")} # Actor=Player
I think it should make the response menu auto-select the first entry after 5 seconds, but nothing happens.

Re: [Ink Integration] SetTimeout doesn't work anymore

Posted: Fri Oct 15, 2021 4:00 pm
by Tony Li
Hi,

I'll check this out. If I can reproduce it, I'll try to have a fix for you by tomorrow.

Re: [Ink Integration] SetTimeout doesn't work anymore

Posted: Fri Oct 15, 2021 4:53 pm
by nehvaleem
that would be really awesome! Please let me know if I can assist you anyhow :)

Re: [Ink Integration] SetTimeout doesn't work anymore

Posted: Sun Oct 17, 2021 4:40 am
by nehvaleem
Were you able to reproduce this issue?

Re: [Ink Integration] SetTimeout doesn't work anymore

Posted: Sun Oct 17, 2021 10:20 am
by Tony Li
Yes, and just fixed it. The Dialogue System Extras page has an updated Ink integration in the "Updated for 2.2.21" foldout.

Re: [Ink Integration] SetTimeout doesn't work anymore

Posted: Sun Oct 17, 2021 12:08 pm
by nehvaleem
Are you certain that the needed modifications are indeed inside the package? I have downloaded it and only see changes related to disabling force response menu (which I don't yet understand) and in my working project, the SetTimeout doesn't work still.

Re: [Ink Integration] SetTimeout doesn't work anymore

Posted: Sun Oct 17, 2021 1:01 pm
by Tony Li
Did you download and import the package named "DS_InkSupport_2021-10-17.unitypackage"?

The file DialogueSystemInkIntegration.cs should be 836 lines long, where the last line is a blank line.

The md5 checksum of the file is 0e343379506b5dac5c215112bf3d8e6d if you want to check it here.

I tested it with this sequence:

{Sequence("[[default]]; AudioWait(entrytag); SetTimeout(5);")}

When you try it in your project, are there any warnings or errors in the Console window?

Re: [Ink Integration] SetTimeout doesn't work anymore

Posted: Sun Oct 17, 2021 5:00 pm
by nehvaleem
yeah, everything seems ok, but it isn't :) I mean it actually does work on a barebones example project that I've made for the repro, but it does not on my actual project. I'll dig a bit further and see what is going on there. I'll let you know if I discover anything, thanks!

Re: [Ink Integration] SetTimeout doesn't work anymore

Posted: Mon Oct 18, 2021 10:15 am
by nehvaleem
I don't exactly know what happened, but it seems to be working now. Maybe the issue was that I have something like Sequence("Continue(); SetTimeout(5)") before, and the order of the commands matter? One way or another it was probably something on my side.

But it is not the end of my issues!

I've got another question regarding. Imagine a situation when you have a dialogue with 2 choices (not options, ie. the response menu will appear twice), one after another. I would like to set the timeout for the second choice and not repeat sequencer commands at every line that leads to the second choice. What would be the recommended way of doing so? I've tried adding an empty "dummy" line that will contain only sequencer commands and a Continue(), but it leads to the UI behaves funky (it starts showing up and then disappearing).

Below is sample content that should describe this situation more properly. Basically, I would like to make AkirasReply time limited. To do so I have to put sequencer command on every line that leads to this knot (I really would like not to) or put some empty dummy line with only sequencer command and let my UI flicks (I would really not to as well :))

Code: Select all

Sentry Akito: *umm* You may proceed. Master Kenjiro awaits you.

Sentry Jin: But know that we will keep an eye on you, ronin.

    * [Satoru: /Remain silent./] Remain Silent # Actor = Player
    
    -> AkirasReply
    
    * [Satoru: We might be ronin, but we still walk the path of honor.] # Actor = Player
    
    Sentry Jin: And yet, you already forgot when to remain silent... ronin. # Actor = Player
    -> AkirasReply

= AkirasReply

    Akira: Dummy Contents {Sequence("SetTimeout(5); Continue(); HidePanel(0)")} # Actor = Player

    * [Akira: /Remain silent./] Remain Silent # Actor = Player
    
    -> DONE
    
    * [Akira: (whisper) If you ever try to upset my friend again, I will... return here in a few months... and murder your family in their sleep. ] # Actor = Player

    Sentry Jin: Wha- Wh...  

    -> DONE



Apart from that - when using Ink we can write something like this:

Code: Select all

Hello world!
*	[Hello back!] Hello right back to you!
*	[Howdy] Bonjour!
	Nice to hear from you!
and Dialogue System for Unity will respect the bracket contents and display it as an option during the response menu and the rest of the line will be displayed as a subtitle following the response menu. It is currently not possible to run a sequence for displaying an option only (ie when it is being displayed in the response menu), but only for the following subtitle (at the end of the ink line). Would you consider adding this as an option? It would be really useful for me.

Re: [Ink Integration] SetTimeout doesn't work anymore

Posted: Mon Oct 18, 2021 3:31 pm
by Tony Li
Hi,

Let's figure out why the dummy line is flickering. We can either try to figure out where the flicker is from, or bypass it entirely. To bypass it, try this:
  • In your dialogue UI, create another subtitle panel that isn't visible. For example, put a Canvas Group with Alpha=0 on it. Assign this panel to the Standard Dialogue UI component's Subtitle Panels list, and make a note of the element number. This is its panel number.
  • Create an actor for dummy lines (e.g., named "NoShow").
  • Create an empty GameObject for NoShow. Add a Dialogue Actor component. Select NoShow. Set Dialogue UI Settings > Subtitle Panel Number to the invisible subtitle panel's number.
  • In Ink, assign your dummy line to NoShow.
For the second question (run sequence for an option), once we get the flicker issue resolved, can you use a dummy line?