Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How do I create a command line prompt?

I'm trying to create a command line prompt where people type in a string (like 'look' or 'north' or what have you) and the story moves to another scene based off of what they type. I'm new to Twine, but saw that some stories have this feature.
The project I'm working on starts with them entering a password to begin. I can't seem to find any information on what build to use (Harlowe, sugarcube, etc) to achieve this. How would I do this?
Thank you!

Comments

  • edited August 2016
    SugarCube has a number of built-in Interactive Macros which can be used to optain information from the Reader, one of them is the <<textbox>> macro.

    Harlowe and Snowman don't have these macros but you can use the standard HTML input elements combined with some Javascript to simulate similar functionality, as demonstrated by this Harlowe hack created by csalzman and extended slightly to support textarea elements by me.

    But the above only solves the first part of the problem, that begin the ability for the the Reader to enter commands, the second (harder) part which consists of:

    a. validating the input (empty, invalid characters, mixed case, etc...)
    b. parsing the input for meaning (verb, preposition, object, adjective, noun, etc..)
    c. implementing the outcomes

    ... will need to be either implemented by you or by someone else.
Sign In or Register to comment.