Howdy, Stranger!

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

noob question: remark syntax???

There are /% %/ for block quote in twine. In javascript, it is "//" . Some programming language use "'", "rem", "*".

So what is the remark syntax in twine?

The following does not work.

<<set $player = {
name: "John",
stat: {
endurance: 60,
arms: 75,    //strength of arms
legs: 30,    //strength of legs
hands: 50,    //hitpoints of arms
feet: 100,    //hitpoints of legs
cash: 200
}
}>>

Does not see anything in wiki or google group.

Comments

  • The usual story formats do not have an inline comment markup (I can't say for unusual ones like Snowman).  So, you'll simply have to use the block comment (/% %/).

    For example:

    <<set $player = {
    name: "John",
    stat: {
    endurance: 60,
    arms: 75, /% strength of arms %/
    legs: 30, /% strength of legs %/
    hands: 50, /% hitpoints of arms %/
    feet: 100, /% hitpoints of legs %/
    cash: 200
    }
    }>>
  • TheMadExile wrote:

    The usual story formats do not have an inline comment markup (I can't say for unusual ones like Snowman).  So, you'll simply have to use the block comment (/% %/).

    For example:

    <<set $player = {
    name: "John",
    stat: {
    endurance: 60,
    arms: 75, /% strength of arms %/
    legs: 30, /% strength of legs %/
    hands: 50, /% hitpoints of arms %/
    feet: 100, /% hitpoints of legs %/
    cash: 200
    }
    }>>


    Well, unfortunately this does not work. /% %/ works as itself, instead of a remark of the line.
  • Ack.  Sorry, I wasn't paying enough attention there.

    Inside of a &lt;&lt;set&gt;&gt; macro you'd use the normal JavaScript commenting styles (inline: // or block: /**/), since it's a JS environment in there.  You say that you tried the inline comment syntax and that it didn't work for you, but that should be impossible.  What story format and Twine version are you using?  Also, when you say that it did not work, what did you mean, exactly?  Did you get an error?

    n.b. For reference, while using the latest Twine release (v1.4.2), I just tested both of the following examples in each of the latest vanilla story formats (those that come with Twine: Jonah, Responsive, & Sugarcane) and the latest SugarCube release.  In all cases, both styles of comment worked flawlessly.

    <<set $player = {
    name: "John",
    stat: {
    endurance: 60,
    arms: 75, // strength of arms
    legs: 30, // strength of legs
    hands: 50, // hitpoints of arms
    feet: 100, // hitpoints of legs
    cash: 200
    }
    }>>

    <<set $player = {
    name: "John",
    stat: {
    endurance: 60,
    arms: 75, /* strength of arms */
    legs: 30, /* strength of legs */
    hands: 50, /* hitpoints of arms */
    feet: 100, /* hitpoints of legs */
    cash: 200
    }
    }>>
  • I believe the problem is that they don't visually look like remarks/comment (eg. change colour), this is because the passage editor does not know how to syntax highlight them as such but as TheMadExile states they will behave like remarks/comments.
  • Cool. One problem solved. Thanks TheMadExile and greyelf for the clarification. I do not know what I have done wrong. Maybe I have "//" mixed up with other syntax such as "'". Anyway "//" works. That is going to save me a lot of trouble.
Sign In or Register to comment.