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

Implement Glue correctly #73

Merged
merged 12 commits into from
Dec 30, 2023
Merged

Implement Glue correctly #73

merged 12 commits into from
Dec 30, 2023

Conversation

JBenda
Copy link
Owner

@JBenda JBenda commented Dec 21, 2023

Now execute after a newline until the next output is generated.
Attention! This can result in the double execution of external functions and double calls from observers, since the variable changes, gets restored and changed again

@LilithSilver
Copy link
Contributor

Seems to be working well for me!

At some point there should be an overload on thread->bind() that lets you pass lookaheadSafe = false to disable gluing past a lookahead-unsafe function, like how the C# library does it. But this works for now, for sure (and since before 1.1 or whenever lookaheadSafe was introduced, Ink required EXTERNAL functions to be pure).

@JBenda
Copy link
Owner Author

JBenda commented Dec 22, 2023

If I understand it correctly, the lookaheadSafe is a flag for a binding, which when true stops looking for a glue, if this function is encountered before execution?

Does it make sense to allow setting a default value or is this just confusing? (Like runner::setLookaheadSafeDefault)

@LilithSilver
Copy link
Contributor

LilithSilver commented Dec 22, 2023

If I understand it correctly, the lookaheadSafe is a flag for a binding, which when true stops looking for a glue, if this function is encountered before execution?

Yep, exactly. If an unsafe EXTERNAL call is encountered, it doesn't run the call and gives up looking ahead, assuming there won't be any glue.

Does it make sense to allow setting a default value or is this just confusing? (Like runner::setLookaheadSafeDefault)

The C# API has lookaheadSafe = false as a default third parameter on Bind. We should probably do similar. I don't think a global default would be useful, since each bound function needs to be considered individually. (For example, a game state getter would be lookaheadSafe, but not a function that plays a sound.)

@JBenda
Copy link
Owner Author

JBenda commented Dec 29, 2023

I just revised that tags can also break glues.
We support lookaheadSafe, now the interface in UE and Python must be adapted accordingly

Copy link

Ink Proof Results

These results are obtained by running the Ink-Proof Testing Suite on the compiled binaries in this pull request.

System Results
Linux x64 130/130 passed
MacOSX DISABLED
Windows x64 DISABLED

@JBenda JBenda merged commit 323dbee into master Dec 30, 2023
7 checks passed
@JBenda JBenda deleted the fix/70 branch December 30, 2023 16:48
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

Successfully merging this pull request may close these issues.

2 participants