Howdy, Stranger!

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

Solved: How to use a macro?

edited August 2014 in Help! with 1.x
Hi All,
I'm using sugarcane and have been trying to use glorioustrainwrecks combined replace macro set as I would like to use the <<once>> macro.
Problem is I don't know how to actually import a macro into twine.
I've tried copying the macro code into a passage and tagging it script or macro but that doesn't seem to work.
(I just get not defined macro error when I run the game)
Do I have to give the passage a special name or something or is there some form of import command?
Sorry if this seems basic to everyone else but I can't find any relevant twine documentation telling me how to do it
Thanks
nowherecity24

Comments

  • I have attached a example, it explains in detail how to use the <<once>> macro in the Start passage.

    basic steps: embed javascript in script passage; embed three CSS rules in stylesheet passage; use <<once>> macro.

    The <<once>> macro only seems to work if you:

    a. Revisit the passage contain the <<once>> by moving forward through your story, it does not work if you go backwards.
    (eg using the back button/macro results in the text being shown again)

    b. If you have the same text (wrapped in the once macro) twice in your story in at least two different passages.
    The text will be shown in the first passage you visit but not in the second (or other any other for that matter)
  • HI greyelf
    Thanks that worked a treat.
    Not sure why as I did the pretty much the same thing except I put the CSS into an existing stylesheet.
    Just a question because I am curious does the name of the script passage actually matter or not?
    Thanks again
    nowherecity24
  • The name of the script or stylesheet passages can be anything you like.
    I named them what I did just to make it clear what they contained.
Sign In or Register to comment.