ink icon indicating copy to clipboard operation
ink copied to clipboard

Choices working in Inky but not in Unity

Open klootas opened this issue 4 years ago • 8 comments

The following ink works in Inky 0.11.0 (all choices are displayed), but in Unity, only the first choices is displayed:

VAR MyVar = true

  • Yada 1 { MyVar: ++ Yada Yada A +++ Yada Yada Yada ->situationEnd -else: ++ Yada Yada B ->situationEnd } --(situationEnd) ->end -(end)

klootas avatar Dec 16 '20 17:12 klootas

Sounds like an ink version difference to me. This package is on the very latest in the ink repo, do you know what inky is using?

tomkail avatar Dec 18 '20 21:12 tomkail

Thanks for looking into it, do you get the same result as I do in Unity?

Here's what inky is using:

Inky version: 0.11.0 ink version: 0.9.0 inkjs version: 1.10.2

klootas avatar Dec 18 '20 22:12 klootas

image image Seems alright to me! I'd guess your C# script has a bug?

tomkail avatar Dec 19 '20 13:12 tomkail

Interesting...

In Inky, the choice here is displayed: ++ A choice ->end -(end)

Same thing if I run it in the Unity Ink Player. But if I run the actual game, it skips right through to the end gather, I checked the debugger and the story.Choices collection has zero items. Now, if I change the choice to having one plus instead of two, the debugger shows the collection to have one choice (which is displayed in-game). Is this a bug or is there perhaps a setting somewhere to specify this behavior?

Versions: Unity integration version 0.9.71 Ink Story version 20 Inky 0.11.0

klootas avatar Dec 19 '20 14:12 klootas

I have investigated it and it appears to be a bug in story.ChoosePathString(). Here is a version of the demo package that demonstrates the issue (the only changes are the addition of line 19 in BasicInkExample and the content of the ink-file): https://1drv.ms/u/s!Amz_vh8OYDX3vNIoAhIX3RBERGYu-A?e=wPVuiy

To see the way it should work - comment out line 19 in BasicInkExample or change the choice from ++ to + in the ink-file.

klootas avatar Dec 19 '20 23:12 klootas

Right! I've moved this to the main ink repo.

tomkail avatar Dec 20 '20 08:12 tomkail

It's worth noting that weave within a multi-line conditional isn't intended to be supported; the compiler may not complain sufficiently, however. I'm honestly surprised this compiles! I suppose I never checked.

Anyway, you're allowed to include one choice with a multi-line block, with an explicit divert at the end also required.

The reason, incidentally, is because you can't unambiguously use gather - marks inside a multiblock.

joningold avatar Dec 20 '20 15:12 joningold

Thanks for looking into it. I see - yes, then a compiler outcry would be super appreciated :)

The side effect demonstrated in the package still seems relevant though:

= foo This choice is shown when executed in Inky or Unity (as long as it's not invoked through a call to Story.ChoosePathString) ++ Choice // Change to + instead of ++ and the choice is shown correctly regardless of invocation ->end -(end) ->END

klootas avatar Dec 20 '20 15:12 klootas