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

Update WritingWithInk.md #277

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

dexterlohnes
Copy link

I ran into an issue within a scene I was writing in Inky where my temp variables were seemingly not being assigned to, but I could reference them for conditional logic calculations. I discovered that the issue was that the scene was not placed within a knot at all. I had merely started writing Ink at the top of the file with no knot containing it. Once I moved all my text into a top-level knot AND moved the temp variable declaration to the top of the knot – previously it was declared inline within a weave – everything worked perfectly.

I ran into an issue within a scene I was writing in Inky where my temp variables were seemingly not being assigned to, but I could reference them for conditional logic calculations. I discovered that the issue was that the scene was not placed within a knot at all. I had merely started writing Ink at the top of the file with no knot containing it. Once I moved all my text into a top-level knot AND moved the temp variable declaration to the top of the knot – previously it was declared inline within a weave – everything worked perfectly.
@inquisitivecrystal
Copy link

You may want to move the TODO, as I believe it's referencing the paragraph before yours.

@dexterlohnes
Copy link
Author

Thanks @bookofportals. Good catch.

@joethephish
Copy link
Member

Apologies for the ridiculously long wait to take a look at this PR!

It should actually be possible to write most ink outside of a knot, including temporary variables, though this is probably not as thoroughly tested since it's more unusual. It is however true that temp variables need to be defined before usage.

Have you got an example of usage that was failing for you? (Sorry this is very late so you may not remember!)

@clembu
Copy link

clembu commented Jan 29, 2018

Well, temporary variables can be defines outside of a knot, but they won't be temporary at all.

I wrote this bit in Inky:

This is consistent with the fact that a temporary variable declared within a knot (but not in a stitch) will be available to use in the stitches in the knot, seeing as the JSON structure Story->Knot is the same as Knot->Stitch and that the ink engine will never want to care if you're in the root container or not (except for path resolution)

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.

None yet

4 participants