Howdy, Stranger!

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

How do you print macros inside links?

edited April 2017 in Help! with 2.0
I am using SugarCube 2.14.0 . Right now I am working on a new project on my own and I am trying to make a macro show right in a link.

This is the one im trying to use:

I am thin for my height of $playerheight, my weight of $playerweight is spread so that I appear quite lean.

The above is in the double '[' s

Comments

  • edited April 2017
    First. In the future, if you're asking for help with code, post the whole unadulterated code itself, not parts of it, not screenshots of it, etc. When you do, please use the code tag when posting code or markup—it's C on the editor bar.

    Second. Your example contains markup, not macros. You could not use a macro within your example context.


    Due to reasons of legacy, you cannot use markup with double square bracketed links. As their documentation notes, their components may be either plain text or a valid TwineScript expression. Thus, you either need to reformulate your text as a TwineScript expression or use the separate argument syntax of the <<link>> macro, which does accept markup.

    For example, as a double square bracketed link:
    [["I am thin for my height of " + $playerheight + ", my weight of " + $playerweight + " is spread so that I appear quite lean."|…]]
    

    For example, as a <<link>> macro:
    <<link "I am thin for my height of $playerheight, my weight of $playerweight is spread so that I appear quite lean." "…">><</link>>
    


    The periods of ellipsis in both examples are stand ins for the passage name.
  • First. In the future, if you're asking for help with code, post the whole unadulterated code itself, not parts of it, not screenshots of it, etc. When you do, please use the code tag when posting code or markup—it's C on the editor bar.

    Second. Your example contains markup, not macros. You could not use a macro within your example context.


    Due to reasons of legacy, you cannot use markup with double square bracketed links. As their documentation notes, their components may be either plain text or a valid TwineScript expression. Thus, you either need to reformulate your text as a TwineScript expression or use the separate argument syntax of the <<link>> macro, which does accept markup.

    For example, as a double square bracketed link:
    [["I am thin for my height of " + $playerheight + ", my weight of " + $playerweight + " is spread so that I appear quite lean."|…]]
    

    For example, as a <<link>> macro:
    <<link "I am thin for my height of $playerheight, my weight of $playerweight is spread so that I appear quite lean." "…">><</link>>
    


    The periods of ellipsis in both examples are stand ins for the passage name.



    Thankyou, this helped alot!
Sign In or Register to comment.