How to create the option a or option b mechanic on text adventures from game book, please?

Hello, im trying to figure out a method of creating the option a or option b mechanic you normally find in game books and create it in an text adventure, a reply would be very nice,

Thank You!


Do you mean like giving a player a set of options?

In gamebook mode, every room is a page, and the options are just exits you can click on. But a quicker way would be to use ShowMenu.

For example:

ShowMenu ("Which option do you choose?", Split("Option A;Option B"), false) {
  switch (result) {
    case ("Option A") {
      // script inserted here will be run if the player chooses option A
    }
    case ("Option B") {
      // script inserted here will be run if the player chooses option B
    }
    default {
      // this should never happen. The default is just to check
      // in case you made a typo in one of the options so it doesn't exactly match
      // this makes it so much easier to find and fix errors when testing
      error ("Couldn't find case (\"" + result + "\")")
    }
}

yea thats what i mean, do you have to write that in code form, or is there a button for it?

thanks btw.


There are a couple of ways to do it without the code, and will basically do the same thing.

Here is a tutorial for text input (where the player answers the question by typing something in):
http://docs.textadventures.co.uk/quest/asking_a_question.html

Here is a tutorial for menu (where there are two links to options, and the player has to choose one):
http://docs.textadventures.co.uk/quest/ask_simple_question.html

I hope this helps!


yea thats what i mean, do you have to write that in code form, or is there a button for it?

If you go into code view for a script, you can paste that in, and go back to the GUI script editor. That will show you what it looks like in the other editor.

Even if you prefer the "easier" editor, code view is the simplest way to send an example script to somebody else.


Thanks, this helped alot!


Hello there. Let me add my two cents on this topic.

If you use the Gamebook mode, it is quite easy adding the options to the game. Each page has a place where you type and link the options for the next page.

I am using the Text Adventure mode for making Gamebooks, what means I dont have this same mechanic, but the Text Adventure mode gives us plenty of more scripting option to play with. The solution I found actually double helped me.

I use rooms as pages of a gamebook and use the choices as objects in the room. The "Take" function actually has a script moving the object "player" no the next "room", wich is actually a page in the book.

This method is helping me a lot, because I can use the "Look at" button to show the details for each choice without having to include a "wall of text" to the main text, allows the player to just ignore option where the heading doesn't sounds interesting at the moment and also brings a dynamic of increasing the number of "player clicks", adding the sensation of interaction to the gamebook. It has been working for me. Perhaps works fr you too.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums