Tutorials – sub-Q Magazine https://sub-q.com Interactive fiction lives here. Sun, 29 Nov 2020 22:03:46 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.17 What the Heck is Interactive Fiction? A Guide for Authors. https://sub-q.com/what-the-heck-is-interactive-fiction-a-guide-for-authors/ Tue, 12 Feb 2019 21:07:02 +0000 https://sub-q.com/?p=4544 One question we commonly get when we invite people to write things for sub-Q is some variation on: What the heck is Interactive Fiction? And—let’s be real—it’s a pretty good question. Searching Google for “what is interactive fiction” brings up lots of results; people have written whole books on the question. (If you want a […]

The post What the Heck is Interactive Fiction? A Guide for Authors. appeared first on sub-Q Magazine.

]]>
One question we commonly get when we invite people to write things for sub-Q is some variation on:

What the heck is Interactive Fiction?

And—let’s be real—it’s a pretty good question.

Searching Google for “what is interactive fiction” brings up lots of results; people have written whole books on the question. (If you want a whole book, try Nick Montfort’s Twisty Little Passages or Jimmy Maher’s Let’s Tell a Story Together.)

But a lot of those posts are targeted at readers/players of Interactive Fiction (commonly shortened to IF), or scholars, or students, or people who want to learn about the whole history of IF. A number of others use terminology that is non-standard to authors, and which—as a result—confuse more than they clarify.

So why do we need another post to add to the mess?

Because this post is specifically for authors of fiction who want to branch out and try their hand at writing IF.

Basic Definitions

It’s part game. It’s part story. But what is it, exactly?

At sub-Q, we have a very broad definition:

Interactive Fiction is any story which cannot be told without interaction from its reader.

Since we’re an online magazine, that “interaction” takes the place of some kind of browser interaction: the reader clicks a link to make a choice; the reader types in a command which reveals some new aspect of the story.

Others in the IF community use different, or more specific definitions, but that’s ours and we’ll stick by it.

Here are some other common terms:

Comp – A game writing competition, usually just for works of Interactive Fiction. Sometimes features prizes.

Hypertext Fiction – Fiction which uses HTML or other web-based technologies for interaction.

Parser – A parser is a program which takes input from the reader/player and interprets (parses) it, making it possible for them to interact with the story. (Largely for historical reasons, some people define IF to only include works which use a parser.)

Gamebook – A printed book, where the reader makes choices that affect the story, usually by choosing which page to turn to after each section. Think the Choose Your Own Adventure series of books.

Game Jam – A game writing competition, usually hosted on itch.io. Sometimes features prizes.

Text Adventure – Sometimes used as a synonym for IF, again usually to refer to pieces written with a parser.

So how do I write IF?

Writing IF is a bit like writing any other kind of fiction, but because it’s interactive, there are also elements of game design: You need to have a plan for how the reader’s interaction will affect the game, as well as considering elements like plot, characterization, and so on.

Bruno Dias has written a whole series of essays for us that are entirely about techniques for writing IF. His 2-part series on narrative design for writers lays out the groundwork of what, exactly, you’ll need to think about when you’re writing IF. Other essays go into more detail on branching, merging, and more specific details.

Beyond the basics, a lot depends on the tool you’re using to create your piece of IF.

If you’re going to use a parser, you’ll need to think about layout of the story’s “map”; if you’re using hypertext and expect users to click on links, you’ll want to figure out how the reader moves from passage to passage; if you’re writing in choicescript you’ll need to determine whether the choices players make affect stats, and how to control what choices are available later in the game. And so on and so forth.

Here are some of the more common tools people use to write IF, in alphabetical order:

  • ChoiceScript – Proprietary language used by Choice of Games, works kind of like a virtual gamebook. (sub-Q has an agreement with Choice of Games allowing authors to publish choicescript works in our magazine.)
  • Inform – A parser which uses natural language for coding, instead of typical “programmer” type code. (Manuals available online.)
  • Ink – The scripting language used by inkle, available as Open Source for anyone to use.
  • Twine – Web-based tool for writing web-based interactive fiction. You don’t need to know any code to write in Twine. (With Twine, the theme you use will also change how you code.) Most of the games sub-Q publishes are written using Twine, so it’s a popular choice.

The huge amount of options for authoring IF is something that takes getting used to. The simplest approach might be to look through these, pick one that seems like you can handle it, and stick to that until you’re more comfortable with writing IF.

If you’re just starting out, and feel overwhelmed, Twine is probably the most accessible tool.

Emily Short has a post about the importance of choosing a tool when writing IF, which includes some other available tools.

Converting Fiction to IF

That sounds like a lot of work. Can’t you just take a piece of regular fiction and turn it into interactive fiction?

Sure. You can. And in fact, we’ve done just that with some of our published stories. (

Here are some hints, if you want to take this approach:

Pick a shorter story – Stories grow when you make them interactive.

Think about the choices your characters make – Find choices that would make the story turn out differently; these will serve as places where the narrative branches.

Think about how you display text on the page – Does all the text have to be there, in the order you’ve presented it? Can you give the reader the illusion of interactivity by pulling out extended descriptions and putting them behind links?

Think outside the page – Don’t get stuck in “X is in my story; X must be in the IF as well.” Can you pull descriptions from your story and use them as room descriptions in a piece of parser fiction, where the reader gets to direct a protagonist through the plot on their own?

A classic example of a piece of fiction adapted to IF in this way is Douglas Adams’s Hitchhiker’s Guide to the Galaxy. The IF hits many of the same plot points as the novel, but is re-told using a parser. It’s definitely still Hitchhiker’s, but it’s definitely not the same as the novel. (And it’s infamously more frustrating!)

You can also see our post, Writing Interactive Fiction in 5000 Words or Fewer, for more suggestions..

Get Involved!

If you really want to write IF, the best thing to do is get involved with the community. (The same is true, for what it’s worth, of any kind of fiction writing!)

Here are some links to get you hooked in:

  • Narrative Games Discord – A chat server to talk about all things narrative gaming.
  • IntFiction forum – Online forum for the interactive fiction community.
  • Choice of Games forum – Online forum for Choice of Games writers and readers.
  • Twine Discord – A chat server for users of Twine
  • Itch.io – Online marketplace for independent video game creators. Check out the game jams!
  • IFDB – Online database of published works of IF, edited by users.
  • IFComp – Annual competition for works of IF.

Further Reading

If you’re still not sure what the heck this IF thing is, or just want to learn more, here are some good places to do that:

The post What the Heck is Interactive Fiction? A Guide for Authors. appeared first on sub-Q Magazine.

]]>
Writing Interactive Fiction in 5000 Words (or Fewer!) https://sub-q.com/writing-interactive-fiction-in-5000-words-or-fewer/ Tue, 31 Jul 2018 21:21:18 +0000 https://sub-q.com/?p=4131 One of the things we often hear submitters to sub-Q mention is how challenging it is to write a piece of interactive fiction that fits within our 5000-word limit. And that makes sense. With the possibility for word-bloat that IF’s branching narratives and variables introduce, telling a story in such a small space can be a challenge. […]

The post Writing Interactive Fiction in 5000 Words (or Fewer!) appeared first on sub-Q Magazine.

]]>
One of the things we often hear submitters to sub-Q mention is how challenging it is to write a piece of interactive fiction that fits within our 5000-word limit.

And that makes sense. With the possibility for word-bloat that IF’s branching narratives and variables introduce, telling a story in such a small space can be a challenge. Happily, it can be overcome!

Here are six ideas to explore the next time you sit down to write short IF:

  • Delayed Branching – Branching, or letting the reader’s choices affect the progression of the narrative, can add a lot of words to a piece of IF. Beyond the need to write additional, alternative versions of scenes, branching adds a lot of complexity elsewhere as well. If you are telling a branching narrative, consider using delayed branching, where a reader’s choice affects a variable which does not come into play until later in the story. Dan Fabulich of Choice of Games has a great description of how delayed branching can make interactive storytelling more effective and enjoyable.

  • Non-narrative Storytelling – Although many pieces of IF follow what might be termed a traditional story structure, there’s no reason this has to be true. Break out of that beginning-middle-end! Try a circular narrative. Give the reader multiple entry points. Innovate! What do you really need to tell a story? What can you do without? Hannah Powell-Smith’s eerie “Nine Moments in Fairyland” is a perfect example.

  • Procedural Text GenerationEmily Short has a lengthy post on the various ways IF can or could use this technique.

  • Break Out the Parser – We love Twine as much as the next person, but its hypertext base means that authors often stick to more traditional styles of storytelling, describing every action characters take to move the plot along. With Inform or another parser-based language, you can have readers provide the actions themselves, freeing up words for you to use elsewhere. And parser-based doesn’t have to mean Adventure-style exploration, either — check out Caleb Wilson’s trippy, mind-blowing “Lime Ergot”.

  • Scale Back – Everyone loves an open world with epic scope and universe-shattering stakes, but that kind of story needs a lot of room. And there are other types of story that can be just as satisfying. In fact, the way IF relies on the reader’s agency to make decisions means that even small decisions can carry a lot of weight — both for the reader and for your story’s characters.

  • Constrain Your Readers Scope isn’t the only way you can keep your audience engaged in the story you’re telling. Interactive Fiction comes with any number of ways to keep your readers focused and ready to act. For example, a timer can compel them to move through scenes without dithering, or can force them to really examine choices they make by limiting the number.  JY Yang’s powerful “Before the Storm Hits” does this very well indeed.

The post Writing Interactive Fiction in 5000 Words (or Fewer!) appeared first on sub-Q Magazine.

]]>
Submitting Interactive Fiction Proposals to sub-Q Magazine https://sub-q.com/interactive-fiction-proposals/ Tue, 26 Dec 2017 14:00:18 +0000 https://sub-q.com/?p=3678 Got a great story you want to see made into a piece of interactive fiction, but terrified of learning how to code? No sweat! This blog post will walk you through the process of creating an interactivity proposal for a completed short story. What is an interactivity proposal? Simply put, it’s a document that includes […]

The post Submitting Interactive Fiction Proposals to sub-Q Magazine appeared first on sub-Q Magazine.

]]>
Got a great story you want to see made into a piece of interactive fiction, but terrified of learning how to code? No sweat! This blog post will walk you through the process of creating an interactivity proposal for a completed short story.

What is an interactivity proposal? Simply put, it’s a document that includes the complete prose of your story plus an explanation (graphical, textual, or otherwise) of how it could be transformed into a piece of interactive fiction.

What is interactive fiction?

That’s a more difficult question: As the annual Interactive Fiction Competition notes, the meaning of the phrase is “subject to changing context and culture”. Interactive Fiction lives at the intersection of the game and the story, of the reader and the player, of the analogue and virtual. Something like that, anyway. There are plenty of great resources on our “Ideas and Resources” page.

What matters to you, would-be Interactive Fiction author, is that we’re happy to find someone to make your story interactive for you, so long as you can give us a clear idea of how it would be done.

First, though, we want to see the story you’re submitting. We prefer submissions to follow Standard Manuscript Format (SMF), although we have a preference for Times New Roman over SMF’s usual Courier. And–as you can see from this sample proposal–we’re a bit more open to seeing links and other kinds of special formatting, as well.

What else is important for a sub-Q submission?

  • Your story should be no more than 5000 words across all possible playthroughs, and no more than 3500 words on a single playthrough.
  • Our minimum wordcount is 1000 words.
  • We prefer 1st and 3rd person point of views, and stories that show the reader things they’ve never seen before.
  • sub-Q‘s submission process is anonymous. After you’ve put your proposal together, you should make sure you’ve stripped any identifying information from your file.
  • We particularly love seeing submissions from creators of color, creators with disabilities, and creators from the QUILTBAG community, and encourage you to include that information in a cover letter if you feel comfortable doing so. Note that cover letters are only visible to the editor-in-chief, and self-reporting of this nature is entirely optional.

To review, then, the first part of your interactivity proposal is your completed story, in a reasonable approximation of SMF, and otherwise meeting our guidelines.

Now let’s move on to the actual proposal part of your submission, where you’ll tell us in as much detail as possible how the story can be turned from prose to a dynamic piece of interactive fiction.

Interactivity Proposal

Your interactivity proposal can be included at the end of your completed prose in a single document, or you can use a number of separate files and compress them all into a single *.zip file for submission when you’re done.
There are a million ways to describe how a piece of text can be made interactive, and a lot of how you proceed at this point is going to depend on your story, your vision for its interactive future, and whether you’re a textual thinker, a visual thinker, or some other kind of thinker. (Submissions which involve punching the editors to prove a point about ‘tactile thinking’ are unlikely to be well-received.) If you have art you’d like to use with the story, either as a cover or internally, please include that as well, with the permission of the artist if the art is not yours.

Interactivity proposals can be as simple or as complicated as you like, so long as they let us know how a story might be turned into a piece of IF.

Describing Interactivity

Written Description

Basically, think about what best defines your vision for your story’s interactivity and run with it.

For example:

My story “Interactivity Proposal for Sub-Q Magazine” is the riveting tale of how to submit a complete short story to Sub-Q magazine for consideration without making it interactive first. The story would be displayed one paragraph at a time, with a link at the end of each section asking the reader if they have learned how to format an interactivity proposal yet or not.

Each time the reader clicks “no,” they lose five hit points before progressing to the next paragraph. When the reader runs out of hit points, the game is over and they receive the “ultimate rejection” ending. If the reader makes it to the end of the game without running out of hit points, they receive the “successful submission ending.”

Flowchart

Since many pieces of Interactive Fiction involve “rooms” (literal or otherwise), flowcharts are an easy way to visually describe how your story connects. If you have a recent version of Microsoft Word, you can create a flowchart using the SmartArt tool. There are also flowchart templates online for various word processors or graphical editing programs, as well as online programs like http://moqups.com. Hand-drawn flowcharts are fine, too, so long as you write neatly!

example of a flowchart describing two paragraphs of gameplay, with arrows to show how gameplay proceeds

Other Diagram

There are many other kinds of diagram that lend themselves to describing interactivity. Tree diagrams, hierarchies, UML activity diagrams, etcetera. As with flowcharts, many of these can be created natively in the more recent versions of Microsoft Word by using the SmartArt tool, created from templates online, or hand-drawn and scanned in.

example of a diagram, with descriptions of two scenes of gameplay

Links to Examples

It can sometimes be helpful to provide a link to an example piece of Interactive Fiction that you think would be a good model to use for your own.

For example:

Because of the untrammeled genius of my creation, the best way to represent it as a piece of interactive fiction would be to transform it into an HTML-5 compliant version of Rick Astley’s “Never Gonna Give you Up” that hijacks the player’s browser and computer so that they can never, ever, ever, turn it off. (link) (P.S. I warned you.)

Photoshop, Drawings, or Other Mockups

If you’re a visual person, or your and words just won’t cut it, feel free to include mockups of what you think the finished piece of interactive fiction could look like. Programs that can be used to create mockups include Photoshop, GIMP, MS Paint, and good old-fashioned pencil-and-paper.

Audio and Video Files

Likewise, if your vision contains audio-visual materials, letting us see those will go a long way to showing us what your finished piece might be like.

Send Us Your Work!

Of course, the above methods are only examples. The number of ways you can format an interactivity proposal are limitless. If you have an idea that doesn’t seem to fit any of the methods above, and it describes your ideas clearly and in detail, go for it!

Regardless of the method(s) you use to describe how your story might be made interactive, the important thing is to provide sufficient detail for (1) our editors to envision your story as a piece of Interactive Fiction and (2) a coder to transform your story into it upon acceptance. So, for example, don’t say “When the player dies the screen changes.” but “If the player reaches zero hit points, the screen fades slowly to black.”

At the same time, you don’t want to provide too much detail. Strive for a balance of utility and clarity. Again, aim for “If the player reaches zero hit points, the screen fades slowly to black.” and not “If the variable hit points is reduced to zero by the function called minusHitPoints, then the game calls the function fadeToBlack which uses JavaScript to apply an absolutely positioned DIV with a black background-color and 0 opacity tag over the game screen and animating this element’s opacity to 1 with a 5000ms delay.” (Honestly, if that sentence makes sense, you’ll probably do just fine making the story interactive on your own!)

Of course, exceptions always apply. If there really is one super-specific technique that you think would be crucial to your story’s success as a piece of interactive fiction, definitely mention that, as well as where you heard of it and why you think it would be helpful.

One other important thing to keep in mind is that your proposal should be within the bounds of the reasonably possible. Don’t request things like a story hijacking the user’s net-activated toaster and reprogramming it to print images of Mahatma Gandhi on the next delicious bread product they insert, for instance. There’s a limit to what we can achieve.

It’s also useful to let us know if you’re willing to take a crack at the interactivity yourself upon acceptance or if you’d rather have Sub-Q staff do the leg-work. (Note that we do pay an additional per-word amount for interactivity.)

Once you’ve bundled your proposal together with your story’s completed prose, the only thing left to do is submit it.

We look forward to seeing your work!

The post Submitting Interactive Fiction Proposals to sub-Q Magazine appeared first on sub-Q Magazine.

]]>
Behind the Scenes: Prospero https://sub-q.com/behind-the-scenes-prospero/ Thu, 17 Sep 2015 13:00:23 +0000 https://sub-q.com/?p=1130 “Prospero”, which sub-Q published earlier this week, was written using a relatively new tool called Raconteur. Raconteur is a library of tools that wraps and extends Undum, an engine for writing choice-based and cybertext interactive fiction using plain JavaScript. Raconteur supplies a toolchain and CoffeeScript-targeted API for Undum, which is meant to hugely accelerate the process […]

The post Behind the Scenes: Prospero appeared first on sub-Q Magazine.

]]>
Behind the Scenes Prospero sub-Q Bruno Dias

“Prospero”, which sub-Q published earlier this week, was written using a relatively new tool called Raconteur. Raconteur is a library of tools that wraps and extends Undum, an engine for writing choice-based and cybertext interactive fiction using plain JavaScript. Raconteur supplies a toolchain and CoffeeScript-targeted API for Undum, which is meant to hugely accelerate the process of writing Undum stories.

For a while now, Raconteur has lacked a full code example. “Prospero” is just about the right length for it, and sub-Q has graciously agreed to publish the full source code. The story file for “Prospero” is about 871 lines long and contains all of the unique story text and logic.

You can find out more about Raconteur, including documentation and tutorials to help you start writing with it, on the Raconteur website.

# " There comes Poe, with his Raven, like Barnaby Rudge,
#   Three-fifths of him genius, and two-fifths sheer fudge. "
# 
#   -- James Russel Lowe, A Fable for Critics
# 
# The story source code for Prospero begins here. (C) Bruno Dias 2015.
# Originally published by Sub-Q magazine (http://sub-q.com/)
# 
# This source code is distributed as a code example for educational purposes.
# No permission is granted to redistribute or rebuild the story from this
# source code.


# ----------------------------------------------------------------------------
# 0 -- Front Matter

# Require the libraries we rely on.

situation = require('raconteur')
undum = require('undum-commonjs')
oneOf = require('raconteur/lib/oneOf.js')
elements = require('raconteur/lib/elements.js')
qualities = require('raconteur/lib/qualities.js')

a = elements.a
span = elements.span
img = elements.img

# IFID and game version -- Required by Undum

undum.game.id = "0a7f01b6-b435-483c-8874-bdbee2683255" # UUID
undum.game.version = "source-distribution"

# ----------------------------------------------------------------------------
# 1 -- Preamble

# Helper functions

# Cycles through an array's contents
Array.prototype.cycle = () ->
  return this[1..].concat(this[0])

# Checks if a situation has been visited by the player
seen = (situation) -> Boolean undum.game.situations[situation].visited

# Typographical shorthand

# An alias for setting up an "aside" link
# (that creates a parenthetical when clicked, usually)
aside = (word) ->
  ref = "#{word}-aside"
  inner = a(word).once().inserter(ref).toString()
  span(inner).id(ref)

# An alias for setting up a link to another situation, with the correct
# element class.
segue = (content, ref) -> a(content).class('segue').ref(ref)

# An object to hold reusable templates.
type =
  ending: '<h2 class="ending">an ending</h2>'

# ----------------------------------------------------------------------------
# 2 -- Game content

# 2.0 -- Prologue

situation 'start',
  content: () ->
    prospero =
      span(a('Prospero').inserter('prospero').once().toString()).id('prospero')
    """
    The "Red Death" had long devastated the country. No pestilence had ever
    been so fatal, or so hideous. Blood was its Avatar and its seal -- the
    redness and horror of blood. There were sharp pains, and sudden dizziness,
    and then profuse bleeding at the pores, with dissolution. The scarlet
    stains upon the body and especially upon the face of the victim, were the
    pest-ban which shut them out from the aid and from the sympathy of their
    neighbors. The whole seizure, progress and termination of the disease,
    were the incidents of half an hour.

    When Prince #{prospero} found his dominions half depopulated, he summoned
    to his presence a thousand hale and light-hearted friends from among the
    people of his court, and with these retired to the deep seclusion of one
    of his summer #{segue('retreats', 'retreats')}.

    """
  writers:
    prospero: " (happy and dauntless and sagacious)"

situation 'retreats',
  content: """
    # Prospero

    ## Adapted by Bruno Dias from the short story by Edgar Allan Poe
    """
  choices: ['cars']

situation 'cars',
  optionText: 'Continue'
  content: """
    It was an extensive and magnificent structure, a modernist design not
    unlike the carved *béton brut* that had sprouted all over Europe. An
    angular steel fence surrounded it. Courtiers had abandoned their cars all
    along the gravel paths of the courtyard, gleaming silver and black
    machines defying the rust each misty Savoyard morning. Their keys had been
    collected and buried behind the enormous house, leaving no means of egress
    to the sudden impulses of despair or frenzy from within. Its exterior had
    #{a('suffered').once().writer('suffered')} the passage of time.

    Of all the #{aside('cars')}, one #{segue('stood out', 'red-car')}.
    """
  writers:
    'cars-aside': " (stately Hässels from Prussia, sinuous Verbeeks from New
      Amsterdam, sharklike Bulettes from Brittany)"
    'suffered': """
      In months of grinding, desperate seclusion, no servant had stepped outside
      the house. The panes of safety glass -- surrounding the house like scales
      -- had accrued a layer of dark grime from the wind and rain. The garden
      was an overgrown, matted ruin. Native weeds thrived among the corpses of
      neglected foreign flowers. And not far from the door was a pile of ashes
      -- remains of clothes and surgical masks suspected of carrying disease.
      """

situation 'red-car',
  content: """
    It was a ruddy, beautiful *coupé* -- a Carrièr Matador, from Toulouse.
    Painted a color too dark to be cherry red.
    Fresh gouges in the gravel behind it, mud
    on its rims.

    She stepped out of the car, not bothering to lock it. She made her way,
    through undisturbed gravel, to the #{segue 'trunk', 'open-trunk'}.
    """ 

situation 'open-trunk',
  # Note how we can attach arbitrary properties to situation objects
  books: ['Relics', 'Mementos', 'Evidence']
  content: () ->
    mask = a('masque').once().writer('mask')
    novels = a('novels').once().writer('novels')
    """
    Inside the trunk were a stack of paperback #{novels} and a curiously made
    #{mask}.
    """
  writers:
    novels: () ->
      finger = a('finger').once().replacer('finger-inserter')
      here = span('.').id('finger-inserter')
      relics = 
        span(
          a(this.books[0])
          .replacer('relic-book')
          .toString())
        .id('relic-book')

      """
      They had been with her as she drove through the back country of Savoy,
      taken from abandoned bookstores and gas stations. #{relics} of the desert
      she left behind her. She ran one #{finger} through the the pile, reading
      the titles#{here}
      """
    'finger-inserter': " -- Short stories collected from pulp authors;
    Chamber's The King in Yellow; a clandestine copy of the banned,
    pseudonymous Return of the Worm; louche Italian romances for all
    kinds of underserved audiences..."
    mask: """
      The masque was red, to match her outfit, and cleverly constructed for
      effect. The top resembled those delicate porcelain features, the shaded
      eyes, of a Venetian *columbina*. But this one had a mouth covering in the
      form of a silken, draping scarf, meant to be pulled down to reveal the
      full #{segue('visage', 'visage')} of the masque.
      """
    'relic-book': () ->
      this.books = this.books.cycle() # `this` is the situation object itself
      span(
        a(this.books[0]).replacer('relic-book').toString()
        ).id('relic-book').toString()

situation 'visage',
  content: """
      She tentatively slid a finger behind the masque's silk covering, as though
      to check that what had always been underneath it remained. In this, she
      was interrupted by the #{segue('chiming', 'chiming')} of the great clock
      within the #{segue('mansion', 'mansion')}. She had arrived just in time.
    """

situation 'chiming',
  content: """
    Somewhere deep inside the Prince's apartments was an enormous, grotesque
    clock. Made of ebony and sharp angles -- a modernist retelling of
    a Gothic original the Prince's ancestors had neglected in a castle
    elsewhere.

    The Prince had it attached to the metal
    bones of the mansion. On the hour, the whole building would reverberate
    along with its chiming, phasing the guests, halting the music, shaking
    the floor.

    Its tolling, just now, signaled the start of the #{segue 'ball', 'ball'}.
    """

situation 'mansion',
  content: """
    The mansion had been erected out of glass, steel, tropical woods from the
    domains of distant cousins; unlike the ostentatious glass houses of his
    peers, the retreat had been built wholly out of sheer, broken angles; so
    that the glass could not provide a clear sight-line through the house at all
    -- instead of an airy rectangle, it was a steel snake hiding in its own
    coils.

    It was a small palace and a world unto itself; and presently, it all shook
    to the ringing of the clock, signaling the start of the
    #{segue 'ball', 'ball'}.
    """

situation 'ball',
  content: """
    Within the mansion, the Prince had gathered perhaps two hundred guests and
    nearly as many servants. The summer home, a small palace, was amply
    provisioned. A remote stand of cypress surrounded it. The world outside
    could care for itself, and in the meantime, it was folly to grieve -- or to
    think. To that end, the Prince had supplied all appliances of pleasure:
    There were dancers, there were musicians, there was Beauty, there was wine.
    As all signals traveling through the Prince's *aether* ceased to carry any
    joy for him, the servants had hidden away all the radios and television
    sets, cutting cords to #{segue 'silence', 'ball-continue'} them completely;
    so that the guests, finally, were left to the labors of pleasure and life in
    seclusion.
    """

situation 'ball-continue',
  content: """
    When the Prince's collection of #{aside 'films'} ran out, the lights were
    turned on and the servants were made to play in blackbox comedies, their
    scripts supplied by dilettante guests.

    When even that entertainment ran thin, the Prince announced a night of
    extreme revel, a masquerade ball, where the guests and servants would
    mingle, shed their identities, forget. Wine, and song, and whatever earthly
    pleasures remained, would flow freely.

    She #{segue 'donned her masque', 'put-on-mask'},
    having arrived just in time.
    """
  writers:
    'films-aside': " (from bolshevik *kinopoesiya* to staid
      adaptations of the *commedia dell'arte*)"

situation 'put-on-mask',
  optionText: "She put on her masque, and made her way to the ball."
  content: """
    The ball had been arranged within a sequence of seven apartments joined
    together -- a grand suite. In other mansions and palaces, those suites open
    widely, so that one can see clearly through all of their spaces, their
    sliding doors receding almost entirely into the walls.

    However, this suite was crooked, each chamber at a sharp angle from the
    next, so that the guests could see only one room at a time. Outside, through
    the great panes of safety glass, was darkness.

    The seven apartments were each one decorated in a particular color and
    style, a neon mirage of a different place and time. The first one was blue,
    and everything in it had some tint of blue, matched by the bright blue
    lights overhead. The second chamber was purple, from the carpet to the
    ceiling. The third chamber was green throughout; the fourth, orange; the
    fifth, white; the sixth, violet. And at the edge of the great house was the
    last apartment, itself decorated wholly in #{segue 'black', 'black'}.
    """

situation 'black',
  content: """
    The black chamber was closely shrouded in black velvet tapestries that hung
    all over the ceiling and down the walls, falling in heavy folds upon a
    carpet of the same material and hue. BUt in this chamber only, the color of
    the neon lights failed to correspond to the decorations. The tubes here were
    scarlet -- a deep blood color.

    In the black chamber, the effect of the neon light that dappled across the
    dark hangings was ghastly in the extreme, and produced so wild a look upon
    the countenances of those who entered, that there were few guests bold
    enough to set foot within the chamber at all. No dancing happened within --
    only furtive whispers, and abortive trysts cut short by the eeriness of the
    chambers.

    She #{segue 'followed the procession of revelers', 'ball-begin'}.
    """

situation 'ball-begin',
  content: """
    Her costume was a draping, heavy robe, covering her form in red. Topped
    with the strange masque, she was an imposing figure, wearing a color that
    horror had forbidden, shocking those few guests who bothered to notice
    her presence at all.

    She had walked slowly through the revelers, noting how they clung to
    the western end of the grand suite, how they avoided the other end with
    its black velvet room. She moved between them, unnoticed.
    And as the ninth hour approached, she stopped at the halfway point,
    the orange chamber, where the warm neon overhead suggested some
    distant tropical sunset.
    """
  classes: ['orange']
  choices: ['ninth-third', 'ninth-fifth']

# 2.1 -- The Ball

###
From here on out, situation ids take the form "bell-room", eg "ninth-fifth"
means the fifth (white) room, at the tolling of the ninth bell.
###

# 2.1.0 -- Ninth bell

# The descriptions for these chambers shows up the first time they're visited,
# which can happen in different situations. So we set up an adhoc object to
# hold them, as well as the connecting paragraph about the bell tolling.

chambers =
  green: """
  She stepped into the green chamber, and found it covered in leafy arabesques
  that recalled the cypress stand outside. Glistening vinyl ferns sprouted from
  the walls, their artificiality only heightened by the color of the lights.
  """
  white: """
  She took stock of the white chamber: Lit with a staid white light, this room
  was made to resemble a sarcastic mockery of a church undercroft, complete
  with arched niches in the walls holding sconces with flickering candles.
  The plastic skulls that would have completed the effect, however, had
  been taken away by the servants -- the Prince wanted no *memento mori*.
  """
  toll: """
  At the far end of the suite, in the black chamber, was the clock. Its
  tolling reverberated violently through the entire house, with a sound so
  strange and musical it compelled the musicians to stop and harken to its
  sound; and here the dancers, too, would cease their revolutions around one
  another, listening to the brazen vibrations of the hour.

  But just as it had come, it would fade away, the shaking of the walls the
  sound of mere moments, soon replaced by the revived noises of revelry and
  joy.

  The striking of the tenth hour approached.
  """

situation 'ninth-third',
  crowdReactions: [
    "She noted sadly the interrupted futures of the young ones in the crowd."
    "She cataloged their lives with ennui, seeing the common arc of their
    fates."
    "In them, she saw only a mass of indistinct humanity."
  ] # Once again we attach a list of possible phrases to the situation object
  content: () ->
    crowd = a('crowd').once().writer('crowd')
    """
    #{chambers.green}

    A woman stood uncomfortably #{segue 'distant', 'save-woman'} from the
    party, leaning furtively against the wall, her lithe body vanishing into
    the gaudy plastic bush. She did not seem to fit the #{crowd} of courtly
    hangers-on around her.
    """
  choices: ['tenth-second', 'tenth-fourth']
  optionText: 'She retreated to the green chamber.'
  classes: ['green']
  writers:
    crowd: () ->
      """
      The green room seemed the most agreeable to the guests. A circle of
      courtiers orbited around some of the Prince's favored friends: Masked
      actors, musicians, and a brooding novelist or two. They were stared at
      by industry barons and literal barons, investment bankers, lesser
      sons of princely families. From the middle of the crowd, camera flashes
      would sometimes emerge, casting their masks in stark light for a moment.
      #{this.writers['crowd-react'].call(this)}
      """
    'crowd-react': () ->
      this.crowdReactions = this.crowdReactions.cycle()
      span(
        a(this.crowdReactions[0]).replacer('crowd-react').toString()
        ).id('crowd-react').toString()

situation 'save-woman',
  content: """
    She saw a small woman, raven-haired and short, wearing a golden tragedy
    masque and a black cocktail dress that fit her poorly.  The stranger in
    red approached her, noting that the woman was neither servant nor
    courtier. In her borrowed dress, she tried to mingle, but too awkwardly,
    clutching an untouched glass of wine. A party crasher, perhaps? Or a
    survivor from a nearby village, taken in by the Prince?

    The stranger did not need to know.
    """
  choices: ['give-woman-key', 'tenth-second', 'tenth-fourth']
  extendSection: true

situation 'give-woman-key',
  optionText: "She gave her the keys."
  content: """
    From the folds of her robe she produced her keys, which she pressed into
    the hand of the young woman. "Leave." There was no argument. Behind her
    tragedy masque, she recognized who spoke to her.
    """
  after: (character) -> character.sandbox.hasKeys = false
  choices: ['tenth-second', 'tenth-fourth']
  extendSection: true


situation 'ninth-fifth',
  adverbs: ['soberly', 'longingly', 'distractedly', 'curiously']
  # Situations can also encapsulate arbitrary functions. This one wraps an
  # adverb from the list in the right tags to generate a link; it's used
  # both in the main content and by the related writer.
  adverbise: () ->
    this.adverbs = this.adverbs.cycle()
    span(
      a(this.adverbs[0]).replacer('wine-adverb').toString()
      ).id('wine-adverb')
  content: () -> 

    """
    #{chambers.white}

    Wine flowed from the white chamber, a play on communion. She glanced
    #{this.adverbise()} at a glass of dark red liquid left abandoned on an
    arched sill.

    #{chambers.toll}
    """
  choices: ['tenth-fourth', 'tenth-sixth']
  optionText: 'She advanced to the white chamber.'
  classes: ['white']
  writers:
    'wine-adverb': () -> this.adverbise().toString()

# Tenth bell

bells =
  eleventh: "The striking of the eleventh hour approached."
  musicians: """
    When the hourly shaking of the house ceased, and the great clock had rung
    ten times, she could hear a distant song: Musicians in another room,
     picking up on the very
    note where they stopped, their song interrupted by the clock.
    """

situation 'tenth-second',
  musicReactions: [
    'swayed along to the rhythm'
    'listened with distant interest'
    'did not harken to the sound'
  ]
  musicReact: () ->
    this.musicReactions = this.musicReactions.cycle()
    span(
      a(this.musicReactions[0]).replacer('music-react').toString()
      ).id('music-react')
  content: () ->
    acted = this.musicReact()
    musicians = a('musicians').once().writer('musicians')

    """
    The purple room felt hazy, unreal. The walls and floor had been covered in
    a single, abstract mural, which dancers would unsteadily wobble over in
    their convolutions. It was hard to discern where the floor ended and the
    walls began.

    Here stood the #{musicians}, playing through an interminable
    medley, the bassist's arm drooping slightly under the weight of the
    instrument. As the sound of the bells faded, they would pick up on the
    very note where they had stopped. As she moved unseen through the crowd,
    she #{acted}.
    """
  writers:
    musicians: """
      They worked their way laboriously through a half-improvised swing, six
      minutes into a minor key jazz that is only three minutes long. It was
      wearily joyful, the sound of a band that played nothing but final
      numbers.

      #{bells.eleventh}
      """
    'music-react': () -> this.musicReact().toString()
  choices: ['eleventh-first', 'eleventh-third']
  optionText: 'She moved to the purple chamber'
  classes: ['purple']

# Since we know the player has already seen the orange chamber
# (it's a bottleneck), we don't have to print its description.
situation 'tenth-fourth',
  content: () ->
    youth = a('youth').once().writer('youth')
    """
    At the tolling of the tenth bell, she walked again around the tight scrum
    of dancers that spun through the center of the orange room, most too
    unsteady from wine and #{youth} to fall properly on their steps.

    #{bells.musicians}
    """
  writers:
    youth: """
      Here was a clique of idle young scions from mercantile houses and their
      hangers-on, interrupted in their holiday through the Savoyard countryside
      by the plague that forced them to seek shelter in the house of the Prince,
      showing up at his doorstep in their fast cars, with their cheap wine and
      dilettante typewriters. One of them caught her masked
      #{segue 'eye', 'save-dilettante'}.
      """
  choices: ['eleventh-third', 'eleventh-fifth']
  optionText: 'She returned to the orange chamber.'

situation 'save-dilettante',
  content: """
    He had known grief beyond his years, which he hid with sarcasm and a little
    too much wine. He and his two friends fancied themselves writers. But their
    typewriters had been silent for a while.
    """
  choices: ['give-dilettante-key', 'eleventh-third', 'eleventh-fifth']
  extendSection: true

# Normally, the output of each situation is put into its own section, allowing
# it to be styled accordingly (in Prospero, by giving it the proper colour
# background). But here we set the `extendSection` property to `true`, so that
# it will instead write into the existing section, so that the background will
# extend over the new text.

situation 'give-dilettante-key',
  optionText: 'She gave him her keys.'
  canChoose: (character) -> character.sandbox.hasKeys
  content: """
    She startled him, drawing nervous laughter from the youth. She pressed a car
    key into the shaking palm of his hand. "Leave." She knew he would gather
    his friends. That he would know which one of the cars parked outside to
    take.

    Three souls made it out alive that evening.
    """
  after: (character) -> character.sandbox.hasKeys = false
  choices: ['eleventh-third', 'eleventh-fifth']
  extendSection: true;

situation 'tenth-sixth',
  content: () ->
    secrets = segue 'secrets', 'chamber-secrets'
    lies = segue 'lies', 'chamber-lies'
    """
    The violet apartment was a prelude for the black chamber. It was filled
    with mock horror that prefigured what was beyond the black
    door. The decor, deliberately disturbed like a crime scene,
    resembled a horror film, or perhaps a
    sanitized *giallo*. The walls were covered in foreboding Gothic stonework,
    rendered in papier-mâché.

    #{bells.musicians}

    She stopped for a moment to listen to the whispering of the gossips who
    retreated from the main body of the fête to find themselves here. Under
    the glow of the violet light, their whispers carried #{secrets} and #{lies}
    to one another, more out of habit than necessity.
    """
  optionText: 'She walked into the violet chamber'
  classes: ['violet']

situation 'chamber-secrets',
  content: """
    The Prince's tastes for the curious and the bizarre had always manifested,
    in his courtiers, in the form of a secretive and peculiar fear. They still
    passed on stories of the man's nocturnal activities, of what went on in
    the black chamber at the edge of the suite. And as she approached them,
    they dispersed, turning away masked faces.

    #{bells.eleventh}
    """
  choices: ['eleventh-fifth', 'eleventh-seventh']
  extendSection: true

situation 'chamber-lies',
  content: """
    Even amidst death, the business of the court went on. The lies they told
    one another were becoming extravagant in desperation, shifting from hour
    to hour as furtive news of the calamity outside starkly changed the value
    of lands and titles.

    They still discussed the news and events of the day, even though no news had
    reached the mansion in weeks. There was much talk of an antipope that had
    already been deposed, of an oil industry merger that had already happened,
    of war with Lombardy that was pre-empted by the plague. The world outside
    had moved on in their absence, as it would continue to do.

    #{bells.eleventh}
  """
  choices: ['eleventh-fifth', 'eleventh-seventh']
  extendSection: true

# Eleventh bell

situation 'eleventh-first',
  content: () ->
    prospero = segue 'Prospero', 'prospero'
    """
    Starkly ultramarine, the blue chamber greeted the Prince's guests to his
    chromatic fantasy.

    Here huddled the offended ones, the fearful, the religious. Those guests
    who did not care for the revelry or its accoutrements, who thought the
    whole affair a small blasphemy. They clung to the exit, caught between
    politeness and piety.

    And there, stuck trying to placate them with his silent presence,
    was #{prospero}.
    """
  optionText: 'She moved into the blue chamber'
  # We always find Prospero in the last chamber we visit; this variable tracks
  # where, exactly.
  after: (character) -> character.sandbox.prosperoAt = 1
  classes: ['blue']

# Check if those rooms have been seen before.

situation 'eleventh-third',
  content: () ->
    guard = a('guard').once().writer('green-chamber-guard')
    """
    #{if not seen('ninth-third') then chambers.green else ''}

    The green chamber held the food, the night's banquet, carefully measured out
    from the mansion's provisions. Weary servants had laid it out in faux-
    pastoral splendor. At each edge of the table, a reminder of the creeping
    scarcity, stood a #{guard}.

    And at the edge of his own party, staring at his dwindling food,
    stood #{segue 'Prospero', 'prospero'}.
    """
  optionText: 'She moved to the green chamber.'
  writers:
    'green-chamber-guard': () ->
      crest = aside 'crest'
      weapons = aside 'weapons'
      """
      Liveried in dark turtlenecks and berets bearing Prospero's family
      #{crest}, the guards were ever-presence and furtive, gaunt, faces hardened
      from watching the despair of the poor and the lost caught outside the
      manor's walls. Tonight, they watched the guests, clutched their
      #{weapons}, and didn't touch the food.
      """
    "crest-aside": " (gold emblazoned with a sable sun)"
    "weapons-aside": " (something compact and full-auto from Lombardy)"
  after: (character) -> character.sandbox.prosperoAt = 3
  classes: ['green']

situation 'eleventh-fifth',
  content: () ->
    # Note how if-then-else statements are expressions, so we can embed them
    # right into the output text; we need the else clause so it won't just
    # output `undefined` if the value is false.

    # Note, too, how this `content` property has to be a function, so that
    # the `seen` expression will be checked at runtime when the situation
    # is reached, and not when the situations are being generated.
    """
    #{if not seen('ninth-fifth') then chambers.white else ''}

    She had seen the path that wine took on its way around the chambers, from
    the great casket in the white apartment. Guests would timidly sip it or
    hurriedly down it; servants would disappear with glasses and flasks of it.
    There was so much of it to go through.

    And there, all but laying his head beneath the tap, was Prince 
    #{segue 'Prospero', 'prospero'} himself.
    """
  optionText: 'She moved to the white chamber.'
  after: (character) -> character.sandbox.prosperoAt = 5
  classes: ['white']

situation 'eleventh-seventh',
  content: """
    Few dared step into the last, velvet-draped chamber. The effect of the
    crimson neon distorted
    the visages of those within into a masque of horror. Those who came --
    dared by others, drunkenly stumbling through the curtain -- did not stay
    long. When she happened upon it, the black chamber was nearly empty.

    There was only Prince #{segue 'Prospero', 'prospero'} himself, seated on
    a black velvet and ebony ottoman, caught up in his own
    dark fantasy.
  """
  optionText: 'She entered the black chamber.'
  after: (character) -> character.sandbox.prosperoAt = 7
  classes: ['black']

situation 'prospero',
  content: (character, system, from) ->
    # `switch` statements in CoffeeScript are expressions, too
    # so we can assign their return value to a variable. Here, we
    # have a different reaction for Prospero depending on where he
    # was found, without having four different situations.
    prosperoGraph = switch from
      when 'eleventh-first'
        """
        But his staid, pious exterior melted into rage when she saw her,
        dressed head to toe in crimson.
        """
      when 'eleventh-third'
        """
        But his hungry smile faded away when he saw her, covered head to
        toe in scarlet.
        """
      when 'eleventh-fifth'
        """
        But he snapped out of his stupor when he saw her, covered head to
        toe in vermilion.
        """
      else
        """
        But his melancholy turned to anger when he saw her, covered head to
        toe in red.
        """
    """
    Prince Prospero was hale, and strong. He stood too tall for his guests in
    samite finery, the spitting image of some forgotten Gothic ancestor. He
    had, for too long, led his guests in their revels.

    #{prosperoGraph}
    """
  choices: ['prospero-unmask', 'prospero-leave']
  extendSection: true;

situation 'prospero-unmask',
  optionText: 'She took off the veil.'
  content: (character) ->
    ###
    The final sequence is a run through the chambers of the suite. The more
    chambers there are to run through, the longer it is; so we splice into
    a point determined by where we start.
    ###
    chamber = switch character.sandbox.prosperoAt
      when 1
        segue 'purple', 'death-finale-2'
      when 3
        segue 'orange', 'death-finale-4'
      when 5
        segue 'violet', 'death-finale-6'
      when 7
        segue 'black', 'death-finale-7'
    chamberGraph = if character.sandbox.prosperoAt < 7
      "But the masked figure already retreated into the #{chamber} chamber."
    else
      "The masked figure stood in the middle of the #{chamber} chamber."

    """
    As the house shook with the striking of midnight, she disposed of the veil
    that had concealed her masque.

    And beneath the veil, her masque was made to so closely resemble the visage
    of a stiffened corpse, daubed and sprinkled delicately with blood, that one
    could scarcely see anything but mockery of the tragedy that had befallen
    the Prince's domain.

    Prospero's face convulsed with disgust, then reddened with anger: "Who
    dares?"

    #{chamberGraph}
    """

situation 'death-finale-2',
  content: """
    Stunned by his momentary hesitation, the Prince
    #{segue 'chased', 'death-finale-4'} her through the apartments.
    """

situation 'death-finale-4',
  content: """
    As she moved through them, the assembled crowd parted in mute horror,
    stepping out of the way of the stalking spectre and the
    #{segue 'prince', 'death-finale-6'} who stalked her.
    """

situation 'death-finale-6',
  content: """
    He might have screamed for his guards to seize her, or simply silently
    cursed at the affront to his #{segue 'authority', 'death-finale-7'}.
    """

situation 'death-finale-7',
  before: () ->
    # If we haven't seen the black background effect yet, then we see it here.
    if not seen 'eleventh-seventh' then this.classes = ['black']
  content: () ->
    """
    #{if seen 'eleventh-seventh' then '' else "She stood in the middle of the
    black chamber, defying him."}

    He bore aloft a drawn pistol, and approached her impetuously, to within
    two or three feet of the spectral figure, when she turned sharply and
    confronted the Prince. There was a sharp cry -- and the pistol dropped
    inert upon the sable carpet, upon which, instantly afterward, fell
    prostrate in death the Prince Prospero.

    And now was acknowledged the presence of the Red Death. She had come as an
    uninvited guest. And one by one dropped the revelers in the blood-flecked
    halls of their revel, and died each in the despairing posture of their fall.
    And the life of the ebony clock went out with the of the last of the joyful.
    And the colorful neon lights flickered and expired. And Darkness and Decay
    and the Red Death held illimitable dominion over all.

    #{type.ending}
    """

situation 'prospero-leave',
  optionText: 'She turned to leave.'
  canChoose: (character) -> character.sandbox.hasKeys
  before: (character) ->
    character.sandbox.leaveMotivation =
      ['sadness', 'mercy', 'ennui', 'weariness', 'apathy', 'kindness',
      'forgiveness']
  content: (character) ->
    """
    But to his anger, she could respond only with a sudden
    #{this.writers.selectmotivation(character)}. Five months hidden
    in his manse had made of the Prince a ragged man, slightly too thin
    for his sequined party garb, eyeglasses slightly askew on a wrinkled
    nose. It had taken her so long to arrive at this man's party that
    she was no longer sure these were the people she had come to
    #{segue 'collect', 'leave-collect'}.
    """
  writers:
    selectmotivation: (character) ->
      character.sandbox.leaveMotivation =
        character.sandbox.leaveMotivation.cycle()
      inner =
        a(character.sandbox.leaveMotivation[0])
        .replacer('selectmotivation')
        .toString()
      span(inner).id('selectmotivation').toString()

situation 'leave-collect',
  content: """
    She walked through a parting way in the middle of the throng of distraught
    guests, out of the richly decorated apartments of the Prince who could
    scarcely muster the strength to #{segue 'follow', 'leave-follow'}.
    """

situation 'leave-follow',
  content: """
    Her footfalls made no sound as she strode onto the gravel path, tailed by
    a baffled Prince. He stood, paralyzed, watching as his iron gate was
    thrown open by crimson-gloved #{segue 'hands', 'leave-hands'}.
    """

situation 'leave-hands',
  content: """
    From one of his guards, the Prince had at some point reached for a drawn
    pistol. But he could not lift it against her. The open gates were a sign of
    black fear to him, a sign of the outside world creeping in on the sanctuary
    he had built, a sign of death. The ebony clock struck twelve, unheeded by
    the two figures standing before the great house. Darkness and Decay had
    arrived ahead of her.

    And so the Red Death got in her car and drove away.

    #{type.ending}
    """

#-----------------------------------------------------------------------------
# 3 -- Initialisation Code

undum.game.init = (character, system) ->
  character.sandbox.hasKeys = true
  # Undum's sandbox can hold arbitrary values inside the `character` object
  # passed to situation methods. Here, we use it to track whether the player
  # character has given away her car keys.

# When the DOM is ready, get Undum running.
window.onload = undum.begin

The post Behind the Scenes: Prospero appeared first on sub-Q Magazine.

]]>
WooCommerce and W3 Total Cache Not Working? Here’s how to fix it. https://sub-q.com/woocommerce-and-w3-total-cache-not-working-heres-how-to-fix-it/ Wed, 05 Aug 2015 13:00:48 +0000 https://sub-q.com/?p=998 On the day of our first issue, a kind user brought to my attention that our store wasn’t letting him buy a Premium Membership. Turns out WooCommerce and W3 Total Cache were not working together, because I hadn’t configured them completely. If you’re here, maybe I can save you an hour of head-banging. The Symptoms […]

The post WooCommerce and W3 Total Cache Not Working? Here’s how to fix it. appeared first on sub-Q Magazine.

]]>
On the day of our first issue, a kind user brought to my attention that our store wasn’t letting him buy a Premium Membership. Turns out WooCommerce and W3 Total Cache were not working together, because I hadn’t configured them completely.

If you’re here, maybe I can save you an hour of head-banging.

The Symptoms

  • When not logged in, a user would go to the product page, click the button to add it to their cart, and then be returned in a flash to the same product page. No “you have successfully added this product to your cart” message. Very confusing. (I could duplicate the behavior in incognito mode.)
  • At the time, the site didn’t have a cart link with product count, but if it had, that link label wouldn’t have been updated, either.
  • If I manually entered the url to go to the cart (“/cart/”), the product was there, ready for the order to be placed.

This issue is not unusual, and typically a symptom of a cacheing plugin that needs a little more configuration to work with WooCommerce. Mine was W3 Total Cache.

The Treatment

Perhaps not all of this was necessary—some of these leads came from posts > 2 years old—but this is what finally worked for me:

  • Adding _wc_session_ to the list of Ignored Query Strings in my WordPress administration area, under Performance > Database Cache:

    WooCommerce W3 Total Cache not working database cache

    W3 Total Cache database cache settings for WooCommerce

  • Obeying the W3 Total Cache-related instructions at the WooCommerce Codex for Third-Party Plugins: specifically, in my WordPress administration area, under Performance > Minify, added mfunc to the list of Ignored Comment Stems:
    WooCommerce W3 Total Cache not working Minify mfunc

    Add ‘mfunc’ to Performance > Minify

  • Adding the shop’s URL (plus contents below it) to the list of pages excluded from cacheing under Performance > Page Cache:
    WooCommerce W3 Total Cache not working page cache settings

    W3 Total Cache page cache settings for WooCommerce

    (I did this under both Performance > Page Cache AND Performance > Database Cache, PLUS adding cart and checkout to both lists, out of an excessive abundance of caution. However according to WooCommerce documentation, in WC 1.4.2+ you don’t need to explicitly add cart and checkout to either list of excluded pages, and I don’t think it’s totally necessary to add the shop URL to the list of excluded pages under Performance > Database.)

Hope this helps, and good luck!

The post WooCommerce and W3 Total Cache Not Working? Here’s how to fix it. appeared first on sub-Q Magazine.

]]>
sqTwineSound for Twine v 1.4.2 https://sub-q.com/sqtwinesound-for-twine-v-1-4-2/ Mon, 01 Jun 2015 14:00:54 +0000 http://sub-q.com/?p=54 Ever wanted to use sound in Twine? Ever wanted to seamlessly loop your crowd walla? Ever wanted to set relative volume levels without having to edit your actual audio source? Have we got the macros for you. Based on sound macros by Leon Arnott of Glorious Trainwrecks, this suite adds story-wide volume control individual clip volume […]

The post sqTwineSound for Twine v 1.4.2 appeared first on sub-Q Magazine.

]]>
Ever wanted to use sound in Twine? Ever wanted to seamlessly loop your crowd walla? Ever wanted to set relative volume levels without having to edit your actual audio source?

Have we got the macros for you.

Based on sound macros by Leon Arnott of Glorious Trainwrecks, this suite adds

  • story-wide volume control
  • individual clip volume control
  • individual clip fade/crossfade duration control
  • seamless loop (with crossfade)

Want to know what the heck this means? Check out the demo!

For more details, please check out the official sqTwineSound plugin page.

For the latest README and source code, please check out sqTwineSound on github.

The post sqTwineSound for Twine v 1.4.2 appeared first on sub-Q Magazine.

]]>