Getting input from the player

Just starting with twine 1.x, loving it, but it seems that some documentation is missing. In particular, how do I get input from the player?

I have tried <<textinput $playerName>> but it doesn't seem to work.

Comments

  • Try...
    <<textbox "$playerName" "" "Passage_to_link_to">>[code]
    There's a slight difference if you're using SugarCube though. If you look on my posts you'll see my question about it, but using phone at the moment so can't answer fully.
  • @AntonMuerte:  &lt;&lt;textbox&gt;&gt; is the SugarCube text input macro.  The vanilla headers use &lt;&lt;textinput&gt;&gt;.


    @migueldeluis:  I'm assuming that you're using one of the vanilla headers (e.g. Jonah, Sugarcane) for the story format.  As far as I can tell from looking at its wiki page and the code, you must:
    [list type=decimal]
    Either specify the built-in button argument for one of the &lt;&lt;textinput&gt;&gt; macros on the page or supply a separate &lt;&lt;button&gt;&gt; macro.
    Use one of those buttons to navigate to the next passage.  Navigating via any other means will not properly set the $variables(This seems like a bizarre restriction to me, but whatever.)

    For example:

    Specify the built-in button argument for the &lt;&lt;textinput&gt;&gt; macro (if you have more than one, then the last one is a good candidate):

    <<textinput $playerName [[Next|passage]]>>
    Or use the separate &lt;&lt;button&gt;&gt; macro:

    <<textinput $playerName>><<button [[Next|passage]]>>
  • Thanks for correcting me. I was on my phone and I remember asking about it a while back but forgot it was about SugarCube.
Sign In or Register to comment.