Is there any way to auto-display a passage after a set amount of time? For example, after 3 seconds a passage saying "Hey" would automatically move to a passage saying "Hey hey!" without any prompting or clicking.
You need to say which story format you are using as answers can be different for each, I am going to assume you are using Harlowe (documentation)
You can use the (live:) macro to make something happen based on a timer, and the (goto:) macro to move the Reader to a different passage.
Add the following to a passage.
Hey!
(live: 3s)[(goto: "Hey Hey")]
(Just wait three seconds to see the next passage named Hey Hey.)
Create a passage named Hey Hey and add the following:
Make travelling to "Hey hey" conditional on a variable that you initialize to true. When you click "Hey Hey Hey", set that variable to false. That way, while the live macro will try to fire, it will find the variable false, and so not trigger the link.
Basically the two ways to stop a (live:) macro doing something over and over again are to either: a) move to a different passage which results in the timer being removed from the DOM , or b) use a (stop:) macro.
The problem with the (stop:) macro is that it needs to be inside the container associated with the (live:) macro. You can use a $variable to control if the macro does what you want or stops.
(set: $auto to true)
Hey!
(link: "Hey hey hey")[(set: $auto to false)]
(live: 3s)[(if: $auto)[(goto: "Hey Hey")](else:)[(stop:)]]
The above (live:) macro re-formatted to made it easier to read:
Comments
You can use the (live:) macro to make something happen based on a timer, and the (goto:) macro to move the Reader to a different passage.
Add the following to a passage. Create a passage named Hey Hey and add the following:
where clicking 'Hey hey hey' would not revert over to 'Hey Hey' after 3 seconds.
Thanks!
The problem with the (stop:) macro is that it needs to be inside the container associated with the (live:) macro. You can use a $variable to control if the macro does what you want or stops.
The above (live:) macro re-formatted to made it easier to read: