It looks like you're new here. If you want to get involved, click one of these buttons!
[img[n-04-2014-2888]]
Where would you like to go?
<<if $pink neq 1>>[[Go towards the left]]<<endif>>
<<if $playedchess neq 1>>[[Talk to the man at the chess table]]<<endif>>
<<if $wapp neq 1>>[[Approach the women with the dog]]<<endif>><<if $sshouse neq 1>><<if $dog is 1>>[[Try the women with the dog again|ss2]]<<endif>><<endif>>
<<if $wapp is 1>>[[Go over the footbridge to the other side of the park|bridge]]<<endif>>
[[Leave the park|001]]
I'm probably not doing this the best way but it's how I've been making it work, it just doesn't look pretty when big gaps appear between the lines, so is there a better way?
Comments
In your case, what I would do is add a backslash to the end of each line on which you have an <<if>> statement, and put a <br> right before each <<endif>>. Example: The "\" removes the linebreak for each line it punctuates. The <br> inside the <<if>> statement conditionally adds a linebreak.
This way, you get to preserve the readability of your code while providing the output solution, which is to run all the <<if>> statements together on a single line for output and then adding a linebreak back in for each <<if>> statement that actually resolves and displays link text.
For more complexly-written passages, you'll end up using <<nobr>> too. Which you can add inline the usual way, <<nobr>><<endnobr>>, or you can give an entire passage a "nobr" tag and there will be no linebreaks in that passage (meaning you have to add them manually where you want them, with <br>).
<<silently>> <<endsilently>>
option. The only problem with this is that it won't put any input out if any is specified between the tags. For instance won't produce any output whatsoever, but it's good when used for code that doesn't display anything directly. It does fall down when you try to split the code with the tags though. Using<<silently>>
for the bits you don't want line breaks in and then slapping<<endsilently>>
for the bit's you want to display won't work.Due to this,
<<silently>>
wouldn't be suitable for what you're attempting to do, but might come in useful later on if you have something that is, erm, silent.Thanks that does the trick!