inky icon indicating copy to clipboard operation
inky copied to clipboard

inky playback fails if you call an external function without a fallback

Open joningold opened this issue 7 months ago • 2 comments

The following source causes an immediate, silent "End of Story"; it should produce a "no fallback exists!" error or equivalent.

~ functionCall ()

EXTERNAL functionCall ()

joningold avatar May 17 '25 09:05 joningold

Given the following Ink, I expect Inky to print "We are in the start knot", but it produces "End of Story" immediately when it reaches ~ listen(...).

Does this mean we cannot use Inky to write and test when EXTERNAL functions are used?

EXTERNAL listen(knot_name, event)

~ listen("encounter_win", "win_event")

-> start

=== start ===
We are in the start knot
--> END

jakesee avatar Jun 27 '25 12:06 jakesee

Given the following Ink, I expect Inky to print "We are in the start knot", but it produces "End of Story" immediately when it reaches ~ listen(...).

Does this mean we cannot use Inky to write and test when EXTERNAL functions are used?

You can. But you need to define a fallback - an inky-only version of the function (which might replicate that functions behaviour, or do nothing, depending on your needs). However, ink should report if there isn't one, rather than failing without a report.

joningold avatar Jun 27 '25 13:06 joningold