ephread / inkgd

Implementation of inkle's Ink in pure GDScript for Godot, with editor support.
MIT License
305 stars 33 forks source link

continue_story_maximally() does not concatenate multiple lines as expected #79

Open Bard09 opened 7 months ago

Bard09 commented 7 months ago

Describe the bug Calling the continue_story_maximally() method in ink_player.gd (both on the current & godot4 branches) does not concatenate as the description states. It only returns the last rendered line from Ink.

To Reproduce Call continue_story_maximally() when there are multiple rows of Ink text that need to be returned. Only the last line will appear.

Expected behavior All lines before the choice stopping point appear as rendered in native Ink.

Ink files ink_player.gd

Environment:

francoisdlt commented 5 months ago

Same problem here. This is how I've worked around the issue :

diff --git a/addons/inkgd/ink_player.gd b/addons/inkgd/ink_player.gd
--- a/addons/inkgd/ink_player.gd
+++ b/addons/inkgd/ink_player.gd
@@ -418,13 +418,11 @@
    if _story == null:
        _push_null_story_error()
        return ""

-   var text: String = ""
+   var text: String = self.current_text
    if self.can_continue:
-       _story.continue_story_maximally()
-
-       text = self.current_text
+       text += _story.continue_story_maximally()

    elif self.has_choices:
        emit_signal("prompt_choices", self.current_choices)
    else: