Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

"Unexpected identifier" error?

$
0
0
Hi all!

I'm trying to build a conversation system where everything the player says has the potential to have a positive, negative or neutral outcome (it's a little more elaborate than that, but that's the gist of it), with a colour code to warn them of the risk.

First, I set it up so that every choice could show up as either green (positive), yellow (neutral) or red (negative), at random, using the (either:) command. It worked perfectly, with the three options named This, That and Else each having a random colour every time I started up the game.

But now I'm trying to link the colour of the choice to the result of choosing it, and I'm having some trouble.
I tried a few different things (always with the same error, "Unexpected identifier"), but my current plan is to try to use $1stcolour to keep track of which version of "This" the player clicked on and respond accordingly in the "Reply" passage (the other two will have their own variables like $2ndcolour and $3rdcolour when I can figure out how to make it work).

I phrased it like this:
(either:"(colour: red)[I say [[This->Reply]]] (set: $1stcolour to "red")","(colour: green)[I say [[This->Reply]]] (set: $1stcolour to "green")","(colour: yellow)[I say [[This->Reply]]] (set: $1stcolour to "yellow")")

(either:"(colour: red)[I say [[That->Reply]]]","(colour: green)[I say [[That->Reply]]]","(colour: yellow)[I say [[That->Reply]]]")

(either:"(colour: red)[I say [[Else->Reply]]]","(colour: green)[I say [[Else->Reply]]]","(colour: yellow)[I say [[Else->Reply]]]")

"That" and "Else" are showing up just fine when I play, but "This" just gives me an "Unexpected identifier" error. It seems to be because I'm trying to use (set:) inside of (either:)? Why is that? Is there another way I could accomplish what I want to do?

I'd really appreciate any help!

Viewing all articles
Browse latest Browse all 1844

Trending Articles