0 votes
by (120 points)
Hi, I'm trying to make it so the link leading to the next passage displays an alert. When the alert displays and you click OK on the box that appears, is there a way to make it go to the next passage?

1 Answer

0 votes
by (37.1k points)

If you're talking about using the JavaScript alert() function, then you should be able to just do this:

<<button "Modal alert test">>
	<<run alert("Message")>>
	<<goto [[Next Passage]]>>
<</button>>

Which would display the message when you click that button, and it would only go to the "Next Passage" passage after you closed the alert window.

Just be careful when using the <<goto>> macro, because it will continue to execute any lines of code after it, even though it's already bringing up the passage you tell it to go to.

Hope that helps!  :-)

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.
...