Having big problems with the speed of my story, I'm experimentally trying to port it from Harlowe to Snowman. Something funny to do for someone who doesn't know Javascript. However, although my Harlowe code is long and elaborate, it's actually made of very few different macros, so I kind of trust I can get it done in Snowman.
One thing that I have no idea how to do, since Javascript documentation can't help and I can't find it about Snowman, is how to move from one passage to another indirectly: not with a standard Twine link like [this->this], but using the equivalent of a (goto:) macro from Harlowe.
What I need is creating a link that, when clicked, first sets some variables, and then jumps to the next passage.
Thanks!
Comments
Anyway. I believe what you want is story.show(). For example:
A custom link could be something as simple as:
A more complicated custom link could be something like the following:
You will need to style both of those as links, however. I recommend using CSS over something daft like adding href="javascript:void(0)" or href="#". For example:
Try using something like the following in your passage.
note: For some reason the following does not work even though I believe it should.
Of course, it's ridiculous trying to write Snowman without learning Javascript, but 1) I'm in a hurry, 2) I tried Javascript a few years ago, without any success, 3) I only need the equivalents to seven or eight Harlowe macros.
And 4) I counted on the awesome people in this forum.
Anyway, I'll read the Snowman code and see what I can guess.
I figured out how to get that working. Calling story.show() directly doesn't work but putting it inside a function does work (presumably that's some intricacy with scoping):
<%
$(function() {
story.show("Other Passage");
});
%>