Howdy, Stranger!

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

Unexpected Token True?!?

I tried looking it up like five times, but Google always takes 'unexpected token' and finds things about 'unexpected token illegal,' which is not my problem.
Let's say I have a passage that says:
(set: $variable to false)(set: $othervariable to false)(set: $anothervariable to true)``Blah blah blah story stuff.``
Then I click Play because I need to check if something works...
Why would the "Unexpected Token True" error show up? I'm trying to solve a different problem and it's incredibly irritating to keep coming across this. I can't think of anything that I could have messed up.

Comments

  • You need to state the name and full version number of the Story Format you are using, as answers can be different for each one. Based on the syntax of your example I will assume you are using on of the Harlowe series, but I can't determine if its the 1.x series or the 2.x series.

    Is your example the actual code that is resulting in that error on your machine? Because I tested it in both the 1.x and 2.x versions of Harlowe and it worked perfectly for me.

    Which version of Twine 2 are you using?

    Are you using the install-able release of Twine 2 or one of the web-browser (online, downloadable) based releases?
  • edited May 2017
    Unexpected token messages just means that the indicated token, which can be anything from a bit of syntax like a brace ( } ) to a value (like true), was found in a place that didn't make sense.

    As greyelf said, there doesn't appear to be anything wrong with the code you've provided; are you sure it's the same code that raised the error? If not, please copy and paste that code over so we can take a look at it. And do post the version number of the story format you're using.
Sign In or Register to comment.