Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asynchronous function execution #898

Open
15sawyer opened this issue Apr 4, 2024 · 0 comments
Open

Asynchronous function execution #898

15sawyer opened this issue Apr 4, 2024 · 0 comments

Comments

@15sawyer
Copy link

15sawyer commented Apr 4, 2024

Hello,
I have a specific use case and wanted to ask about the suggested solution.

Use case:
At some point, I want to interrupt the story flow and wait until the player inputs something (e.g. clicks on a specific button).

Current approach:
Currently, I run an external function that sets a wait flag. While the wait flag is set, no more lines are read.

Disadvantages:
The disadvantages of this approach are that it requires unnecessary global variables to get some return value from code and that the story doesn't wait until the next line is read, meaning I can't use the "returned" value inside it.

In other languages, this would be solved using asynchronous functions. What's the best solution to this in Ink?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant