Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Updating variables

$
0
0
This is similar to my last post, but is there any easy way to 'refresh' a variable? For example:
$time seconds left.

[Look around the room.]<look|

(click: ?look)[(set: $time to it - 1)(replace: $time)[$time](replace: ?look)[You're in a small storage room. There's a shelf, and a crate.]]
I want to subtract one from $time when you click the link, and I can do the subtraction bit just fine. My problem is that the $time variable still shows the previous number, because it hasn't re-run that part of the code.
The part where I try to replace $time with $time doesn't work, because the replace command only does hooks and text. I'm guessing the solution is close to this, though.
I'm using Harlowe. I can switch to a different format if this feature is only in the more fleshed-out formats, but ideally I would like to stick with Harlowe.

Viewing all articles
Browse latest Browse all 1844

Trending Articles