Howdy, Stranger!

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

dynamic macro in SC2 T2

I am using <<timed>> macro in Sugarcube 2 in Twine 2.
How can I specify the time interval dynamically?

Instead of <<timed 3s>>
I want to use <<times $interval>>

Thanks in advance.

Comments

  • You can use a <<print>> macro to dynamically convert a String value into actual macro code.
    <<set $delay to "5s">>
    
    <<set $action to "<<timed " + $delay + ">>Hello World<</timed>>">>
    
    <<print $action>>
    
  • greyelf wrote: »
    You can use a <<print>> macro to dynamically convert a String value into actual macro code.
    @greyelf Why would you do that when you can simply give it a variable? The Stupid Print Trick™ is only required when you must capture a value.

    twinesims wrote: »
    I am using <<timed>> macro in Sugarcube 2 in Twine 2.
    How can I specify the time interval dynamically?
    Simply give it a variable—just as you seem to want to do.

    For example:
    /* Using a temporary variable here. */
    <<set _interval to "3s">>
    Thunderbirds.  Are.  <<timed _interval>>GO!<</timed>>
    
  • awesome. thanks as always!
Sign In or Register to comment.