Page 1 of 2

Ink choices are being ignored when nested in conditional blocks

Posted: Mon Apr 11, 2022 9:57 am
by nehvaleem
Hi Tony!
I think I have discovered an issue with ink integration. It is connected with the ink integration & choices. More specifically - it seems that the Dialogue System ignores the choices when they are nested in the logical blocks such as if/switch inside the ink.

Given such an example, which is perfectly fine in Ink:

Code: Select all

VAR testBoolean = false


=== 006_Dialogue_Bandits ===

{

- testBoolean == true:

    006/Bandit: But now, we'll make sure that no one remembers... you! 

    * [Woman: You've killed him, haven't you?] 
    
    006/Bandit: Who?
    
    Woman: The xxxxxxxxxxxxxx!
    
    006/Bandit: Xx xxx. Xx xxx One night dry. Good beast.
    
    006/Bandit: One beginning two gathering. Set stars, likeness fowl deep so.
    
    // COMBAT
    
    -> DONE
    
    * [Woman: Man Day his replenish. Over evening fish, greater. Abundantly Shall.]
    
    006/Bandit: Years brought said face seed. Thing together, lights.
    
    Woman: Fourth earth man image place waters place.
    
    // COMBAT
    
    -> DONE

- testBoolean == false:

    006/Bandit: But now, we'll make sure that no one remembers... you!

    * [Woman: Land seas gathered morning one may, fourth be. Greater above.]
    
    006/Bandit: Who?
    
    Woman: Fifth divided forth man green, they're subdue let moving was whose abundantly.
    
    006/Bandit: God first Fruit night creepeth. Together spirit place. Given. Life of midst living.
    
    006/Bandit: And you'll be next!
    
    // COMBAT
    
    -> DONE
    
    * [Woman: Fourth earth man image place waters place.]
    
    006/Bandit: One beginning two gathering. Set stars, likeness fowl deep so.
    
    Woman: Not without reason.
    
    // COMBAT
    
    -> DONE

}
I am getting a conversation that automatically selects the first choice in a given (proper) logical block and follows the flow accordingly, i.e. doesn't give the player the response menu, automatically chooses the first response. I have tested it on an isolated project using the latest version of DS + Ink integration. I can share the repro project if you prefer.

It would be awesome if you could take a look.

Re: Ink choices are being ignored when nested in conditional blocks

Posted: Mon Apr 11, 2022 11:48 am
by Tony Li
Hi,

Thanks for including an Ink example. I'll check it out and post back here.

Re: Ink choices are being ignored when nested in conditional blocks

Posted: Mon Apr 11, 2022 11:56 am
by nehvaleem
Sure, please let me know how can I help.

Also, be sure to run the dialogue with the knot as the entry-point. I think it might run just fine when you treat it as the whole conversation's contents - which isn't possible obviously IRL. But I think that I've made such a mistake when testing and was surprised with the results :)

Re: Ink choices are being ignored when nested in conditional blocks

Posted: Mon Apr 11, 2022 10:44 pm
by Tony Li
How are you testing in Ink? Through the Ink Player editor window?

Re: Ink choices are being ignored when nested in conditional blocks

Posted: Tue Apr 12, 2022 3:21 am
by nehvaleem
I am testing it with standalone Inky, but right now I have run it with the Ink Player editor window and the results are exactly the same, meaning it is working as expected. Please note that in order to run the sample directly in ink (whether it is in the ink player editor window or inky) you have to add a divert manually, like this:

Code: Select all

VAR testBoolean = false

-> 006_Dialogue_Bandits

=== 006_Dialogue_Bandits ===

{

- testBoolean == true:

    006/Bandit: But now, we'll make sure that no one remembers... you! 
(... REST IS THE SAME LIKE IN THE PREVIOUS EXAMPLE)

Re: Ink choices are being ignored when nested in conditional blocks

Posted: Tue Apr 12, 2022 10:56 am
by Tony Li
Got it. I can reproduce that. I'll trace through this and figure out the issue.

Re: Ink choices are being ignored when nested in conditional blocks

Posted: Thu Apr 14, 2022 11:50 am
by Tony Li
Hi,

I think this is working. I made a small change to the Ink integration:

DS_Ink_Support_2022-04-14.unitypackage

This is the test scene I'm using:

DS_Test_006_Bandits_2022-04-14.unitypackage

If that doesn't work the way you want, would you please provide that reproduction project?

Re: Ink choices are being ignored when nested in conditional blocks

Posted: Thu Apr 14, 2022 5:48 pm
by nehvaleem
it seems that it does indeed do something good in my case - meaning the response menu now is showing up.

But - I think that between versions 2.2.21 (that I was using until now) and 2.2.27 there was another change (that I don't understand yet) or bug introduced in ink integration resulting in skipping lines after response selection by the player. This makes me unable to fully test this fix in my project as it breaks the correct flow of my dialogues.

I mean the situation when having a dialogue in ink like this

Code: Select all

* [Akira: /Pet the dog./] 
   Akira: You're so soft. And so warm. {Sequence("Animation(Akira, pets_Inugami)")}
   Inugami: *woof*! 
* [Akira: /Feed the dog./]
    Akira: I've got something for you...
    Inugami: *woof*?
in version 2.2.21 after selecting whichever option by the player it will be displayed again when the appropriate option is being set in the component inspector (which is fine, as Ink basically allows us to have an alternate version displayed in the response menu and another that is being spoken after square bracket - if empty it means it is the same content. More on this topic here: https://github.com/inkle/ink/blob/maste ... hoice-text).

But after upgrading to 2.2.27 (or testing the file that is attached to your message) the behaviour changes and instead it skips to the next line. For example: immediately after selecting option "pet the dog" the line "you're so soft. And so warm." will be displayed. Which is not what I want and not what is happening in 2.2.21.

Re: Ink choices are being ignored when nested in conditional blocks

Posted: Thu Apr 14, 2022 6:52 pm
by Tony Li
Hi,

I think this should fix it:

DS_Ink_Support_2022-04-14-b.unitypackage

Keep the Dialogue System Ink Integration component's "Player Dialogue Text Follows Response Text" UNticked.

Here are the updates to the Ink integration from 2.2.21 to 2.2.27. (From the release notes.)
  • 2.2.25: Fixed issue when resuming a stopped conversation at a point where there are only player choices.
  • 2.2.23: Added 'Force Response Menu For Single Choices' checkbox; updated integration to better handle silent choices in certain configurations.
    2.2.22: Added C# event hook DialogueSystemInkIntegration.loadedStories; respects emphasis settings on dialogue database assigned to Dialogue Manager's Initial Database field; allows conversation-overriding sequencer commands such as SetTimeout() to work.

Re: Ink choices are being ignored when nested in conditional blocks

Posted: Tue Apr 19, 2022 12:46 pm
by nehvaleem
Unfortunately, there is something wrong still (at least for me) when it comes to the response text. For me, it doesn't matter whether "Player Dialogue Text Follows Response Text" is checked or not - the result is always different from what I would expect.

For example:

Code: Select all

006/Merchant: I... I think so. But I cannot ask you to risk your life on my behalf. You would have to face Ushi Oni... # LineTag_01_merchant_0183_20C9597_Merchant

    * [Boy: You are... or you were a good man. I... I just can't agree to leave you like that. !!LineTag_01_merchant_0185_Choice_B045EE6A_Boy] {SetCharacterAttribute("boy","yo",3)} {AddPersonalModifier("boy", "hiroe", "Agreement:3")} # LineTag_01_merchant_0185_DA362F56_Boy
    
    006/Merchant: Honorable boy... Truth be told, I am rather... scared of being trapped in this dead body for all eternity. # LineTag_01_merchant_0187_E9E0327A_Merchant
    
    -> TeamComposition
    
    * [Boy: I am the Scion of Ne-no-kuni. If... if anyone can defeat the monster... it's me. !!LineTag_01_merchant_0191_Choice_25DD5C23_Boy] {SetCharacterAttribute("boy","in",3)} {AddPersonalModifier("boy", "hiroe", "Disagreement:-3")} # LineTag_01_merchant_0191_3FB99A45_Boy
    
    006/Merchant: A Scion? Forgive me, brave boy, I've never heard the term. But... # LineTag_01_merchant_0193_259815A0_Merchant
    
    006/Merchant: Truth be told, I am rather... scared of being trapped in this dead body for all eternity. # LineTag_01_merchant_0195_AF7DF15C_Merchant
    
    -> TeamComposition
Selecting the first option, I would expect the system to display the line spoken by the Boy with the contents of "You are... or you were a good man. I... I just can't agree to leave you like that. ". But instead, it displays the previous line (meaning the contents "I... I think so. But I cannot ask you to risk your life on my behalf. You would have to face Ushi Oni..." with the altered speaker changed to "Boy").

The behavior above is happening with 2.2.27 + the latest Ink Integration from this thread

On n AssetStore version of 2.2.27 the behavior is slightly different, I think it doesn't show player response at all.

This makes me unable to proceed further with testing the real bug/issue described in the very first post in this thread.

Please note I am working on a game with several "player" actors, maybe it is making DS go crazy?