Sugarcube: The following throws a "(Error: <<print>>: bad expression: Invalid left-hand side in assignment)" error.
<<print "[[Open door" + "|Sorter1][$CurrentPos.LocEntry[3] =" + 5; + $CurrentPos.LocWall[3] = 5; + $Reset = true; + $DoorOpened=true + "]]">>
What does this mean?
Comments
" + 5; +
bitthe semi-colon terminates the current expression, which starts a new expression with the string concatenation operator). You're also missing some quotes and string concatenation operators.In fact, why are you even using
<<print>>
there? Based on your code, you don't need it. You could simply do this: You'd only need to use<<print>>
in a situation like that if you wanted to force the early evaluation of a $variable, which you aren't doing (in that code anyway).Originally I did try that normal link code method and what i was trying to achieve wasn't working so i wrongly assumed that you couldn't have [] within the link|passage code because it uses them, i was assuming it wasn't passing the values.
So i thought i'd try and use the print method to get around the what i thought was happening. But i was wrong..so wrong.
My brain needed to come up for air lol.
Sorry about that, but thanks for replying you helped me realize my error.
As you've discovered, you can use square brackets within the wiki-text link or image markup (at least in SugarCube, I'm uncertain if the vanilla headers allow it). There is a limitation to that, however. Using square brackets (either array literals or property access using the square bracket notation) inside the wiki-text markup is allowed as long as they do not make the markup ambiguous, which basically means don't let them touch the square brackets of the markup.
In other words: