ephread / inkgd

Implementation of inkle's Ink in pure GDScript for Godot, with editor support.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiline functions are executed all at once

2shady4u opened this issue · comments

Describe the bug
Putting multiple functions on different lines results in all these functions being executed at once without any respect for the new line.

To Reproduce

  • Make a new Godot project
  • Download and activate the inkgd plugin from the Asset Store
  • Download the examples-folder from the Github repository
  • Take the minimum ink-file I supplied below and copy-paste it into the "Interceptor.ink" and rebuild the JSON using inklecate
  • Change the "bind_externals" function (found in ink_runner.gd) to:
func _bind_externals():
    story.observe_variables(["currentActor"], self, "_observe_variables")
    #story.bind_external_function("should_show_debug_menu", self, "_should_show_debug_menu")
  • Run the ink_runner.tscn and see what happens.

OUTPUT in game:

It's Philippe!

It's Andre!

It's Andre!

choose Andre

It's Philippe!

(story complete)

Expected behavior
As seen in both Quill and Inky I expect the function, that is part of the new line to only be executed AFTER the current line, and thus give following output for the script given below:

It's Philippe!

It's Andre!

It's Philippe!

choose Andre

It's Philippe!

(story complete)

Ink files

VAR currentActor = "player"

VAR s = -> set_actor
-> start

===function set_actor(x)
{ x:
- "P": ~ currentActor = "Philippe"
- "A": ~ currentActor = "Andre"
- else: ~ currentActor = "player"
}

=== start ===
{s("P")} It's {currentActor}!
{s("A")} It's {currentActor}!
{s("P")} It's {currentActor}!
{s("A")}
+ choose {currentActor}
    {s("P")} It's {currentActor}!
    -> END
+ choose {currentActor}
    {s("A")} It's {currentActor}!
    -> END

Environment:

  • OS: Windows
  • Inklecate version: 0.9.0
  • inkgd version: 0.1.3

Additional context
I currently don't have a work-around for this problem....

Thanks for reporting the issue @2shady4u, I won’t have access to a computer before the 18th of December, but I’ll investigate as soon as I’m back from my little trip. This is a significant issue.

Seems to be fixed on master, I tested with files from both inklecate 0.8.3 and 0.9.0 and compared with Inky's output.