Quest Gamebook: Can I allow players to choose their own name?

0 votes
111 views
asked Jul 22 in Authoring by iwillbegentle (1 point)

As far as I can tell, gamebooks don't rely on any typing input by the players and all the players have to do is click links to go to the next page therefore I don't even know if this is possible at all.

I am super new to writing interactive fiction and my knowledge on script writing is slim to nil and I was wondering if it is possible to allow a player to input their name at the beginning of a gamebook and if so, how would I go about making it happen (like the code/script necessary). And then what kind of script would I need to make their chosen name appear in the game?

1 Answer

0 votes
answered Jul 23 by hegemonkhan (161 points)

this is for Text Adventure version of quest, but it shows well how to do it:

http://docs.textadventures.co.uk/quest/guides/character_creation.html

and here's how to do it in GameBook version of quest:

'Pages' -> 'Page1' -> Page type: [script+text] or [script]

'Pages' -> 'Page1' -> Script: -> (see below)

add new script -> output -> 'print a message' Script -> print [message] Name?

add new script -> output -> 'get input' Script

-> then -> add new script -> variables -> 'set a variable or attribute' Script -> set variable player.alias = [expression] result

add new script -> output -> 'print a message' Script -> print [expression] "Your name is " + player.alias + "."

// I type in: HK
// outputs: Your name is HK.

commented Jul 23 by jaynabonne (141 points)
edited Jul 23 by jaynabonne
<nonsense deleted>
commented Jul 23 by hegemonkhan (161 points)
edited Jul 23 by hegemonkhan
that's strange... as I created a GameBook game to see if it could be done before I posted my asnwer above, and had no hoops to go through (the command~input bar was there and the get input worked fine) ... aside from maybe just setting the Page Type to: [script] or [script+text]. I verified it too, via a 'msg ("Your name is " + player.alias + "."). Also, I did do everything through the GUI~Editor's options, drop down menus, and etc. No in-code writing.

maybe it has to do with the quest version? or maybe I just got a funky, or rather, an awesome~cool, GameBook, laughs.

I've no idea how I happened to not have any hoops... no idea why ...

well, I guess we'll find out if it works okay or not, for the person who made this question, lol.
commented Jul 23 by hegemonkhan (161 points)
err... if there's a hoop with getting rid of the command~input bar, then I've not dealt with addressing that.
commented Jul 23 by jaynabonne (141 points)
Nah, it was me again. It must have gotten fixed in the most recent version of Quest (either that or it has always been that way, and I'm just insane). Even as I wrote the above, I thought to myself, "I bet this has been fixed, and I'm making a fool of myself..." lol  My apologies.
This site is now closed.
As of 1st November 2015, this site is a read-only archive. For more information see the intfiction forum post

Welcome to IF Answers, a site for questions and answers about Interactive Fiction.

Technical questions about interactive fiction development tools such as Inform, Twine, Quest, QuestKit, Squiffy, Adrift, TADS etc. are all on-topic here.

Non-technical questions about interactive fiction are also on-topic. These questions could be about general IF design, specific games, entering the IF Comp etc.
...