+1 vote
by (170 points)
I'm a novelist, and I also teach writers how to create better fiction. I'm building a game for my website to let readers discover the different kinds of fiction and nonfiction I offer, and when they play through the game, I'd like for them to be able to download various short stories in different genres, as well as some mini-classes and lesson demos directly as part of the game.

So far, I haven't found a way to create download links inside the game. Is this possible? Or do you have a workaround for linking to external pages that would allow the player to obtain these resources and still keep playing the game?

1 Answer

+1 vote
by (43.1k points)

Basically you'd use a standard HTML link:

<a href="https://somesite.com/pdfs/somefile.pdf">Click here to download PDF.</a>

If you want to be sure it opens in a new window you can do:

<a href="https://somesite.com/pdfs/somefile.pdf" target="_blank">Click here to download PDF.</a>

The target="_blank" part makes sure that that the link opens in a new window.

Hope that helps!  :-)

by (170 points)
Thank you so much.  I want this to be fun for my reader/players -- and being able to build some real "treasure" directly into the game should add nicely to the adventure.
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.
...