0 votes
by (210 points)
I have a game I am working on to where I need certain text to appear at a certain time. I thought that with each new page, the timer would reset back to zero- but it seems I was mistaken. What I expected was for the lines of text to appear gradually on each page, say the first takes three seconds then the next takes five seconds- two seconds after the first, and it goes on. But I have noticed, in one of my later panels, that the text all appeared in one clump- despite me seperating them using Timed macros. Is there a way to reset the clock to 0 for each page, or is there something I don't know about using <timed> </timed> macros?

Right now it seems that the clock just keeps running as soon as the game is started, regardless of player input or links clicked or anything, the internal clock keeps ticking away the seconds the tab is open. It seems nearly impossible to know how long someone would spend on each page reading, to come up with a proper variable for how much time to add if I were to continue using timed by itself.


Any help is truly, greatly appreciated

1 Answer

0 votes
by (44.7k points)

Any time you go to a new passage, doing that should cancel any pending <<timed>> macro events.  If you want to trigger a series of events within a passage you should use the <<next>> macro inside of the <<timed>> macro.  (See the documentation I linked to for details and examples.)

If that doesn't answer your question, you're going to have to be a bit more clear about what you mean by "pages" and "panels" (do you mean "passages" or something else?), explain more clearly exactly what it is that you're trying to do, and show us enough of the code so we can figure out what might be going wrong.

Hope that helps!  :-)

by (210 points)
The error was mine. Next helped me not have to factor timed as much, as I can set events to happen a certain interval from each other, rather than having to set each individual thing to happen after a set period of time ((i.e., instead of <<timed 10s>> this happens, <</timed>><<timed 13s>> then this>><</timed>> I can instead put <<timed 10s>> this happens, <<next 3s>> then this<</timed>> which makes it a lot easier. I did not know about this, so thank you.

My error actually embarrasses me. None of the code worked since I used one set of arrows, <textgoeshere>, and not two sets, <<codeworkshere>>. A simple fix, yes, but one that I kept overlooking.

All the same, thank you very much for the help and for making my work a bit easier~