How to create a <<timed>> macro that does not "expire"?

0 votes
asked Jan 2 by SmuJamesB (2,650 points)
edited Jan 3 by SmuJamesB
I want to make a real-time boss fight. This requires that the boss damages you repeatedly after X number of seconds. But how to do it? The <<timed>> macro works only once.

Clarification: the player and the boss must be able to "fire" multiple weapons. The player must click links to fire their weapons. The Health variable displayed in the sidebar must update as well.

2 Answers

+2 votes
answered Jan 2 by TheMadExile (46,180 points)
selected Feb 7 by SmuJamesB
 
Best answer

You want the <<repeat>> macro—it's, literally, the next macro above <<timed>> in the docs.

–1 vote
answered Jan 2 by Copyright_Invalid (690 points)
I can think of three ways to do this.

1.) Have the passage refresh each time the boss attacks by adding a link command that loops back on itself. (this goes in the hook.) This should make the fight code reset (without resetting health)

2.) Have the timer reset. I personally don't know how to reset the timer, but I'm sure it is possible.

3.) Have more than one <<timer>> macro. This one is not recommended, as you will end up with a lot of code filling up your passage, making it very distracting while you edit it.

 

I'm sure someone else can give you a better answer, but I figure I might as well try to help.
Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...