Howdy, Stranger!

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

[Harlowe] Trying to set variables on click?

edited July 2015 in Help! with 2.0
Hey! I'm using the most recent release of Twine2 for Mac, Harlowe story type.

So, I've looked through the documentation and around the forum, and it looks like this might be possible (click macros? change macros? live? one of these things might be the right thing but they're all a bit beyond me at the moment), but I'm not really sure where to start, so I figured I'd ask:

Is there a way to set specific variables based on what link a player clicks? Something like:
[[Option 1->Confirm]](set: $A to 1)
[[Option 2->Confirm]](set: $A to 2, $B to ($B - 1))

So, the passage is the same (a generic confirmation page thing), but the actual clicked link changes the variables, that way I wouldn't have to make a separate confirmation passage for each choice (in the actual game I'm working on, there's 9 of these choices, and there's 100 pages featuring these choices, so I've been looking hard at how to pull off some shortcuts, and this would save my ass, haha.

Thanks for any help you might have!

Comments

  • http://twine2.neocities.org/
    http://twinery.org/wiki/twine2:guide
    (link: "link text")[(set: $foo to 1)(goto: "passage title")]
    
  • Well, I feel kind of like an idiot for having missed that, but it's perfect. Thanks, man.
  • Using this method the editor doesn't create the links between passages. Is this intended?
  • Bridger wrote: »
    Using this method the editor doesn't create the links between passages. Is this intended?
    The Auto Create Missing Passage and Show Link Between Passages features of the Twine 2 editor only recognizes/support the basic markup links common to all three story formats, so both of these features don't work correctly for either macro based links or extended markup links types like setter links.
Sign In or Register to comment.