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

[sugarcube 2.x] Selector error with if statements...

$
0
0
Ok so I am trying to create a passage that shows different text based on which passage the player came from. I watched a tutorial explaining how to use <span> in conjunction with <<replace>> to replace text and it worked for the one I put on the title page but now that I'm using if statements it is giving me this error:
Error: <<replace>>: no elements matched the selector "#xArea"

I've tried a variety of things but they all seem to give the same error. This is the code as of this moment:
<span id="xArea">Error: invalid passage access. If you are seeing this please report it.
<<if $exArea == 1>>
<<replace "#xArea">>
You stand up from your cubicle and take a look at your surroundings. A busy day in the GETTO offices.
<</replace>>
<<else>>
<<replace "#xArea">>
Error: invalid area number. If you are seeing this please report it.
<</replace>>
<</if>>
</span>

Now I know there is probably a better way to go about this but this was all I could think up to do this atm. If anyone has a better method to achieve this then I'd greatly appreciate it if you'd tell me or at the least point me in the right direction. Also please note that there are no linebreaks in the code if that's even a factor, I just added them here for readability.

Viewing all articles
Browse latest Browse all 1844

Trending Articles