"Her Story" search-term style game with Twine

Hiya, I am new to Twine (using the latest versions!) I want to make a “Her Story” style game where the player types in search terms. Based on what I’ve read and seen it feels like it should be possible, but maybe I’m trying to fit a square peg in a round hole? Here’s what I want in my game:

  1. Everything do-able with keyboard, no mouse required.
  2. To navigate to another page, the player types in a word or phrase.
  3. The player can go from any one page to any other page by using the above method.
  4. Previous pages are easy to navigate to or review (stretch-text, maybe?)

How can I easily accomplish this with Twine? Should I look into different software?

1 Like

Here’s an example that uses Sugarcube.

Step 1. Use the textbox feature for navigation. You can copy and paste this manually in the relevant passage, or include it at the bottom of each passage in a passage titlled PassageFooter.

<<textbox "$var" "" "Redirect">>

Step 2. In the passage titled Redirect, create a system that refers users to another page based on the text entered.

We also want to make sure that this is not case sensitive so we will convert the input to uppercase before checking.

<<if $var.toUpperCase() eq "DOG">><<goto "All About Dogs">>
<<elseif $var.toUpperCase() eq "CAT">><<goto "All About Cats">>
<<else>><<goto "Not Found">>
<<endif>>

Step 3. Create the passages that are referred to above (eg. All About Dogs), just as you would in a regular Twine game. If you have a central hub page with the search box, you should give players a way to get back there.

Step 4. Optionally, you can force the text box to always be in focus by creating a script passage with this code. Whenever someone types, the box will start displaying text.

function setFocusjquery() {
  $('#textbox-var').focus();
}

$(document).keydown(function() {
 setFocusjquery();
});

Be sure to change the var in $('#textbox-var') to whatever variable you used under <<textbox "$var"...>>

2 Likes

I’m deeply ignorant of Twine implementation, but thought I’d flag that there was a game in the 2020 Comp – Ghostfinder: Shift – that implemented something like this, where a search bar allowed the player to hit on new pages, which would then get added as links to the main hub page. There was also more traditional click-link Twine sections, but my understanding is you could probably look at the html file and check out the relevant bit to see if it’s a helpful example.

With that said, Twine is often pretty mouse-dependent – like, you can TAB between links but it’s much more awkward than clicking them. So depending on how you envision this working, one of the parser-based systems might be an easier fit? But honestly just allowing for clickable links to make navigation easier is probably the best way to go (that’s pretty much how Her Story’s interface worked, I think).

3 Likes

Tangent: Her Story is only 1.99 usd on steam at the moment.

2 Likes

Cool! And Sam Barlow’s latest game, Immortality, just came out a couple days ago too – it’s obviously pricier, and doesn’t have a keyword-search interface (you click on stuff you see in the videos) but the reviews have been pretty positive.

(Of course, Aisle is free).

3 Likes

Yeah, Immortality looks great. I’ve promised myself that I’ll only buy games if I have time to play them (some of y’all know what I’m talking about)! Hopefully I’ll be able to get it soon.

3 Likes

I Told You This Was A Bad Idea is a Twine game that is playable only by typing commands or keywords.

2 Likes

By the way, the code above is largely based on my own game Okinawa Online if you want to see it in action.

2 Likes

I’m having trouble with the “Step 4” force focus. I don’t see anything triggering when I push a key! I’ve attached my html and an image of the twine code.


https://n4z6nnjq.play.borogove.io/

I think in Twine 2 you have to insert the step 4 code here instead of in a passage.

I just tried and it seems to work with that change.

1 Like