inkle / ink

inkle's open source scripting language for writing interactive narrative.
http://www.inklestudios.com/ink
MIT License
4.07k stars 489 forks source link

Unity currentChoices.Count giving wrong value? #837

Open PurplePickard opened 1 year ago

PurplePickard commented 1 year ago

Hi, sorry if this isn't the right place to ask questions like this, but I don't really know where to get help for things like this...

I've got an existing system in Unity that lets me talk to NPCs with Ink and go through branching dialogue with them. It's been working fine so far, except today when I wanted to add in a button to loop back around to the knot with the initial options in it. Should be easy, right?

Well, for some reason, when I get to my new knot with 2 choices in it, currentChoices.Count is telling me that there are no choices, and is instead continuing as if I picked the second choice.

Some screenshots to try and show what's happening: The Ink knot that's behaving weirdly: Ink knot that's behaving weirdly C# code that checks the amount of choices: C# code that checks the amount of choices currentChoices.Count printing 0 despite being at the knot with 2 choices: currentChoices.Count printing 0

I really don't know what's going wrong here, since my Ink code is written like everything I've done previously, and everything worked until I added this knot today. Is this a bug? Or am I doing something wrong?