[Ink Integration] SetTimeout doesn't work anymore

Announcements, support questions, and discussion for the Dialogue System.
nehvaleem
Posts: 96
Joined: Tue Sep 10, 2019 4:52 am

[Ink Integration] SetTimeout doesn't work anymore

Post 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.
User avatar
Tony Li
Posts: 22158
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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.
nehvaleem
Posts: 96
Joined: Tue Sep 10, 2019 4:52 am

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

Post by nehvaleem »

that would be really awesome! Please let me know if I can assist you anyhow :)
nehvaleem
Posts: 96
Joined: Tue Sep 10, 2019 4:52 am

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

Post by nehvaleem »

Were you able to reproduce this issue?
User avatar
Tony Li
Posts: 22158
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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.
nehvaleem
Posts: 96
Joined: Tue Sep 10, 2019 4:52 am

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

Post 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.
User avatar
Tony Li
Posts: 22158
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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?
nehvaleem
Posts: 96
Joined: Tue Sep 10, 2019 4:52 am

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

Post 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!
nehvaleem
Posts: 96
Joined: Tue Sep 10, 2019 4:52 am

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

Post 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.
User avatar
Tony Li
Posts: 22158
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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?
Post Reply