inkle / inky

An editor for ink: inkle's narrative scripting language
http://www.inklestudios.com/ink
2.42k stars 296 forks source link

External Function Invocation Causes Inky Preview To Go Blank #357

Closed marcus-robinson closed 3 years ago

marcus-robinson commented 3 years ago

When adding an external function invocation to an ink file, the preview pane goes blank. There are no errors in the Inky validation UI or in the developer tools console.

Based on this documentation of external functions, I would expect that their invocation would be supported in the Inky editor.

Example Ink file that causes the preview pane to go blank:

EXTERNAL PlayNextFeedback()

Here is the invocation of an external function:
~PlayNextFeedback()

-> END

If you comment out the ~PlayNextFeedback() line, the preview pane displays correctly.

Inky version: 0.12.0 ink version: 1.0 inkjs version: 1.10.2 OS: Win10

Selsynn commented 3 years ago

You have to create a stub/fallback function in the ink code. It will not be called from your full project, but your inky can't know what to do if there is no fallback function. (I agree it's somewhat obscure in the documentation)

It's described here: https://github.com/inkle/ink/blob/master/Documentation/RunningYourInk.md#fallbacks-for-external-functions

marcus-robinson commented 3 years ago

Got it, thanks for clarifying @Selsynn