paulloz/godot-ink

Selecting choices skips the following line?

Closed this issue · 4 comments

In the story inspector (haven't tried this in my own code yet), selecting a choice doesn't display the text of the choice nor the text immediately following it in the output. For example, with The Intercept:

- 	They are keeping me waiting. 
		*	Hut 14[]. The door was locked after I sat down. 
		I don't even have a pen to do any work. There's a copy of the morning's intercept in my pocket, but staring at the jumbled letters will only drive me mad. 
		I am not a machine, whatever they say about me.

The output gets displayed as this:

They are keeping me waiting.
---
I don't even have a pen to do any work. [...]

As you can see, it doesn't display the line that should be following after the first: Hut 14. The door was locked after I sat down.
Is there a reason for this? Is this only a problem with the inspector, or will I see this problem in my code too?

It's just an issue with the dock, I forgot to display the line before continuing the story here.

I noticed this problem immediately in my game. I'm pretty sure it is not at all an issue with the dock.

This is a pretty massive and transparent issue, so I'm greatly concerned. I couldn't figure out why else it was skipping the following line when my code is identical to my code in Unity.

I noticed in the ChooseChoiceIndex() method, it pushes the story forward for seemingly no reason? The Unity Inkle plugin code doesn't do this, so I just commented it out.

	public void ChooseChoiceIndex(int index)
	{
		if (index >= 0 && index < this.story?.currentChoices.Count)
		{
			this.story.ChooseChoiceIndex(index);
			//this.Continue();
		}
	}

And now it works. Of course I don't know if this adds additional bugs or why it was there in the first place, but this is the reason why in-game you can make a choice and it will skip the following line that comes after the choice (and I guess also the line itself too)?

Just out of curiosity - what is that (Continue()) line there for?

Hi @CarterG81.
So, no, this call to .Continue() isn't random nor here for no reason.
It's an artifact from when this wasn't a standalone project but just a part of my game loop. I'd agree from an API design standpoint it'd be more logical to either not continue here or for the entire method to return a string to be on par with the .Continue() method.
In essence no line is skipped it only depends on when you choose to display your content.
Anyways, I'll make this change in the next release as like you hinted the goal would be to be able to use your code from Unity and have everything working as intended.
Thanks.

This is fixed on master.