0 votes
asked by (190 points)
So I'm super new to Twine, and I'm managing to figure out most of the coding stuff with one exception:

 

I'm trying to make a timed event, where a player has many choices of places to look for a key. Each place they look (say, in a chest or on a desk) advances the time forward by one tick. If the player gets to 16 ticks, they are automatically taken to "Bad", which is the bad ending where they failed to find the key. To achieve this, I put this code at the bottom of every passage during this scene.

(set: $time to $time + 1)
(if: $time is 16) [(goto: "Bad")]

 

This seems to work with some screens. Time ticks correctly, but on some screens, it takes me directly to the "Bad" passage, even if the time has only gotten to 2. I have the EXACT same code pasted at the end of every passage.

 

I've also just noticed that on the passages that don't work (the ones that go directly to "Bad"), the code in square brackets isn't registering as a hook (no light orange highlight).

1 Answer

0 votes
answered by (190 points)
 
Best answer
I have found the answer! My problem was that I had a lot of (link go-to:) macros, and didn't close a parentheses on one of them!
...