Customized Player's Name and Stats Gamebook

dreamy_butterfly
03 Feb 2017, 16:27

I am creating a gamebook and I want my player to choose the name they like, or even create a name by themselves. I have been using 'you' all this time, but eventually they need a name to be called by someone, I want it to be as customizable as possible.

And it will be wonderful if they can also choose their own appearances, like a straight or curly hair etc.
So I can just change some texts related to their appearances in the script.

And for the last one I want to input some stats to the player, that can resulted in different page directed from the options available and revealing hidden options. Also the incrementing and decrementing stats..

Thank you so much for your help, I wish the answers can also help the other newbies who have the same trouble.

You can just add links that can help me with the troubles. I have read the gamebook step-by-step tutorial here: http://docs.textadventures.co.uk/quest/tutorial/creating_a_gamebook.html

But it doesn't give any explicit explanation related to script and function. I need a help desperately.


DarkLizerd
03 Feb 2017, 17:03

I've seen a posting about player naming in gamebook...
(I know that does not help)
http://docs.textadventures.co.uk/quest/guides/character_creation.html
But it is basically adding stats to the player object...


dreamy_butterfly
03 Feb 2017, 18:50

Thank you! It actually helps, but I have a problem in the show menu part. I use the same settings like the example as far as possible, not the coding. I checked it multiple times to see if I missed a space or anything, but it's just like the original example. The error is:

Error running script: Function not found: 'ShowMenu'


The Pixie
03 Feb 2017, 19:05

There are a lot of things that are not available in the Game Book version.


hegemonkhan
03 Feb 2017, 21:14

you can create your own menu:

'game' Game Settings Object -> 'start' Script:

// or if you're using a Game Book: 
// 'YOUR FIRST PAGE' Page Object -> 'Page' Tab -> Page Type: [SCRIPT] or [SCRIPT + TEXT]

// creating your hair color list:
game.hair_color_stringlist_attribute = NewStringList ()
list add (game.hair_color_stringlist_attribute, "black")
list add (game.hair_color_stringlist_attribute, "white")
list add (game.hair_color_stringlist_attribute, "brown")
list add (game.hair_color_stringlist_attribute, "yellow")
list add (game.hair_color_stringlist_attribute, "grey")
list add (game.hair_color_stringlist_attribute, "red")
list add (game.hair_color_stringlist_attribute, "orange")

'hair_color_function' Function:

// your custom menu:
list_numbering_integer_variable = 0
msg ("Hair Color? (Type in the number of your choice)")
foreach (item_string_variable, game.hair_color_stringlist_attribute) {
  list_numbering_integer_variable = list_numbering_integer_variable + 1
  msg (list_numbering_integer_variable + ". " + item_string_variable)
}

// hair color selection:
get input {
  if (IsInt (result) and ToInt (result) > 0 and ToInt (result) <=  ListCount (game.hair_color_stringlist_attribute)) {
    player.hair_color_string_attribute = StringListItem (game.hair_color_stringlist_attribute, ToInt (result) - 1)
  } else {
    msg ("Wrong input, try again.")
    wait {
      ClearScreen
      hair_color_function
    }
  }
}

the scripting (and Attribute usage) is mostly the same for Game Book and Text Adventure (though Game Book has more limited capabilities), the only difference is in the ways that you access the scripting (and Attribute usage) between the two.

here's a guide on Attributes and the 'if' Script usage, aka scripting:

http://textadventures.co.uk/forum/samples/topic/5559/attributes-and-if-script-guide-by-hk

also, here's a step by step guide demo game on the basics of Attribute usage (but it's for a Text Adventure game, so some of the things you'll do/learn aren't available within/for a Game Book, however, this is still useful as it'll help you learn the basics of Attribute usage very well, helping you with whatever you want to do in the Game Book with Attributes):

http://textadventures.co.uk/forum/quest/topic/5387/i-really-need-help


ask if you need help with anything or need anything explained or whatever.


crystalwizard
03 Feb 2017, 23:04

I'm curious why you'd want to name the player, save stats, and so on, in the gamebook? That's kind of what the text adventure version is for.