Hey! This is probably a very simple question, but I can't seem to figure out an answer. I'm very bad at coding and html so I'm probably just missing something. A very simple answer would be nice.
I'm writing a twine game with a custom stylesheet, code here:
http://pastebin.com/DGMTtcZd I'm cribbing directly from the twine documentation wiki for my if statement code. I start off the passage I want to be marked with
::Antherica, just for example. Then in the passage I want to be affected by the if statement, I write:
<<if visited("Antherica")>>
"Wonderful!" he exclaims...
<<endif>>
the issue is that on the first passage, with
::Antherica, the phrase "::Antherica" shows up at the top of the page! I don't want it to be seen, obviously. I'm thinking it might be a stylesheet issue? How do I fix this?
Thank you very much! I hope this all makes sense. :-[
Comments
I'll admit, I'm having a bit of trouble understanding your question. To my knowledge (I don't have the time to look it up) the visited() function returns the amount of times you've, well "visited" that passage. So if I went back and fourth to a passage called "Main Menu" five times, and I <<print visited("Main Menu")>>, I would get the result 5.
So if you just want to check if you've ever visited a passage (at all) you would use <<if visited("Main Menu")>>Blah Blah<</if>> or to check against it - <<if visited("Main Menu") eq false>>Code Here<</if>>.
But, this leads me to a much simpler answer, if there's something showing up on your screen that you don't want, but the code that's causing it you actually need, then enclose it in a <<silently>><</silently>>. The code runs the same, but won't display any output, so even if you put a <<print>> inside a silently, you'd see nothing on the screen.
I am assuming that you are using the Twine 1.4.2 GUI though you do mention that you have a passage marked with ::Antherica, which is the TWEE format of a passage title and Twine passage title should start with letters (a-z) and not symbols. (:)
(note: If you are using the Twine GUI and have a passage with a title of ::Antherica you should change it to be just Antherica)
The only standard story format that I know of that displays each of the passage titles when view the generated HTML is Johan, if this is the story format you are using you can stop the title being displayed by adding the following CSS to your stylesheet. This will also hide the bookmark and rewind to here because they are part of the title.
If this does not help you, please supple more information.
You must mean this: From the
<<if>>
macro page. As noted by greyelf, the ":: Antherica
" there is TWEE format notation, which denotes the title of the passage (i.e. ":: PASSAGE_TITLE"), you shouldn't actually include it within the contents of the passage. Think of it as shorthand that means, title this passage "Antherica
".