Increasing timer with each choice

Dear all,

I have rooms with choices, and I want time to pass for each choice. I have stolen some code for that but don’t know how to use it.

<<widget “addmins”>>
<<run $gameDate.setUTCMinutes($gameDate.getUTCMinutes() + $args[0])>>
<>

Question now: How do I call this code? Like, when I am in Room 1 and have a choice to go to Room 2 and that would take 2 minutes, where and how do I call this “addmins” routine?

Thanks and kind regards,
G.

Probably like:

<<link [[Room 2]]>><<addmins 2>><</link>>

You should also be using the corrected version of those widgets.

Sorry for asking again, but I’m lacking the basic skills. (Sugarcube 1.0.34 if that’s of importance.) Right now my choice is simply displayed like this:

[[Room 2 looks tempting!|Room 2]]

How can I integrate the addmins command into this, or how do I need to rewrite the choice?

Thanks!

You do realize that’s older than dirt. You really should switch to v2.
 

Anyway. Josh gave you an example that works:

<<link [[Room 2 looks tempting!|Room 2]]>><<addmins 2>><</link>>

This also works, but doesn’t cause Twine 2 to show a connection arrow or attempt to automatically create a missing passage:

<<link "Room 2 looks tempting!" "Room 2">><<addmins 2>><</link>>

Phew, it works! Thanks! Although I get an error message “Error: macro <> does not exist”.

And yes, I will upgrade, promised. :wink:

You need to use backticks/backquotes when posting things that could be confused for the forum markup (Markdown), otherwise, as you can see, shenanigans may occur.

Sorry! The error message was “error: macro <</link>> does not exist”.

Meh. SugarCube v1’s version of <<link>> is called <<click>>. Either change to that (not recommended) or switch to v2 (recommended).

1 Like

That works like a charm, thanks a lot!!! (Will upgrade later.)