I can't seem to figure out if there's a simple macro to return to the previous passage, with variables or not.
I'm also trying an automatic return; if the player opens a closet, it displays the closet passage and returns automatically after a pause. This does not seem to work:
(time: 2s)[(goto: "2nd")]
Where "2nd" is the return passage.
(on edit DOH "live" not "time")
Comments
Also, it seems you have put a space between (live:) and the [hook] and there needs to be no space there.
And remember to put a (stop:) at the end of the final hook, so that the page doesn't keep reloading the (live:) macro endlessly.
Try this:
PS: you could remove the single quotation marks of the displayed text so that it all looks as one text.
Instead of creating multiple (live:) events, I suggest you use a singe (live:) macro and a variable to control which piece of text is to be displayed next.
Based on your original example:
The above re-formatted to make it more readable:
Hi @greyelf,
Is there a disadvantage with the multiple (live:) method, and/or advantage with the changing variable method?
I ask because I have been using a multiple (live:) option and perhaps I am messing things up in the long run or creating uknown problems for myself.
eg. Say you have three timers running but each one is set to three seconds then the user should not notice anything. On the other hand if each of those three timers is set to 1/2 a second then the user may notice a slow down.
Generally if you need multiple things to happen at different times it is better to use a single timer and just track the elapsed time or use a variable like my above example.
Also remember that a (live:) macro timer keeps firing until you either (stop:) it or the section (ie. passage) it is attached to is removed from the DOM (ie. move to a different passage)
Sounds effective. Does (stop:) end all the timers on the page, or is there a need for multiples?
This type of thing almost seems like it could use a macro to replace that big block of code greyelf suggests and automatically use one timer:
The (stop:) would be implicit when the last part of the sequence fires.
Thanks for the explanation. It makes sense. I need to change the way I've been doing things, because I didn't understand the (live:) macro properly.
That's a question I would like to know the answer to as well.
Just clarifying (in case some readers misunderstand) that this is a SUGGESTION for how such a function could be incorporated in future versions of Harlowe, and not actual code that currently works.
Good suggestion, by the way.
Based on the Harlowe source code a (live:) macro will also automatically stop if the section containing it (eg. Passage) is removed from the DOM (eg. via moving to another Passage). The source code documentation implies that there are other ways of removing a section containing a (live:) macro.
If a player clicks on a painting they can see from different room/passages and I go to a passage called "Painting" that says "Here's the description of the painting." I need to then do a Return->[History's Last to put them back wherever they were
?
I don't think so. All that will do is create a new passage called History's Last. I'm fairly new to twine myself, but I think the syntax you are looking for is ...
Hope that helps
GL
(set:) [$return to "(link-goto: "Return", (history:)'s last)"]
And then just put $return in the passage.
Isn't right, but I think I can make it work.
note: In SugarCube there are two macros <<back>> and <<return>>, the first macro moves the Reader backwards to the relevent passage and rewinds History so that any changes done to $variables in the passage containing the macro are undone, while the second macro move the Reader forward to the relevant passage and any changes done to $variables in the current passage are kept.
The above Harlowe example works like the <<return>> macro, it moves the Reader forward to the relevant passage.