+2 votes
by (690 points)
I want a player to type their own name, but all I can figure out is adding a digital 'keyboard" out of many passages and links. I've played Twine stories that have a place for you to type your name, so I know it's possible.

2 Answers

0 votes
by (158k points)

Harlowe has no built-in support for allowing a player to enter information into text input field and unfortunately the csalzman's text input hack mentioned in this comment on the old forum no longer works with recent version of Harlowe 2. This story format also has no documented Javascript API so there is no official way to use Javascript to update a Harlowe 2 story variable using Javascript.

You could try using the (prompt:) macro.

by (690 points)
thanks anyways... :(
by (560 points)

Greyelf is right, (prompt:) is the way to go.

(set: $name to (prompt: "Your name is...", "Casper the friendly ghost"))


0 votes
by (270 points)

Did you check this video by Dan Cox? 


He mentions the (prompt: ) macro but also modal windows. Maybe it can be useful.

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.