godot-ink icon indicating copy to clipboard operation
godot-ink copied to clipboard

InkStory.ChoosePath() inaccessible

Open wolfrug opened this issue 1 year ago • 1 comments

In the Unity integration it is possible to access InkStory.ChoosePath(Ink.Runtime.Path) directly, but this is not possible in the Godot wrapper. To get a Path, you also need to collect it from a Choice (using choice.targetPath), which is not currently possible either.

The targetPath can be gained by adding the following to to InkChoice.cs:

public Ink.Runtime.Path TargetPath => inner.targetPath;

After that, ChoosePath can be accessed by adding the following to InkStory.cs:

public void ChoosePath(Ink.Runtime.Path path)
{
        runtimeStory.ChoosePath(path);
}

Reproduction Simply try to access either the InkChoice.targetPath or InkStory.ChoosePath methods.

Environment

  • OS: Windows 10
  • Godot version: 4.1 NET
  • godot-ink version: 1.0.0
  • ink version: 1.1.1

Additional context

wolfrug avatar Sep 15 '23 20:09 wolfrug

As I was saying on Discord, both Ink.Runtime.Choice.targetPath and Ink.Runtime.Story.ChoosePath() are members that used to be inaccessible and encapsulated. Their front-facing counterpart (working on/with string paths) are already accessible:

  • Ink.Runtime.Choice.pathStringOnChoice through GodotInk.InkChoice.PathStringOnChoice
  • Ink.Runtime.Story.ChoosePathString() through GodotInk.InkStory.ChoosePathString()

As such, I consider that this is functionally covered for now. When the roadmap is less crowded, I'll be able to implement the necessary wrapper to Ink.Runtime.Path.

paulloz avatar Sep 15 '23 21:09 paulloz