Learning Ink Script - Tutorial Six

  • Edwin McRae

I’m Edwin McRae, Narrative Designer and Interactive Fiction Writer, and this is Tutorial Six in my…

Ink Script Tutorial Series

Last time we learned how to wrangle Conditional Text, the ability to show different pieces of text based on the choices the reader has made earlier in the story. This time, let's apply that same technique to choices. As we've all experience in life, the choices we make today affect the selection of choices we make tomorrow.

If I choose to finish of the last jar of Pic's Peanut Butter today (which I'm likely to do because it's bloody irresistible) then I can't very well make that same choice tomorrow because the peanut butter is gone...noooooo!

So let's play that out in Ink Script right now.

Setting up Conditional Options

I'm going to use a lot of Knots and Stitches so that we have plenty to work with when it comes time to create our conditional options. Remember, Ink is able to track which Knots and Stitches a reader has visited, so the more we have, the more conditions we have to play with.

-> Eat_Today

=== Eat Today ===

Uh oh, looks like I'm down to my last scraps in the pantry and payday isn't for two days so I'm going to have to work with what I have.

+ The last spoonful of Pics Peanut Butter.

-> Peanut_Butter

+ The lone blueberry muffin.

-> Blueberry_Muffin

+ A quarter bag of cornflakes. No soy milk.

-> Dry_Cornflakes

= Peanut_Butter

Oh Pic's, you're so fine, you're so fine you blow my mind, of piccies, clap clap, oh piccies!

-> Day_Passes

= Blueberry_Muffin

A little stale yet not too bad once I nuked it in the microwave for twenty seconds.

-> Day_Passes

= Dry_Cornflakes

Dry cornflakes...just like popcorn. Yeah, you keep telling yourself that.

-> Day_Passes

= Day_Passes

An exciting day passes, filled with japes, chicanery and meaningful choices galore. In the process, you've completely forgotten about what you had for breakfast.

+ It's a new day.

-> Eat_Tomorrow

=== Eat_Tomorrow ===

-> DONE

That last section, Day_Passes, is there to help us imagine that we're dealing with delayed consequences, not instant gratification.

Conditional Options

Now we'll get down to the business of designing our conditional options, enabling Ink to show or hide different options based on what the reader has chosen previously, according to the Knots/Stitches that they've already visited.

A conditional option looks like this…

 

+ {Eat_Today.Peanut_Butter < 1} The last spoonful of Pics Peanut Butter.

-> Pay_Day

 

This option will now only show up if the reader has visited the Peanut_Butter Stitch that’s inside the Eat_Today Knot less than one time.

I could also use {Eat_Today.Peanut_Butter == 0} but they basically do the same thing in this example. The option will only be displayed if the reader hasn’t visited Eat_Today.Peanut_Butter.

This is what it looks like when I write out all of the options for Eat_Tomorrow.

 

-> Eat_Tomorrow

=== Eat_Tomorrow ===

It's a new day and it's time for breakfast. But alas, payday is still tomorrow!

+ {Eat_Today.Peanut_Butter < 1} The last spoonful of Pics Peanut Butter.

-> Peanut_Butter

+ {Eat_Today.Blueberry_Muffin < 1}The lone blueberry muffin.

-> Blueberry_Muffin

+ {Eat_Today.Dry_Cornflakes < 1} A quarter bag of cornflakes. No soy milk.

-> Dry_Cornflakes

= Peanut_Butter

Oh Pic's, you're so fine, you're so fine you blow my mind, of piccies, clap clap, oh piccies!

-> Pay_Day

= Blueberry_Muffin

A little stale yet not too bad once I nuked it in the microwave for twenty seconds.

-> Pay_Day

= Dry_Cornflakes

Dry cornflakes...just like popcorn. Yeah, you keep telling yourself that.

-> Pay_Day

=== Payday ===

-> DONE

 

Give that a test in Inky. What should happen is that the option you selected in Today disappears from the options listed for Tomorrow.

Also, see how I’ve been able to reuse the names of Stitches within different Knots? Handy, eh?

And that’s pretty much how Conditional Options work when it comes to using them with Knots and Stitches. Now, we can also use Conditional Options with Variables, but that’s a whole new kettle of chocolate fish that we’ll tangle with in the next lesson.

 

For now, let’s finish our little culinary tale off with a tidy ending.

 

=== Payday ===

Yay, there’s money in my bank account. Time to go to the supermarket!

Shopping List

{Eat_Today.Peanut_Butter > 0: Pic's Peanut Butter}

{Eat_Tomorrow.Peanut_Butter > 0: Pic's Peanut Butter}

{Eat_Today.Blueberry_Muffin > 0: Blueberry muffin}

{Eat_Tomorrow.Blueberry_Muffin > 0: Blueberry muffin}

{Eat_Today.Dry_Cornflakes > 0: Cornflakes}

{Eat_Tomorrow.Dry_Cornflakes > 0: Cornflakes}

And other stuff.

-> END

 

Btw, tells Inky to bold the text that follows and tells Inky to stop bolding.

I reckon that’ll do us for now. We’ll see you in the next tutorial where we learn to use Variables that we can get even more advanced with conditional text and options!

 

Oh...and I’m going to start doing this at the end of my tutorials. Here’s the complete, working Ink Script for this example, just in case you have trouble fitting the above pieces together.

 

Good luck!


 

-> Eat_Today

=== Eat_Today ===

Uh oh, looks like I'm down to my last scraps in the pantry and payday isn't for two days so I'm going to have to work with what I have.

+ The last spoonful of Pics Peanut Butter.

-> Peanut_Butter

+ The lone blueberry muffin.

-> Blueberry_Muffin

+ A quarter bag of cornflakes. No soy milk.

-> Dry_Cornflakes

= Peanut_Butter

Oh Pic's, you're so fine, you're so fine you blow my mind, of piccies, clap clap, oh piccies!

-> Day_Passes

= Blueberry_Muffin

A little stale yet not too bad once I nuked it in the microwave for twenty seconds.

-> Day_Passes

= Dry_Cornflakes

Dry cornflakes...just like popcorn. Yeah, you keep telling yourself that.

-> Day_Passes

= Day_Passes

An exciting day passes, filled with japes, chicanery and meaningful choices galore. In the process, you've completely forgotten about what you had for breakfast.

+ [It's a new day!]

-> Eat_Tomorrow

=== Eat_Tomorrow ===

It's a new day and it's time for breakfast. But alas, payday is still tomorrow!

+ {Eat_Today.Peanut_Butter < 1} The last spoonful of Pics Peanut Butter.

-> Peanut_Butter

+ {Eat_Today.Blueberry_Muffin < 1}The lone blueberry muffin.

-> Blueberry_Muffin

+ {Eat_Today.Dry_Cornflakes < 1} A quarter bag of cornflakes. No soy milk.

-> Dry_Cornflakes

= Peanut_Butter

Oh Pic's, you're so fine, you're so fine you blow my mind, of piccies, clap clap, oh piccies!

-> Pay_Day

= Blueberry_Muffin

A little stale yet not too bad once I nuked it in the microwave for twenty seconds.

-> Pay_Day

= Dry_Cornflakes

Dry cornflakes...just like popcorn. Yeah, you keep telling yourself that.

-> Pay_Day

=== Pay_Day ===

Yay, there’s money in my bank account. Time to go to the supermarket!

Shopping List

{Eat_Today.Peanut_Butter > 0: Pic's Peanut Butter}

{Eat_Tomorrow.Peanut_Butter > 0: Pic's Peanut Butter}

{Eat_Today.Blueberry_Muffin > 0: Blueberry muffin}

{Eat_Tomorrow.Blueberry_Muffin > 0: Blueberry muffin}

{Eat_Today.Dry_Cornflakes > 0: Cornflakes}

{Eat_Tomorrow.Dry_Cornflakes > 0: Cornflakes}

And other stuff.

-> END

 

Now let's head over to Tutorial Seven to learn a more advanced way to track your player's actions. Variables!

 

 

For an example of my Ink Script work in full swing, you can download Guardian Maia Ep1 for free from Google Play and the Apple Appstore

You will guide a Māori warrior woman, Māia, on an interactive science-fiction adventure where your decisions mean life or death for your courageous heroine!

 

About Edwin McRae

Edwin is a narrative consultant and mentor for the games industry.

Share this post