Picking a Character name from a list and entering character names

akeeneplay
05 Nov 2017, 17:17

I want my player to be able to enter their name and choose a job (handy man or something). How could I do a name input


K.V.
06 Nov 2017, 10:40

Hello,

This may help out a little:

@title Setup
#### Welcome to the gamebook!


[[BEGIN]]

[[BEGIN]]:
@clear
    var name = prompt ("Please enter your first and last name.", "");
    name = name.split(" ");
    if (name.length != 2) {
      squiffy.story.go("BEGIN");
      return;
    }else{
      set("named", true);
      var firstName = name[0];
      var lastName = name[1];
      set ("firstName", firstName);
      set ("lastName", lastName);
      squiffy.story.go("welcome");
    }
[[welcome]]:
@clear
Welcome, {firstName} {lastName}!

### Which career suits you?

**{rotate c1:handyman:auto-mechanic:doctor}**

[[Submit]]

[[Submit]]:
You chose {c1}!

Padrinos
07 Nov 2017, 20:28

ooo, I like that rotate KV. Thanks


K.V.
07 Nov 2017, 20:51

Thanks, Padrinos!

I found rotate while looking through the GH-pages branch on GitHub not too long ago.

I just noticed I forgot to put some text over it, like, "Click the link to change the selection, then click Submit."

(Whoops.)