anymore simple command code for gamebook

hi guys~ its the nub asking again~
well since apparently writing code in the general forum messed up the place, i think ill re-place my question here in the coding forum
so anyway... err the title said it all
for example something like

{command:getname:Enter your name and continue...}
{command:Page2:go to next oage}

is there any more simple command code like this? please write anything you know guys :D
much appreciated and thanks in advance!!


It's no problem!
I don't think we messed the place up.
I just thought we should move it here because it would be easier for everyone to access this information in the future. (Did we break the other thread? Oops!)

Here's a link to the beginning of this thread, just so it's all neatly tied together:

http://textadventures.co.uk/forum/quest/topic/mpz_nqciquyxkj_b_6txnq/how-to-put-variables-in-my-game


What's going on here:

This statement is in the Quest syntax. (It might be some other programming language. I don't know. Let's just call it Quest for simplicity's sake.)

  • 'getname' is the name of a page

    • The page 'getname' is set up to run a script.
  • command: is calling the script for the page following its colon. (In this case, of course, it's 'getname'.)

  • getname is the name of the page. In a gamebook, the script will be ran for the page you enter here. (If you were writing a text adventure, this would work a little differently.)

  • : is leading to the text to be displayed on the link, which is Enter your name and continue... in this example.

  • The { opens the statement, and the } closes it.

So, you add a page. Then you create a script (or enter the text to be printed) for it. Then you can 'point' to it in your statement.

Example:

I add a page and name it 'FOOBAR'.

Now, I want the last page I wrote to link to FOOBAR, so I add this line on the text:

{command:FOOBAR:This is what the link will say.}

This leads me to believe that, to assign an attribute (such as HEALTH, WEALTH, or STEALTH), one need simply add a page, then adjust the script for said page accordingly.

So, if we take a look at these two pages, we will find most of the functions and script commands available in Quest. The next step is to pick one thing we want to do, and focus on that.:
NOTE: I'm not sure which ones work or won't work in a gamebook.

Script commands (such as get input, which we use to collect text input from the player)
http://docs.textadventures.co.uk/quest/scripts/

Functions
http://docs.textadventures.co.uk/quest/functions/

You will see how many possibilities you have to choose from after clicking those links. There's really not a short list of easy commands to offer up, but hegemonkhan has gone through great lengths to provide easy to read tutorials, and The Pixie has some VERY DETAILED documentation posted. The hard part when you're new (and I know because I just started using Quest within the past three weeks) is determining the correct terminology to use for what you're trying to accomplish.


Here's a link about attributes:
http://docs.textadventures.co.uk/quest/tutorial/custom_attributes.html


'Anatomy of a Quest game' is full of good information as well:
http://docs.textadventures.co.uk/quest/tutorial/anatomy_of_a_quest_game.html


Also, I wouldn't be able sleep without pointing this minor typo out:

{command:Page2:go to next oage} should be {command:Page2:go to next page}


Here's a link to the main page for the documentation:
http://docs.textadventures.co.uk/quest/


Someone else will surely drop in and offer you a totally different perspective, which is great! Look at everything from all angles. Never discount any possibilities.


HegemonKhan has some good stuff here, too:
http://textadventures.co.uk/forum/quest/topic/3348/noobie-hks-help-me-thread


Hope that helps!

Ask any questions that arise!


here's links to my two posts on this stuff, as I had responded in that thread, not seeing you made one here for this stuff, (but Richard seems to be doing a good job with explaining/helping on this stuff already):

http://textadventures.co.uk/forum/quest/topic/mpz_nqciquyxkj_b_6txnq/how-to-put-variables-in-my-game#e0b868c5-54ab-42c5-961d-b9a0a3651ea7

http://textadventures.co.uk/forum/quest/topic/mpz_nqciquyxkj_b_6txnq/how-to-put-variables-in-my-game#e451dc15-d5f4-4e72-af9c-56d935838f6e


(filler for getting my edited post updated/posted)


in the Game Book, everything has to be done with scripting, so that means:

'WHATEVER' Page Object -> 'Page' Tab -> Page Type: [script] or [script+text] -> (see below)

(this scripting stuff is exactly the same as in a Text Adventure, aside from the Game Book being more limited: less features/stuff for you to use)

Attribute Usage:

(you need to create/set/set-up the Attributes, before you can use them, so for example, usually you use your first page, to create/set/set-up ALL of the Attributes in your game, and then your other pages can use them)

VERY IMPORTANT: the GameBook only has two Objects for you to create/add Attributes to/for/within: (1) the 'game' Game Settings Object, and (2) the (default) 'player' Player Object

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

set a variable game.NAME_OF_ATTRIBUTE = [EXPRESSION] VALUE_OR_EXPRESSION
// or (presuming/assuming you're not changing its name from 'player' to something else):
set a variable player.NAME_OF_ATTRIBUTE = [EXPRESSION] VALUE_OR_EXPRESSION

some examples:

set a variable game.state = [EXPRESSION] 0
set a variable game.intro = [EXPRESSION] "Hi, welcome to my game, i hope you enjoy it!"
set a variable player.strength = [EXPRESSION] 100
set a variable player.flying = [EXPRESSION] false

however, you can still create the effect (and illusion) of having more Objects in your game, for examples:

set a variable game.orc_current_life = [EXPRESSION] 100
set a variable game.orc_maximum_life = [EXPRESSION] 100
set a variable game.orc_damage = [EXPRESSION] 50

set a variable game.ogre_current_life = [EXPRESSION] 200
set a variable game.ogre_maximum_life = [EXPRESSION] 200
set a variable game.ogre_damage = [EXPRESSION] 100

set a variable game.dragon_current_life = [EXPRESSION] 9999
set a variable game.dragon_maximum_life = [EXPRESSION] 9999
set a variable game.dragon_damage = [EXPRESSION] 9999


the 'if' Script usage:

add new script -> 'scripts' section/category -> 'if' Script -> (see below)

if [EXPRESSION] game.state = 0
-> then, -> add new script -> 'output' section/category -> 'print a message' Script -> print [EXPRESSION] "The Game State is: 0"
else if -> [EXPRESSION] game.state = 1
-> then, -> add new script -> 'output' section/category -> 'print a message' Script -> print [EXPRESSION] "The Game State is: 0"


see my (more detailed guide on this stuff:

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

ask if you need any help or need anything explained, and I'll try to help you better (as I'm not good at explaining stuff well)


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

Support

Forums