In need of some advice regarding creating a simple gamebook

TheKovacs
17 Jun 2017, 19:12

Hello!

I'm a long-time fan of gamebooks, and really want to create one of my own. I've been playing around with the gamebook mode, and it's pretty simple to create pages and link them together appropriately to form storylines, but there are a couple of slightly more advanced elements which I would like to learn and implement in the game:

  1. I would like to have attributes such as 'Strength' or 'Perception'. Making certain choices would add points to these levels, and if the player has enough points in these attributes it unlocks extra choices which would not normally be visible.

  2. It would also be great for the character to be able to acquire and spend money.

Could anyone point me to any tutorial content for these? I'm willing to use the main Quest interface if necessary, rather than just the Gamebook mode. Thanks in advance.


DarkLizerd
17 Jun 2017, 19:49

There are few to no examples for game book.
Money has been added to Text Adventures.
GB would be a way to get your foot in the door to programming, but TA will take you further.


TheKovacs
17 Jun 2017, 20:28

Thanks, TA it is from now on, then.

Are there any tutorials regarding money in TA?


DarkLizerd
17 Jun 2017, 20:34

"money" started in the latest Quest update...
Not sure about how many tutorial are done on it yet...


hegemonkhan
18 Jun 2017, 00:17

there's actually a lot of resources here, and it's not "too" hard to learn how to use scripting (Attributes and the 'if' Script), as I myself found quest and used it to learn to program, from having absolutely zero knowledge on programming (as well as game makiing / designing / developing, lol). Though, if you're completely new to programming/coding/scripting, it'll take some time to grasp/understand scripting, as you got to train your brain in its 'if'-logic usage. The scripting itself is (for the most part) the same between Game Book and Text Adventure, though your means of accessing the scripting is a bit different between them. Here's some links of, mine and others (most of the resources are Pixie's), on doing scripting:

http://docs.textadventures.co.uk/quest/ (the quest doc, resources galore)
http://docs.textadventures.co.uk/quest/#Tutorial (the tutorial in the quest doc)
http://textadventures.co.uk/forum/games/topic/5940/quest-tutorials-and-templates-published (there's still a big gap between the tutorial and trying to do stuff on your own in trying to make your own game and parts/features/capabilities of it, so XanMag has created a 'tutorial 2' game, to help with the transition from the tutorial to actually doing various stuff on your own that you probably want in your game)

http://docs.textadventures.co.uk/quest/elements/ (the 'Elements' are quest's underlying code's OBJECTS of its: Object-Oriented Programming: OOP / Object-Orientied Design: OOD, not to be confused with the user-level 'Object/Page' Element. Some of the other Elements are: Functions, Verbs, Commands, Exits, Turnscripts, Timers, ObjectTypes / Types, and etc. Just know that these 'Elements' are your 'physical things' in quest, your main 'tools/building blocks')
http://docs.textadventures.co.uk/quest/types/ (here's the different, Attribute Types / user-level Data Types, in quest)
http://docs.textadventures.co.uk/quest/attributes.html (here's even more built-in Attributes too)

http://docs.textadventures.co.uk/quest/elements/object.html (here's many of the Attributes of the 'Object' Element)
http://docs.textadventures.co.uk/quest/elements/game.html (this is the special 'game' Game Settings Object and its Attributes, which both Text Adventure and Game Book has)

http://docs.textadventures.co.uk/quest/scripts/ (some of the built-in scripting Scripts/Functions)
http://docs.textadventures.co.uk/quest/functions/ (categorical order, the mostly-rest of the Functions)
http://docs.textadventures.co.uk/quest/functions/index_allfunctions.html (alphabetical order, same as the above link, just sorted alphabetically instead of categorically)

http://docs.textadventures.co.uk/quest/#Howto (more guides/resources)
http://textadventures.co.uk/forum/samples (more resources/guides: libraries and code samples)

http://docs.textadventures.co.uk/quest/text_processor.html (the text processor commands are useful and easy, compared to doing scripting the 'normal' way, so use them when you can, but you can always use the 'normal' way of doing scripting too, if you need to in that you can't use text processor commands and/or if in some cases where it's just more complicated to use the text processor commands than using the 'normal' scripting way)

some of my resources on scripting (Attributes and the 'if' Script):

http://textadventures.co.uk/forum/samples/topic/5559/attributes-and-if-script-guide-by-hk (scripting: Attributes and the 'if' Script, a detailed guide more oriented to coding but I do tell how to do the stuff in the GUI/Editor too, also this includes some explanation of the concepts of programming and of quest's user-level design/structure, to help in understanding the coding of quest better too)

http://textadventures.co.uk/forum/quest/topic/5387/i-really-need-help#37375 (here's a step by step guide/walkthrough on creating your own demo game to teach you the basics of usage of Attributes, including the usage of the 'statusattributes' too)

http://textadventures.co.uk/forum/samples/topic/5137/list-and-dictionary-extensive-guide-by-hk (List/Dictionary Attributes are a bit more advanced/confusing/difficult/hard to learn than the normal Attributes: Booleans, Strings, Object reference/pointers, Integers/Ints/Non-Decimal Numbers, Doubles/Floats/Floating Points/Decimal Numbers, and Scripts)

http://textadventures.co.uk/forum/samples/topic/5138/explore-and-travel-code-sample-by-hk (example of moving around without using Exits: you 'search' to first discover more areas, and then you can choose which of those discovered areas to travel/move to and/or back from, using Lists/Dictionaries)


The Game Book can do scripting, though it doesn't have the full capabilities of the Text Adventure, but you can certainly probably do most if not all (depends on how RPG-scripting-heavy you want your Game Book) of the scripting you need for your Game Book game making plans/ideas/goals.


in the Game Book, to do (the accessing of the) scripting:

'NAME_OF_PAGE' Page Object -> 'Page' Tab -> Page Type: [SCRIPT] or [TEXT+SCRIPT]

then follow the scripting for Text Adventure (as it's the same for both Text Adventure and Game Book): add new script -> (choose/set-up your Scripts)


while, my 'Attributes and the 'if' Script' guide/link talks about this (roughly the middle and near the bottom), I'll briefly touch upon it here too:

Attributes:

using currency as an example (as it covers how to increase or decrease Attributes, such as often done with 'stat' Attributes in games: strength, endurance, dexterity, etc etc etc): instead of having individual 'gold/gold-coin (or whatever the name of your currency)' Objects and moving them around, you can just use Attributes and adjust their Values, to produce the same effect of transactions (via adjusting yours and others currency amounts/Values), for example (Text Adventure, let me know, and I'll help with doing this type of stuff in Game Book), for some scripting examples:

buying:

initial states:

katana.parent = shop_owner // the 'shop_owner' Object currently contains/has the 'katana' Object
katana.price = 50 // the price of the 'katana' Object is '50' (the 'price' is an Integer Attribute just as the 'currency' is an Integer Attribute seen below)
player.curreny = 100 // the 'player' Player Object's 'currency' Integer Attribute's current Value is '100', you have 100 currency
shop_owner.currency = 100  // the 'shop_owner' Object's 'currency' Integer Attribute's current Value is '100', the 'shop_owner' has 100 currency

buying actions/process/scripting:

if (player.currency >= katana.price) { // unfortunately, we don't want you to be able to buy the katana if you can't afford it (doh! lol)!
  player.currency = player.currency - katana.price // you buy the katana (subtract your currency by the price of the katana)
  shop_owner.currency = shop_owner.currency + katana.price // you buy the katana (add the katana's price to the shop owner, as you pay for it, you buy it)
  katana.parent = player // since you paid for the katana, you obviously want to actually get the katana, lol. The 'player' Player Object now currently contains/has the 'katana' Object
  msg ("You buy the katana")
} else {
  msg ("You can't afford the katana")
}

// new/current/resultant states (if you were able to buy the katana):
//
// player.curreny = 50
// shop_owner.currency = 150
// katana.parent = player
// katana.price = 50 // this does not get changed, it's not a new state

// --------------------------------------------

Selling:

initial states:

katana.parent = player // the 'player' Player Object currently contains/has the 'katana' Object
katana.price = 50 // the price of the 'katana' Object is '50' (the 'price' is an Integer Attribute just as the 'currency' is an Integer Attribute seen below)
player.curreny = 100 // the 'player' Player Object's 'currency' Integer Attribute's current Value is '100', you have 100 currency
shop_owner.currency = 100  // the 'shop_owner' Object's 'currency' Integer Attribute's current Value is '100', the 'shop_owner' has 100 currency

selling actions/process/scripting:

if (shop_owner.currency >= katana.price) { // we don't want to sell the katana to the shop owner if he can't afford it (if he doesn't have enough currency to give to you), lol
  shop_owner.currency = shop_owner.currency - (katana.price / 2) // you sell the katana (subtract shop owner's currency, as usual in rpgs lol, by half the price of the katana, lol)
  player.currency = player.currency + (katana.price / 2) // you sell the katana at half price, as is usual in rpgs lol (add the katana's halved price to the player, as you sold it to the shop owner)
  katana.parent = shop_owner // since you sold for the katana, you unfortunately have to give the katana to the shop owner (doh!), lol. The 'shop_owner' Object now currently contains/has the 'katana' Object
  msg ("You sold the katana")
} else {
  msg ("The shop owner can't afford the katana")
}

// new/current/resultant states (if you were able to sell the katana):
//
// player.curreny = 125
// shop_owner.currency = 75
// katana.parent = shop_owner
// katana.price = 50 // this does not get changed, it's not a new state

ask if you need help with anything and/or have any questions


hegemonkhan
18 Jun 2017, 00:53

P.S.

I forgot to mention:

in the Game Book, you only got two Objects that you can add Attributes to:

  1. the 'game' Game Settings Object
  2. the 'player' Player Object

so, for some examples:

(NAME_OF_OBJECT.NAME_OF_ATTRIBUTE = VALUE_OR_EXPRESSION)
(your 'NAME_OF_OBJECT' can only be either: player or game)

player.strength = 100
game.strength = 100
player.greeting = "hi, my name is 'player', what is your name?"
game.greeting = "Welcome to my game, I hope you enjoy it!"
player.dead = true
player.dead = false
game.dead = true
game.dead = false


however, you can still create the effect of having more Objects:

game.dragon_dead = false
game.dragon_life = 999
game.dragon_damage = 500
game.orc_dead = false
game.orc_life = 100
game.orc_damage = 50

(there's nothing wrong with using the 'player' Object, but it does jar us humans in terms of the conceptual-logic of it, lol)
player.dragon_dead = false
player.dragon_life = 999
player.dragon_damage = 500
player.orc_dead = false
player.orc_life = 100
player.orc_damage = 50

(and there's probably some things where it would be jarring to have it added to the 'player' Player Object instead of the 'game' Game Settings Object, but I can't think of any really good examples at the moment... aside from some really stupid examples: player.game_greeting or game.player_first_name, as you'd just do these instead obviously: game.greeting or player.first_name)


major powers
18 Jun 2017, 01:15

You can do all that with Gamebook mode, and it's easier.

Just set a Counter for stats.

Like,

SetCounter ("Perception", 10)

Then on a page that needs to check it:

if (GetInt(game, "Perception") = 10) {
    msg ("You succeed!")
    AddPageLink (PerceptionCheck1, PerceptionSuccess1, "You notice something peculiar about the wall in front of you.")
  }

And so forth.

And if you get to a page where the player needs to add 1 Perception point it's as simple as:

ChangeCounter ("Perception", 1)

And from there, the Gamebook will know what the counter is and you can give it conditions based on such.

In my experience, as a novice, it's been more easy starting in Gamebook mode. Learning from just a basic choose-your-own-adventure format and working up from there as needed. I'm building a full, working open world RPG in Gamebook mode, with a fighting pit, gambling games, archery contests, a swath of NPCs with random encounters and conditions that need to be met in each location/on each page, exploring the wilderness, a labyrinth, everything (it's quite a large book, but still) and it's more intuitive to my non-coding mind.

Just using counters, flags, if has/not seen page and some other frilly features, Gamebook can get A LOT done, with actually knowing less about coding.


And of course, correct me if I'm wrong, community! And also this comes with the caveat that way more of the community knows way more about the text adventure mode. But they always try to help with Gamebook issues. I've been helped many times over the last couple of years.


Edit: also adding on that the Text Adventure mode is INSANELY robust, it just takes more experience. I saw someone on Reddit recently who built a literal full-graphic Space Invaders-style video game just using the Text Adventure mode coding. So, if you're going for the gold, definitely use Text Adventure Mode. But if you just want to write a simple choose your own adventure with some stats, I and others can walk you through some of the points over the next few weeks!


hegemonkhan
18 Jun 2017, 06:27

if you haven't seen/played this, it's really incredible (the handling of dialogue/choices/decisions... wow, as well as his writing/authoring/story/plot/etc skills too):

(I think it is CYOA style game, at least it looks like it is)

http://textadventures.co.uk/forum/games/topic/4883/spondre

Spondre (re-arrangement of 'respond') by Jay (Jaynabonne), he's a really good programmer, who has helped a lot of poeple here, but he's busy in real life (or moved on: he's retired-I-think-or-maybe-he's-still-working software engineer, so ya, he knows how to program well! But, he likes text adventures, and it's a hobby for him and so he's been interested in quest and I think had been part of quest's development) and had't seen him at least post anything here (not sure if he's helping out with quest development still) for quite a while, sighs.

(I'm not sure if this was done as a Text Adventure or Game Book, or a customized hybrid of the two like Pixie made, but it's some awesome program/game and the writing is incredible and the choices/paths/decisions)

he also has the source code of 'spondre' made publically available somewhere too...


at least it can give you ideas... or inspire you... until... only to find out you can't program / game design like he can... lol


Pertex (also doesn't post too much) and Pixie (the useful/good helper extradinaire, lol -- I just try to help and fail/confuse people more, lol) are also very good programmers too. So is 'sgreig' but he/she doesn't post much, not sure if he/she is still here and just helping with quest development or not.

some of these people might have been with Alex and moved on with him or just from quest, or maybe they're still staying with quest as part of the new team... or they're jsut busy in real life currently... no idea...

We used to have good programming users... (like Sora, Chase, and Lev..something) but they were only here temporarily/shortly... sighs


hegemonkhan
18 Jun 2017, 06:28

also, this of jay's might be of interest to you too:

http://textadventures.co.uk/forum/games/topic/6421/responsif

no idea of exactly what it is and don't know much about it


TheKovacs
19 Jun 2017, 11:04

Thank-you so much for the help, everyone :D

I am currently reading through the tutorials and playing around in Gamebook mode, trying to make sense of where to put the code and how to implement it, rather than asking stupid questions. Hopefully everything will begin to make more sense with time.


hegemonkhan
19 Jun 2017, 16:57

let us know if you need help with this stuff