Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

A vs An (Twine 2/Sugarcube)

I'm trying to implement a js library that allows me to properly prefix a/an. Problem is, I'm not good with JS and have no idea how to get it to work.

The library is here: https://github.com/EamonNerbonne/a-vs-an/blob/master/A-vs-An/AvsAn-JsDemo/AvsAn.js

Whenever I use AvsAn.query("word") in my story it gives me an error that AvsAn is undefined. I'm using it in a set macro if that makes any difference.
<<set _an = AvsAn.query(_word)>>

Comments

  • It's a scoping problem. Change the first code line from:
    var AvsAn = (function () {
    
    To:
    window.AvsAn = (function () {
    
Sign In or Register to comment.