Howdy, Stranger!

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

How do I use ?

I tried to make it work but when I run my game it says that timedgoto does not exist, why is that?

Comments

  • Are you trying to use the Twine 1.x timedgoto macro written by Leon in a Twine 2.x story, because it won't work.

    Which Twine 2 story format are you using?
  • I'm using twine 2 and sugarcube
  • edited May 2015
    With the replace macro set on SugarCube's homepage you can combine a <<timedcontinue>> and <<goto>> macro.

    If you put it inside a widget I think it doesn't affect the rest of the page like a raw <<timedcontinue>> does, so you effectively get the same thing.
  • There is no timedgoto macro in SugarCube according to it's macro documentation, which is why you are getting that message.

    You will need to either remove the timedgoto macro from your story's code and find another way to do what you want, or find someone to create for you a version of Leon's timedgoto macro that works in SugarCube.
  • edited May 2015
    Untested, but this should work:
    version.extensions.timedgotoMacro={major:1,minor:3,revision:0};macros["goto"]=macros["timedgoto"]={timer:null,handler:function(a,b,c,d){function cssTimeUnit(s){if(typeof s=="string"){if(s.slice(-2).toLowerCase()=="ms"){return +(s.slice(0,-2))||0}else{if(s.slice(-1).toLowerCase()=="s"){return +(s.slice(0,-1))*1000||0}}}throwError(a,s+" isn't a CSS time unit");return 0}var t,d,m,s;t=c[c.length-1];d=d.fullArgs();m=0;if(b==="timedgoto"){d=d.slice(0,d.lastIndexOf(t));m=cssTimeUnit(t)}d=eval(Wikifier.parse(d));if(d+""&&state&&state.init){if(macros["timedgoto"].timer){clearTimeout(macros["timedgoto"].timer)}s=passage();macros["timedgoto"].timer=setTimeout(function(){if(passage()===s){state.display(d,a)}},m)}}};
    
Sign In or Register to comment.