Howdy, Stranger!

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

Change passage timer, Snowman

Hi!
Is there any script that changes passage automatically in, say, 3 seconds? So that the user doesn't have to interact with the story at all, it'll just change passage without needing the user to click?

I found this: https://www.glorioustrainwrecks.com/node/5108
which is basically a timed go-to, but it only seems to work for Twine 1.4 and doesn't support the Snowman format.

I've also read up on Snowman's documentation, but couldn't find anything that suited this issue in particular.

Any ideas?

Comments

  • As explained by the Snowman documentation it is designed for those that already know (or are at least willing to learn) how to program using HTML/CSS/Javascript, it also expects you to look at it's source code to determine it's API objects and methods.

    note: The following code examples may include indentation and extra line-breaks for readability, they can be safely removed.

    To programatically navigate to a new passage you use the story.show() method like so.
    <% story.show("Target Passage Name") %>
    

    You have at least two ways you can delay the execution of the show():

    1. Use Javascript's setTimeout() method.

    eg. Delay the execution by three seconds.
    <%
    window.setTimeout(
    	function(){
    		story.show("Target Passage Name");
    	},
    	3000
    );
    %>
    
    WARNING: Depending on the brand and version of the Reader's web-browser, or on what you plain to do inside the setTimeout() method, you may want/need to include the Polyfill listed in the linked setTimeout documentation.

    2. Use Underscore's delay method.

    As documented, the Underscore library is included in Snowman.

    eg. Delay the execution by three seconds.
    <%
    _.delay(
    	function(){
    		story.show("Second");
    	},
    	3000
    );
    %>
    
Sign In or Register to comment.