How to make Stats and dialogue choices in Quest Gamebook PLEASE HELP ME (First Quest Game)

excuse me but i need help i'm new in quest game book can anybody please tell me how to make stats and dialogue choices in quest game book mode like:
David enters the room and face a man with a knife dialogue options:
try to reason with him (charisma point needed 5)
try to hide from him (evade point needed 2)
try to run away (agility point need 3)
like fallout choices
sorry to ask you guys but i'm need help because i have no idea how to create that
i appreciate any help.


(filler for getting my edited post, updated/posted)


first, on your very first page, we're going to use it, to create the player stats and their initial values (Attributes):

'YOUR_VERY_FIRST_PAGE_NAME' Page -> 'Page' Tag -> Page Type: [script] or [script + text] -> (see below)

add new script -> 'variables' section/category -> 'set a variable or attribute' Script -> (see below, repeat as needed)

set variable player.charisma [EXPRESSION] 0

set variable player.evade [EXPRESSION] 0

set variable player.agility [EXPRESSION] 0


continuing, on your very first page, we're going to use it, to also create our String List Attribute (on/for/within the desired Page) for/of our list of choices:

'YOUR_VERY_FIRST_PAGE_NAME' Page -> 'Page' Tag -> Page Type: [script] or [script + text] -> (see below)

add new script -> 'variables' section/category -> 'set a variable or attribute' Script -> (see below)

set variable NAME_OF_PAGE.choice_list [EXPRESSION] Split ("try to reason with him (charisma point needed 5);try to hide from him (evade point needed 2);try to run away (agility point need 3)", ";")


now, we create the Script Attribute (displaying the menu and creating/setting the conditionals and actions) for that page:

'NAME_OF_PAGE' Page -> 'Page' Tag -> Page Type: [script] or [script + text] -> (see below)

add new script -> 'output' section/category -> 'show a menu' Script -> (see below, in code)

--> add new script -> 'scripts' section/category -> 'switch' Script (see below, in code)

-->--> etc add scripts... (lazy, see below, in code)

// an example:

(replace my 'NAME_OF_PAGE' with the/your name of the Page that you want to have these displayed choices and their actions)

show menu ("David enters the room and face a man with a knife, what do you do?", NAME_OF_PAGE.choice_list, false) {
  switch (result) {
    case ("try to reason with him (charisma point needed 5)") {
      if (player.charisma > 4) {
        // whatever scripting/script(s)
      } else {
        msg ("Failed: you don't have enough charisma")
      }
    case ("try to hide from him (evade point needed 2)") {
      if (player.evade > 1) {
        // whatever scripting/script(s)
      } else {
        msg ("Failed: you don't have enough evade")
      }
    }
    case ("try to run away (agility point need 3)") {
      if (player.agility > 2) {
        // whatever scripting/script(s)
      } else {
        msg ("Failed: you don't have enough agility")
      }
    }
  }
}

if you don't want the choices displayed if you don't meet the stat requirement instead, let me know... as the method/code is a bit more involved (we add/remove the items to/from the String List Attribute)


thanks a lot for the answer but could you please tell me where exactly to put the lines of the codes sorry for being a Newbie :(


If you are on the desktop version, go to the objects' attributes. There's a box for it. There are two ways to add an attribute. The first, there should be a button that says add attributes. Click it. Go to the variables option, and click "set a variable." Do that for all of them. The second way is to click the code view button at the top of the attributes box. Paste or copy and paste your code there.

I have a few images. They were to show someone about ShowMenu, but you will get the gist.
http://imgur.com/Aivci1y
http://imgur.com/E4p9Lao
http://imgur.com/O5vxjnR
http://imgur.com/3mK7PC3
http://imgur.com/5mJDJe8
http://imgur.com/RcQaUVC
http://imgur.com/Qt5DJ1D

It works similarly on the online version. But I add all the variables in the game -start script.
I have a few pictures.
http://imgur.com/MsgzlVg
http://imgur.com/yRryzoz
http://imgur.com/o9X6rbc
http://imgur.com/c27Gkvf


Hi. Anything new?


Thanks a lot for the help and patience to answer my questions now i know what to do :)


Log in to post a reply.

Support

Forums