Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Simple If Macro Problem?

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

  • Hey, just a friendly tip. It helps a lot if you specify the Header your using for your story. You kind see it if you usually in your sidebar if you haven't removed it in your CsS - "This story was made with ____". But since you said your new, then I'll go ahead and assume your using SugarCane.

    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.
  • You didn't state which Story Format you are using, it is a good idea to include this when asking for Help because it can effect the answer given.

    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.

    #passages .title {display: none;}
    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.

  • laika wrote:

    I'm cribbing directly from the twine documentation wiki for my if statement code.


    You must mean this:

    :: Antherica
    You have no doubt, from Selator's description, that you have found the
    Antherica plant. Half your mission is completed. Now you must return to the
    village with the precious berry.
    From the &lt;&lt;if&gt;&gt; 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".
Sign In or Register to comment.