Howdy, Stranger!

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

Any chance for user input?

After examining the possibilities of Harlowe I am enthralled. There's some sour taste, however, because it lacks radiobuttons and checkboxes. Sure - with a live frame and a lot of coding you can simulate that but it would be more convenient to have native input macros for text entry and option selection. Is this "in the works" for Harlowe or has Harlowe been designed specifically without those options?

Comments

  • You can try the (prompt:) command, which opens a box for the user to type in, such as (prompt: "What's your name?") will open a box with a space to type in the answer. You can also make it a variable by doing it as (set: $(variable name of your choice) to (prompt: "(Your question)")) and there's also (confirm:) and (alert:). I hope this helps!
  • Thanks for the input but I'm not so much interested in text input as in presenting choices via checkboxes or radiobuttons. I know that you can do a radiobutton simulation via just presenting a set of links but in some situations that is clumsy so I am asking if the radiobutton and checkbox feature that was available with Twine 1 will eventually appear in Harlowe again.
  • I suggest creating a new issue on the Harlowe project website about this subject, because it is easy for a Story Format developer to miss forum posts if they don't look at the forums everyday.
  • OK, I will do that :)
  • Thanks for the input but I'm not so much interested in text input as in presenting choices via checkboxes or radiobuttons. I know that you can do a radiobutton simulation via just presenting a set of links but in some situations that is clumsy so I am asking if the radiobutton and checkbox feature that was available with Twine 1 will eventually appear in Harlowe again.

    Well there is a way for you to simulate the radiobutton and checkbox without using actual links. It's late so I'm just going to write the basis, the rest should be easy to figure out
    {
    (set: $opOne to false)
    (set: $opTwo to false)
    (set: $opThree to false)
    }
    {
    (if: $opOne is false)[(link: "Option One")[(set: $opOne to true)(print: "**Option One [X]**")]]
    }
    {
    (if: $opTwo is false)[(link: "Option Two")[(set: $opTwo to true)(print: "**Option Two [X]**")]]
    }
    {
    (if: $opThree is false)[(link: "Option Three")[(set: $opThree to true)(print: "**Option Three [X]**")]]
    }
    
  • edited January 2016
    @Chalk:

    Nods, thanks for the input. I was more thinking along the lines of a timer refreshed passage part (or whatever that is called in Twine). So, there's a new alternative thanks to Harlowe I didn't think of, great.

    While this is really ok for, say, a checkbox (or any number of them, actually) the display logic becomes a tad complex when you have a group of 4 radio buttons, though because you'd have to check the state of each four to decide which to display as "checked" and which not.

    Something like:

    <<nobr>>
    <center>
    <table><tr><td valign="top">Select Location to visit:</td><td>
    <<radiobutton "$locaction" 1 checked>> Greenhouse<br>
    <<radiobutton "$locaction" 2 >> Cottage<br>
    <<radiobutton "$locaction" 3 >> Lobby<br>

    <<radiobutton "$locaction2" 1 checked>> Flowerhouse<br>
    <<radiobutton "$locaction2" 2 >> Basement<br>
    <<radiobutton "$locaction2" 3 >> Attic<br>
    </td></tr></table>
    <<button Visit1>><</button>>
    </center>
    <</nobr>>

    looks much more compact in my opinion and even a year after you coded this you'll have an idea how it works. And adding a new location is just pasting a line in there as the group is created by the variable name and you do not have to write the logic to handle toggling the button state yourself - if you have SugarCube you can paste this into an empty passage and see that the top 3 and the bottom 3 buttons work independendly. Easy and compact and I like it because of that.

    While I really think your checkbox example could be handy and easy enough to use I think that (unless I am missing something) groups of radio buttons will just confuse things with their initial (if: ) checks and the needed (set: ) cascade per button.
Sign In or Register to comment.