how to put variables in my game

hey guys.. i just recently been dragged to the world of text based game.. and.. well.. it surprised me how awesome a bunch of text can actually make a game and i was like... i want to try and make some
so anyway long story short google leads me to this program called quest and thankyou so much anyone and everyone that are contributing to this program (yes... the forum dwellers that helps people like you guys are included~)
anyway back to question... i have 0 programming skill (as a matter of fact i have 0 writing skill but it wont stop me from trying to write my own text game) and i would gladly appreciate if someone is to explain to me how to make variable such as money, general stat (str,int,etc etc) that can change depends on the player decision and path... oh oh and battle formula would be super nice~
currently i can only make a story goes like this title > page 1 > page 2 or 3 > if page 2 go to pake 4 or 5 > if page 3 go to page 5 or 6 > and so on
ive seen some of the post and frankly it makes me all the more confused
oh and im using gamebook because i want my game to be the click and read kind of story.. because you know.. writing response is such a pain in the ass tehee~ well at least for me
well that is all i suppose.. i really really need your help here guys :x
thanks in advance!!!


Hello!

I'm probably not much help, since I prefer text adventures over gamebooks, but I've tried to make a gamebook using Quest and actually made one using Squiffy: http://textadventures.co.uk/squiffy

I didn't have any money or stats or anything like that, though, but I skimmed over how to do it in the documentation: http://docs.textadventures.co.uk/squiffy/attributes.html


From the 'Creating a gamebook' page on this site:

NOTE: Rather than using the Game Book feature of Quest, we would suggest you use either the full product (and turn off the game panes and command bar so the player just uses hyperlinks), or use Squiffy. Quest Text Adventures have a full world model, where objects and rooms relate to each other in a meaningful way, and have numerous features not supported by Game Books. Squiffy has no world model, but is great for creating multiple choice games that focus on text and story, and will produce a game that can be run in any browser, without the need for a dedicated server. Quest Game Books represent the worst of both worlds.

Read the rest here: http://docs.textadventures.co.uk/quest/tutorial/creating_a_gamebook.html

I couldn't get jack squat out of Quest in gamebook mode. (I tried to at least three times, and I usually pick up on how to do things fairly quickly.)

Making a gamebook seems to be much more work than making a text adventure.

You can make a text adventure, then remove the ability to input text. There are options in Quest to make the text input box completely disappear.

NOTE: To create a game that you can play by clicking links, the author must include each option as a menu item in each object's drop-down menu. You'll also have to remove USE from the objects that you didn't write the USE responses for.

I would strongly advise creating a small game in Squiffy first. It seems a little odd using it at first, but it's really easy to use after a short while, and the documentation is very good.

I wish you luck!


aww...what a shame.. i really like the quest game book...
i think ill give this squishy thingy a shot. thanks for the reply :D
but i will still prefer the gamebook on quest tho.. so i really hope anyone can enlighten me on how to use gamebook properly
as for the text adventure without the response... how exactly does those thing works?
sorry for the barrage of question.. i really really want to learn but im slow so please bear with me.. also im lazy to stroll the entire forum~


It's no problem! (The forum is information overload in the beginning.)

To make a text adventure look like a gamebook:

  1. Create a new text adventure.
  2. Select 'game' from the tree on the left.
  3. Click on the 'Interface' tab.
  4. Uncheck 'Show command bar'.

From there on out, you'll have to make EXTRA sure to add/remove new or unused default verbs that are listed from each object.
With no parser for the player to interact with, every possible action needs to be clickable.

NOTE: If you create a text adventure without removing the ability to enter text in the prompt, the hyperlinks will still work too. So, this would appeal to both types of player: parser-lovers (like myself) and the gamebookers. Best of both worlds.

Having said all that:

Squiffy and Quest are sort of like cousins. (I'm 99% sure they were both created by Alex Warren, founder of this site, as well.)

Squiffy starts you off with just a blank text document (pretty much), and you have to enter all the code. It is VERY WELL documented though.

You can edit and play at the same time on this site: http://textadventures.co.uk/squiffy/editor

The whole source code for an example game I worked up :

Display code

@title Interconnectedness


@start nameget

[[nameget]]:

What is your name?

<input type="text" id="name"> <br>
[[CONFIRM]]

[@1]:
@set money = 0

[[CONFIRM]]:
    squiffy.set("name", jQuery("#name").val());

Welcome, {name}!

[[Continue]](beginning)

[[beginning]]:
@clear
You can see {if wallet=touched:[a wallet](viewed wallet) and}{else:[a wallet] and } a {if bg_health<2:[bad guy]}{else:[bad guy](badguy)} here.

[badguy]:
@clear
The bad guy is sticking his tongue out at you.

Would you like to [attack him](attack him2) or [try to reason with him](try to reason with him2)?

[attack him2]:


@clear
You deliver the final blow to the bad guy, rendering him unconscious.

<center><h1 style="text-shadow:-1px -1px 2px black;color:blue">YOU HAVE WON!</h1><hr/>Money collected: ${money} out of $5<br/>Score 1000 out of 1000</center>


[try to reason with him2]:
@clear
You try to reason with the bad guy, but to no avail.

[[Continue]](beginning)

[a wallet]:
@clear
@set wallet = touched
You pick up the wallet.
It has five bucks in it. You take it out.
@inc money 5

[[Continue]](beginning)

[viewed wallet]:
The wallet is empty, but you now have ${money}.

[bad guy]:
@clear
The bad guy is sticking his tongue out at you.

Would you like to [attack him] or [try to reason with him]?

[attack him]:
@clear
@inc bg_health 1
You attack him. (Try attacking him again. He can only take {if bg_health=1:two more hits.}{if bg_health=2:one more hit.})

[[Continue]](beginning)

[try to reason with him]:
@clear
You try to reason with the bad guy, but to no avail.

[[Continue]](beginning)


[[ending]]:
YOU HAVE WON!
You earned ${money}!

Someone may swoop in and save the day for you later, but, from what I've read on this site, the best route is making a Quest text adventure and disabling the text input box. Especially if you'll be using money and such. (Be prepared to copy and paste some codes. It's really not that bad once you fool around with it for a day or so.)

Here's a SMALL sample text adventure game, slightly doctored to emulate a gamebook:

http://play2.textadventures.co.uk/Play.aspx?id=editor/572ad9ac-3e0c-475d-827e-1a5ecac6d53d%2fThis+Looks+and+Acts+Like+a+Gamebook.aslx

And here's the code:

Display code

<!--Saved by Quest 5.7.6404.16853-->
<asl version="550">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="This Looks and Acts Like a Gamebook">
    <gameid>9b2e060f-a0ab-4b6e-9bad-d3a524d90be7</gameid>
    <version>1.0</version>
    <firstpublished>2017</firstpublished>
    <menufont>Georgia, serif</menufont>
    <showcommandbar type="boolean">false</showcommandbar>
    <commandpane type="boolean">false</commandpane>
    <subtitle>and it can be even more finely tuned</subtitle>
    <showscore />
    <showhealth />
    <showmoney type="boolean">false</showmoney>
    <feature_advancedscripts />
    <customstatuspane type="boolean">false</customstatuspane>
    <showlocation type="boolean">false</showlocation>
    <inituserinterface type="script">
      JS.setCommands ("Look;Wait")
    </inituserinterface>
  </game>
  <object name="room">
    <inherit name="editor_room" />
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
    <exit alias="in" to="another room">
      <inherit name="indirection" />
    </exit>
    <object name="billfold">
      <inherit name="editor_object" />
      <look>It appears to be a perfectly normal billfold.</look>
      <take />
      <inventoryverbs type="stringlist">
        <value>Look at</value>
        <value>Drop</value>
      </inventoryverbs>
      <ontake type="script">
        msg ("A {object:bad guy} enters the location.")
        MakeObjectVisible (bad guy)
        IncreaseScore (5)
      </ontake>
    </object>
    <object name="bad guy">
      <inherit name="editor_object" />
      <visible type="boolean">false</visible>
      <displayverbs type="stringlist">
        <value>Look at</value>
        <value>Attack</value>
      </displayverbs>
      <attack type="script">
        RemoveObject (bad guy)
        msg ("YOU HAVE DEFEATED THE BAD GUY AND SAVED THE DAY!")
        IncreaseScore (15)
        finish
      </attack>
    </object>
  </object>
  <object name="another room">
    <inherit name="editor_room" />
    <exit alias="out" to="room">
      <inherit name="outdirection" />
    </exit>
    <object name="treasure">
      <inherit name="editor_object" />
      <take />
      <look>It's a treasure.</look>
      <inventoryverbs type="stringlist">
        <value>Look at</value>
        <value>Drop</value>
      </inventoryverbs>
      <ontake type="script">
        IncreaseScore (10)
      </ontake>
    </object>
  </object>
  <turnscript name="battle">
    <enabled />
    <script>
      if (ListContains(ScopeVisible(), bad guy)) {
        msg ("The {object:bad guy} attacks you.")
        DecreaseHealth (1)
      }
    </script>
  </turnscript>
  <verb>
    <property>attack</property>
    <pattern>attack</pattern>
    <defaultexpression>"You can't attack " + object.article + "."</defaultexpression>
  </verb>
</asl>

Quest's engine types:

  1. Test Adventure:

this is the full programming/coding capability, meaning that if you want to do a RPG-type of game, you want to use the Text Adventure, to handle all the fancy stuff you want to do for your game.

  1. Game Book:

this is a much more limited programming/coding capability, as it's made for making a CYOA game, you can still do some scripting, such as light RPG / game-mechanics type of stuff, but there's a lot of missing stuff to use compared to the Text Adventure.

  1. Squiffy:

this is more for authors/writers, focusing more on helping with the scripting of doing the dialogue, using more human-language friendly scripting than it being as more code language. I don't really know much more about it though, in how much programming/coding type of stuff it can do, as I've never used it yet. If you have used 'inform' game making software, Squiffy should be familiar for you.

  1. Pixie created a library that creates a hybrid: it uses the Text Adventure, so you got the full capability, but it looks/feels like a Game Book

Game Book:

how to use Attributes (the main type of VARIABLE you want to use in quest / game-making) and scripting in the Game Book:

first you have to create your Attributes so they exist, and thus you can then be able to use them:

usually your very first page will be used to do this: creating all of your Attributes (or at least you must do this on a page prior to another page that uses the Attributes, as you can't use Attributes that don't, exist / haven't been created. yet, lol)

'NAME_OF_FIRST_PAGE' Page Object -> 'Page' Tab -> Page Type: [SCRIPT] or [TEXT+SCRIPT] -> (see below)

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

set variable NAME_OF_OBJECT.NAME_OF_ATTRIBUTE = [EXPRESSION] VALUE_OR_EXPRESSION

unlike a Text Adventure, that has unlimited Objects you can add/create Attributes to, the Game Book, only has two Objects you can add/create Attributes for:

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

so for example:

set variable game.NAME_OF_ATTRIBUTE = [EXPRESSION] VALUE_OR_EXPRESSION
or
set variable player.NAME_OF_ATTRIBUTE = [EXPRESSION] VALUE_OR_EXPRESSION

The 'NAME_OF_ATTRIBUTE' can be whatever you want (has to start with an alphabet character/symbol and all 'names' must be unique, as the 'names', aka the 'name' String Attribute, is the 'ID' for quest), but be careful not to name it as another Attribute that is already built-in to the Game Book, as it'll over-ride it, and you'd lose all of quest's built-in functionality for that built-in Attribute.

when using scripting for creating/adding Attributes (which is what is only available in Game Book), the VALUE_OR_EXPRESSION determines what type of Attribute it is.

Next, there's different Types of Attributes:

  1. String Attributes, examples:

(anything within double quotes is a String Data Type)

set variable player.alias = [EXPRESSION] "HegemonKhan"
set variable game.greeting = [EXPRESSION] "wecome to my game, I hope you enjoy it"
set variable game.state_string_attribute = [EXPRESSION] "0" // yes, the '0' is a String Value, and not an Integer Value, because it's encased in double quotes

// example of a complex expression (using Attributes + text/strings) for a String Attribute:
// set variable player.alias = [EXPRESSION] "HegemonKhan"
// set variable player.age_string_attribute = [EXPRESSION] "adult"
// set variable player.sex = [EXPRESSION] "male"
// set variable player.race = [EXPRESSION] "human"
// set variable player.class = [EXPRESSION] "warrior"
set variable player.description = [EXPRESSION] player.alias + " is a " + player.age_string_attribute + " " + player.sex + " " + player.race + " " + player.class + "."
// if/when outputted: HegemonKhan is a adult male human warrior.

Boolean Attributes, examples:

(notice no double quotes on the VALUES, and also, these 'true' and 'false' VALUES are special/reserved specifically for the Boolean Attribute as Boolean Values)

set variable player.flying = [EXPRESSION] false
set variable player.flying = [EXPRESSION] true
set variable game.hard_mode = [EXPRESSION] false
set variable game.hard_mode = [EXPRESSION] true

Integer Attributes, examples:

(notice no double quotes on the VALUES)

set variable game.state_integer_attribute = [EXPRESSION] 0
set variable game.state_integer_attribute = [EXPRESSION] 7
set variable player.age_integer_attribute = [EXPRESSION] 81
set variable player.strength = [EXPRESSION] 100
set variable player.intelligence = [EXPRESSION] -100

Double Attributes, examples:

set variable player.damage = [EXPRESSION] 36.32
set variable player.damage = [EXPRESSION] 0.0
set variable player.damage = [EXPRESSION] -36.32


Game Book may also have Object (reference/pointer) Attributes, but I'm not sure... if it does... when you need to use them, we can get into them.


also, while the Game Book only has two Objects you can use for Attributes, you can create the effect/illusion of infinite Objects:

set variable game.orc_strength [EXPRESSION] 10
set variable game.orc_life [EXPRESSION] 100

set variable game.ogre_strength [EXPRESSION] 20
set variable game.ogre_life [EXPRESSION] 200

you can also do this, it'll work/function fine (but in this case, it doesn't make much conceptual sense for us humans, it's a bit jarring for us, but again it'll still work fine, even if it's weird for us to see/read):

set variable player.orc_strength [EXPRESSION] 10
set variable player.orc_life [EXPRESSION] 100

set variable player.ogre_strength [EXPRESSION] 20
set variable player.ogre_life [EXPRESSION] 200


alright...

now that we created our Attributes, now we can use them in scripting, usually via the 'if' Script:

'NAME_OF_WHATEVER_PAGE' -> 'Page' Tab -> Page Type: [SCRIPT] or [TEXT+SCRIPT]-> (see below)

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

if [EXPRESSION] player.current_life <= 0
-> then, -> add new script -> 'output' section/category -> 'print a message' Script -> (see below)

print [MESSAGE] You died or were killed

-> add new script -> 'output' section/category -> 'print a message' Script -> (see below)

print [MESSAGE] GAME OVER

-> add new script -> '???' section/category -> 'finish / end the game' Script


for the 'print a message' Script:

the [MESSAGE] option is for TEXT/STRING ONLY
whereas,
the [EXPRESSION] option allows for: test/string only, VARIABLE/Attribute only, or text/string + VARIABLE/Attribute


let me stop here, and wait if you got all of that (ask if you need help), and if you do and/or need more or further-beyond help on doing other/more stuff, we can then continue with it.


P.S.

the scripting is (mostly) the same between a Text Adventure and Game Book (minus what the Game Book can't do, as it's much more limited), only the method(s) of accessing the scripting and Attributes varies between the Text Adventure (multiple methods of creating Attributes) and Game Book (only the scripting method for creating Attributes).

so, you can look at this guide I made (it's for Text Adventure, but the part about the scripting, again is the same for Game Book):

(it goes into more detail on the scripting than I did in this post)

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

ask if you need any help.


The easiest "cheat" is to download someone else's game and read through the code...
Unfortunaly, when the game gets posted, a lot of Quest code is added that is more confusing than helpful.
If it looks confusing, more than likely, it is the Quest added code.
read it, change it, add to it, delete some of it...
(learn it)
I started with BASIC, another programming language, and bought books with program listings and spent days, weeks even, typing in the programs, and learned all sorts of tricks...
But, unless you want to download Quest code, print it off, just to type it back in.... You are better off downloading it, reading it and learning it that way.
Break it, fix it... It is all part of the "fun"...
My suggestion would be skip Squiffy and jump over game book.
Text adventure is easy enough to start there.
My idea to another new programmer...
(After going through the tutorial...)
Start new, make several connecting rooms...
play that to make sure the rooms connect and work
Add descriptions to the room...
and just build up from there...
Make a few test programs, try new stuff, break your program, fix it...
Then start on your master, end all game, that will make everyone envious...


Here's a pretty good link for you: https://textadventures.co.uk/forum/samples/topic/4772/how-to-make-a-text-adventure-look-like-a-gamebook

If you have the Windows version of Quest, you can copy the entire code for the example game from the page then paste it in to the code view in Quest.

Then, you'll have a working model. (I just tested it, and it ran the game fine in the latest version of Quest. You will still need to add the attributes/variables into the game, but this is proof that you can pull this off in a Quest text adventure.)


@hegemonkhan

Would you happen to have a link to that library by The Pixie? My online search failed miserably.


is it impossible to use gamebook instead of text adventure that looks like a game book? because its too complicated for my story :x
also how do i download someone else game and take a peek inside the code?
and all this code is really hard to understand.. it might take a while before i get the hang of it. if only someone were to show me the step by step tutorial~ :P preferably with screenshoot dahaha~ sorry if im asking too much
you all have been a great help to me :) if you guys dont mind do take a look at my progress
here : http://play2.textadventures.co.uk/Play.aspx?id=g4atvcswouyb-pkg6qztrq
and im open to all feedback about the story.. wether its about my grammar (im not native eng speaker), or the story pacing, or the character placing, or about anything. as i said.. i have never done any writing before and all i have is the idea.. i dont have the skill nor the brain to actually execute this story. thats where you guys comes in :D
now what im trying to do is making the stat change (increase or decrease) with some option the reader choose and if its impossible to do that by game book then i guess i dont have any choice but to use text adventure hmpf. and i dont even know how to make the player decides the character names D:

(ps : i really dislike text adventure and it will be my last resort)
(edit : i tried the link but it isnt working for me.. does everyone else have the same issue?)


SoapyBen,

Are you creating this game online or in the Windows desktop version?


from desktop version. i download the quest to my laptop and write my story with it
is that why the game is not loaded properly?


see my 2 posts above, they has step by step instructions for the Game Book (off-line/desktop)


if you need help with anything, ask me.


from desktop version. i download the quest to my laptop and write my story with it
is that why the game is not loaded properly?

The game should load properly either way. (I was asking so we'd know how to tell you to get into code view.)

The problem probably lies within the code. (Don't worry. We ALL have that problem more often than not.)

You can open the code view (the link to the image in the documentation on this site seems to be broken, so see this screenshot on how to open code view here:

Show Screenshot

screenshot




That will open a window with your game's code.

You can copy and paste the code here, and we'll try to help.


Hegemonkhan's instructions should guide you through game-creation in gamebook mode. (Just look at each line he's written, one at a time. Don't try to soak it all in at once.)


I'm with DarkLizerd. I prefer to make the game in text adventure mode, then remove the text input box to make it work like a gamebook.

The editor for creating text adventures is the easiest to use and the most advanced.


I wrote a small example game in Squiffy. You can copy and paste this code into Squiffy and run it to see what you think. If you like it, you can edit however you please.

You can try this out with or without downloading Squiffy.

Just click here: http://textadventures.co.uk/squiffy/editor

Then delete the example code that is already there, and paste the following code in its place.

Click here to see the example code for Squiffy

@title Example Game

@set money = 0

The story starts as most often do: in a room.

You can see {if dollars=taken:}{else:[five dollars] and }an [antagonist] here.


[five dollars]:
@clear

The five dollars is lying innocently on the floor.

Would you like to [pick it up]?


[pick it up]:
@set dollars = taken
You pick it up.
@inc money 5

You now have ${money}.

You can see an [antagonist] here.

[antagonist]:
@clear
He's ugly. Looks pretty mean, too.

Would you like to attack him?
[[yes]]
[[no]]

[[yes]]:
You attack and defeat the antagonist.

He cries like a baby.

<center><h1 style="text-shadow:-1px -1px 2px black;color:blue">YOU HAVE WON!</h1><hr/>

In that game, you scored 1000 out of 1000 points!<hr/>

You collected ${money} out of $105.<hr/>
THANKS FOR PLAYING!</center>

[[no]]:
You run away from the antagonist.

You then cry like a baby.

<center><h1 style="text-shadow:-1px -1px 2px black;color:red">YOU HAVE LOST!</h1>

In that game, you scored 0 out of 1000 points!<hr/>

You collected ${money} out of $105.<hr/>

THANKS FOR PLAYING!</center>

[[]]:
<center><h1>Insert Game Title Here</h1></center>

---

Tip for collecting the player's name in Quest gamebook.

I made a small example Quest gamebook game to illustrate how to collect the player's name.

Here's the link to play the example game: http://play2.textadventures.co.uk/Play.aspx?id=vqf-6iebs0m1ecmcoz0mlw

I uploaded a screenshot of the Page1 set up.
Here it is:

Click to view screenshot

screenshot


--- Here's the example code to get the player's name then go to the second page.

NOTE: DO NOT ADD THE FOLLOWING CODE IN YOUR EXISTING GAME!!! THAT WOULD EITHER DELETE YOUR GAME OR MESS IT UP! The following is a COMPLETE GAME. If you want to play around with this, you can create a new gamebook game, then paste this into code view.


<!--Saved by Quest 5.6.6108.15891-->
<asl version="550">
  <include ref="GamebookCore.aslx" />
  <game name="test gamebook">
    <gameid>136d3367-932f-4339-b9df-400158de4fc0</gameid>
    <version>1.0</version>
    <firstpublished>2017</firstpublished>
    <roomenter type="script">
    </roomenter>
  </game>
  <object name="Page1">
    <inherit name="scripttext" />
    <description><![CDATA[ENTER ALL YOUR TEXT FOR PAGE 1 HERE.<br/><br/><br/>What is your name?]]></description>
    <options type="stringdictionary" />
    <script type="script">
      GetInput() {
        player.alias = result
        MovePlayer (Page2)
      }
    </script>
    <object name="player">
      <inherit name="defaultplayer" />
    </object>
  </object>
  <object name="Page2">
    <inherit name="scripttext" />
    <description><![CDATA[Alright, {player.alias}, you had just started to...<br/><br/>NOTE: This is just an example. Page1 and Please enter your name are the only things that are functional in this example.]]></description>
    <options type="stringdictionary" />
    <script type="script">
      ClearScreen
    </script>
  </object>
</asl>

understanding Attributes (VARIABLE usage) and scripting is a big step up from just going going through the tutorial and learning the basics of using the Text Adventure and its GUI/Editor and/or Game Book and its GUI/Editor.

this is NOT easy to do, it'll take some time, and even if you kinda start to get it, all of the different terms will get confused and/or you don't really understand them fully, being totally overwhelmed (like I was 5 years ago when I found quest, no knowing anything at all about programming/coding, nor game making, hehe).

Jumping into this immediately, will cause you to be very confused... don't worry, you shouldn't even be jumping into this so soon. This is quite advanced stuff if you're completely new to programming coding and/or with using quest.

However, if you can learn Attribute usage and scripting, you can do 90% of everything/anything you want to do with/for/in your game! Attributes and scripting open up nearly everything for your game making, but it's not easy to learn.


@ soapy (and chesiretiger):

are you able to understand/follow this stuff a bit?

if not, let me know, and I'll try to help you on getting it understood (or Richard will, lol. I'm terrible at explaining stuff, so Richard will probably be more helpful than I).


hegemonkhan speaks the truth.

I think the thing text adventurers enjoy the most is overcoming obstacles via the keyboard, though.

That goes for playing the games AND writing them.


hrm hrm hrm... well honestly im a bit overwhelmed by the information right now.

im currently doing hegemonkhan tutorial on doing scripting and coding
the reason why i jumped to this so early on is because im afraid that if i dont understand how to do this early on i might lost interest halfway and thats just kinda blew it you know
also about the name coding.. is it impossible to do in gamebook? (its kinda like text adventure where you require the player to actually do something instead just choosing the path that already been laid out)

if you guys would kindly take a peek on my game hopefully you guys would understand what im trying to make and text adventure just doesnt cut it :/

i think using this type is much more comfortable while you are using phone app or mobile browser because honestly... who wants to read book in computer or laptop anyway?. i want my story to be like the on-the-go kind of story that you can do while waiting for bus or something like that (oh silly me thinking that my story can actually attract people dahahaha) its easier just to click the already laid path and continue on the story than wandering randomly in some room without aim like sandbox game.. thats not what i envision my story to be
anyway thats my reason.. just in case some of you got annoyed as to why i strongly disagree to use text adventure.. well at least now you know why~


<!--Saved by Quest 5.6.6108.15891-->
<asl version="550">
  <include ref="GamebookCore.aslx" />
  <game name="Last Magic">
    <gameid>63b3b463-c241-4de8-85bc-598dbb5cce13</gameid>
    <version>1.0</version>
    <firstpublished>2017</firstpublished>
    <author>Benhard Sinaga</author>
    <subtitle>the third bell</subtitle>
    <showtitle />
    <clearlastpage />
    <showborder />
    <category>Fantasy</category>
    <defaultfontsize type="int">14</defaultfontsize>
    <defaultfont>'Lucida Console', Monaco, monospace</defaultfont>
    <defaultbackground>Gray</defaultbackground>
    <defaultforeground>White</defaultforeground>
    <defaultlinkforeground>Black</defaultlinkforeground>
  </game>
  <object name="Page1">
    <inherit name="scripttext" />
    <description><![CDATA[player.alias<br/>year 217... kingdom of magicinda. a kingdom with magic so plentiful that anyone is able to do magic to some extend. woodcutters, miners, farmers, housewifes, practically anything is done by magic, from simple means of light, to the powerful spell of re-growing forrest. from heating a bath tub, to fighting a battle. magic is a day to day life for the people lives here. <br/><br/>snow covers most of the land all year long in most part and the kingdom itself is divided into 5 provice. <br/><br/>the northern provice with the coldest athmosphere. there is not much things here except a huge old stone tower that stands some 300m tall. the details regarding the tower has always been a mystery for the general population.<br/><br/>the western province consist of thick forrest and rivers... which ofcourse frozen during winter. this provice are the main producer of wood and pelts. the thick forrest offers plenty of games to hunt and the river have lots of great fishing spot.<br/><br/>the eastern provice are full of mountains and hills... people dig deeper into the mountain everyday in search of mineral such as iron and bronze and even precious gems like ruby or saphire. <br/><br/>only lands in the southern provice that has never been covered by snow and mostly used for farming industry. because of the lack of snow, this provice produce most of the kingdom's needs of food product including the all important alcoholic bevereges such as wine or mead. <br/><br/>and last is the central provice. where the capital city of magicinda, infinium is located. the central provice are the smallest yet most important province. library, academy of magic, the castle, just about any important things can be found in this province.  <br/><br/>every provice is governed by governor, not handpicked by the king, but is voted by lords and ladies from the province. lords and ladies are the title bestowed by the king for those who have lands to rule and pay tax to the king. a lord or lady can have as little as 10 villages but some can have as many as 50 villages even cities and castles. they have certain sovereignty over their land but answer to the king and his extension the governor.<br/><br/>~the capital city... infinium~<br/>lies a courtyard of a soldier training barrack near the castle. and there you stand... a 14 year old boy... almost a man,<br/><br/>{command:name:what is your name?}<br/><br/>]]></description>
    <options type="stringdictionary">
      <item>
        <key>Page2</key>
        <value></value>
      </item>
      <item>
        <key>Page3</key>
        <value></value>
      </item>
    </options>
    <script type="script">
      player.alias = name
    </script>
    <object name="player">
      <inherit name="defaultplayer" />
    </object>
  </object>
  <object name="Page2">
    <inherit name="scripttext" />
    <description><![CDATA[you takes a few steps back avoiding all the older boy barrage of attack and return with some blow of your own with almost perfect precision and timing. after a few successive thrust to the epigastrium, the older boy fell on his knees with heavy breath. <br/>you then proceed to point his wooden sword to the older boy's throat for a few second. <br/><br/>{command:Page5:ask the older boy to yield}<br/><br/>{command:Page6:prepare to hit the older boy aiming for his head} ]]></description>
    <script type="script">
    </script>
  </object>
  <object name="Page3">
    <description><![CDATA[you parries all of your opponent's blow flawlessly patiently waiting for the older boy to wears out. after a few minute parrying, the older boy grows frustrated and tries to deliver a huge blow with all his weight behind his attack. he takes a full back swing of his wooden sword all the way to the back of his head and just about to hit you with a huge downward slash when you do a quick and finesse sidestep and deliver a kick directly to the older boy's epigastrium. the older boy let go of his sword and fall to his knees holding his abdomen with both hand.. his face says a lot about the pain he had received. <br/><br/>you then proceed to point his wooden sword to the older boy's throat for a few second. <br/><br/>{command:Page5:ask the older boy to yield}<br/><br/>{command:Page6:prepare to hit the older boy aiming for his head}<br/>]]></description>
  </object>
  <object name="Page4">
    <description><![CDATA[you instinctively throw your wooden sword towards the older boy, which the later deflected with his own wooden sword at the cost of his balance. now armed with nothing but fist you ducked and deliver a punch to your opponent's epigastrium. the pain can be seen clear as day in the older boys face as he falls to his knees holding his abdomen with both hand.<br/><br/>you then take the older boy's wooden sword and placed it in his throat for a few second. <br/><br/>{command:Page5:ask the older boy to yield}<br/><br/>{command:Page6:take a stance to hit the older boy aiming for his head}]]></description>
  </object>
  <object name="Page5">
    <description><![CDATA["its my victory... do you yield?" you said. the older boy said nothing for a few moment and suddenly a clap is heard around the courtyard<br/><br/>"splendid... absolutely briliant [name]". your ability in combat is without a doubt one of the best that i have ever seen.<br/><br/>the middle aged man pats you in the head before facing the downed older boy and asked him is he able to continue with the practice.<br/>the practice goes on for several more hour until the sun is about to go down.<br/>while in practice session you foccused in honing your...<br/><br/>{command:strength:strength. afterall what is a man without his muscle}<br/><br/>{command:agility:agility. the point of a fight is to hit without getting hit}<br/><br/>{command:endurance:endurance. to take a beating and still stand is what makes a man}<br/><br/>{command:confidence:not doing anything. i dont need anymore training. confidence is key}]]></description>
  </object>
  <object name="Page6">
    <description><![CDATA[you raises your wooden sword high and about to deliver the final blow when suddenly you feels that the wooden sword is unbelieveably heavy... so heavy that it almost snapped your wrist by sheer weight. he let go of his wooden sword by instict and it falls behind his head. a big thud is followed with fresh snow scattered from the groud by the impact. "that would be enough [name]" said a middle aged man, probably in his fifties, suddenly from behind you without you noticing his presence.<br/><br/>"it is not courage to finish off your opponent... courage is to unseathe your sword once you already drew it. you should remember that boy."<br/><br/>the middle aged man pats you in the head before facing the downed older boy and asked him is he able to continue with the practice.<br/>the practice goes on for several more hour until the sun is about to go down.<br/>while in practice session you foccused on honing your...<br/><br/>{command:strength:strength. afterall what is a man without his muscle}<br/><br/>{command:agility:agility. the point of a fight is to hit without getting hit}<br/><br/>{command:endurance:endurance. to take a beating and still stand is what makes a man}<br/><br/>{command:confidence:not doing anything. i dont need anymore training. confidence is key}]]></description>
  </object>
  <object name="Page7">
    <description><![CDATA[~later that afternoon~<br/><br/>someone grab you by your shoulder just when you are about to walk away from the training ground. it was the older boy that you beat earlier. <br/>"hold it [name]" he said as he pulled your shoulder and forced you to face him. you have this urge to punch him in the face so hard but you calm your nerves and let him speak. <br/><br/>"i hope you dont think that you are better than me just because you beat me in mere swordsplay" he taunts at you. you noticed the glow in his palm that indicates magical spell is used.<br/><br/>he just as anyone else in this kingdom knows full well about your inability to harness and use magic. and by that fact alone makes you an outcast. the undesireable. the freak. most people shun at you and talks behind your back, but some people... like this older boy, they dont care if you are the prince of the kingdom. they dont care if you are the heir of the throne and that they owe their allegience to you, they just find satisfaction to bully your inability to use magic. but somewhat, somehow you actually respect people like him. he have the guts to confront you and not just talks behind your back and even spread rumors just like most people you know. <br/><br/>"i dont want any problem... its just practice anyway." you replied<br/><br/>he takes a few step back putting some distance between the both of you as he displayed his fire magic to intimidate you.<br/>"ofcourse... its just practice. but you see... its been a long time since we had magical fight practice and i just want to know how good i am  by sparring you again, with magic this time of course" he said with mocking tone.<br/><br/>you clench your fist when you heard the word magic.<br/><br/>{command:Page8:says that you are not interested in anymore spar and walks away}<br/><br/>{command:Page8:you turn your back to him and walks away without saying a word}<br/><br/><br/>]]></description>
  </object>
  <object name="Page8">
    <description><![CDATA[as you turn your back you can sense a movement behind you and you take a sidestep instinctively and feels a warm thing fly across where your head is supposed to be, had you not evade it. a firebolt spell. you grit your teeth and turn around seeing the older boy with a huge grin across his face holding fire in his palm. <br/><br/>you stood there motionless, some 10 meters away from him and glares. a second later, 2 firebolt flies to you which you can easily avoid with just your upper body movement. <br/><br/>"whats the matter? come on use your magic against me already~" he said "but oh... i forgot~ you cant!" he said again mockingly and with a big laugh <br/><br/>you dont really have any choice except to stand your groud and evade his spell. you know you cant beat a spellcaster in a close combat let alone in this range. you think for a few moment as what to do when suddenly the older guy yelps in pain with surprise, you see a beautiful young lady with a bright scarlet hair behind him with angered looks in her face. <br/><br/>"go away... NOW" she glares at the older boy while showing a blue-ish aura around her.<br/><br/>"s...sorry princess.. right away princess" he replied and quickly bows and walks backward a few step before turning around and runs<br/><br/>"nothing is too much huh?" you grins at her<br/><br/>"hhhhmph... he deserves that, anyway are you okay [name]?" she walks towards you with worried looks in her face <br/><br/>"ive been better, thanks for the help anyway, if only i can do what you did back there" <br/><br/>"aww gezzz you are the prince.. you shouldnt look so pathetic" she hits your head jokingly and grabs you by the arm "care to lead this princess to the castle?" she said in spoiled voice<br/><br/>"thats my arm that you are strangling there" you tried to push her head away from your arm gently <br/><br/>"nope... i am the princess and i claim this arm as mine" she said jokingly <br/><br/>you walk with her towards the castle. unlike you, an adopted heir, she is a princess by blood... a real royalty, flesh and blood of the king himself. she is about the only person in the kingdom -except the king- that doesnt mind about your inability to use magic. in fact she respect you because of it and think very highly of you. <br/>along the way you...<br/><br/>{command:Page9:ask her about magic}<br/><br/>{command:Page10:ask if she remember about the first time we met}<br/><br/>{command:Page12:stays quiet all the time}]]></description>
  </object>
  <object name="confidence">
    <description><![CDATA[you didnt do anything for the rest of the training session. you just watch as the other trainee practicing from the side of the courtyard thinking highly about yourself that you are twice as good as them.<br/><br/>you look at the middle aged man once in a while and sometime he looks at you back for a moment before quickly paying attention to the courtyard again. he is the only man here that you respect. when someone mention king, the first thing that comes to mind almost certainly is crown, or sparkling jewelry or tons of servant and mistress and other stuff like that, but not this king. his highness prefers something more casual. but that doesnt mean he doesnt have the aura of autorithy around him... no... even someone who doesnt know anything about the kingdom or the king would notice that there is something... special about this man. <br/><br/>the king is rather unpredictable and easy going. he does what he wants when he wants and leaves the day to day duty of running a kingdom to people that serves him, such as the governor and the high council. but he and he alone have total sovereignty over the kingdom. and beside.. who can say no to this charismatic king?. he enjoy freedom more than anything else. hence he let the lord and lady to rule their own land. <br/><br/>{command:Page7:as time passed~}]]></description>
  </object>
  <object name="endurance">
    <description><![CDATA[you walk over to the group of trainee and asked them to help you train your endurance by hitting you while you try to endure all the damage. its not the brighest thing to do but the result of this kind of training really pays off all the pain and bruise aftereffect <br/><br/>you look at the middle aged man once in a while and sometime he looks at you back for a moment and smile before quickly paying attention to the courtyard again. he is the only man here that you respect. when someone mention king, the first thing that comes to mind almost certainly is crown, or sparkling jewelry or tons of servant and mistress and other stuff like that, but not this king. his highness prefers something more casual. but that doesnt mean he doesnt have the aura of autorithy around him... no... even someone who doesnt know anything about the kingdom or the king would notice that there is something... special about this man. <br/><br/>the king is rather unpredictable and easy going. he does what he wants when he wants and leaves the day to day duty of running a kingdom to people that serves him, such as the governor and the high council. but he and he alone have total sovereignty over the kingdom. and beside.. who can say no to this charismatic king?. he enjoy freedom more than anything else. hence he let the lords and ladies to rule their own land. <br/><br/>{command:Page7:as time passed~}]]></description>
  </object>
  <object name="strength">
    <description><![CDATA[you walk over to the sets of stones and iron and try to lift them with all your might. this is certainly a good way to increase your muscle mass<br/><br/>you look at the middle aged man once in a while and sometime he looks at you back for a moment and smile before quickly paying attention to the courtyard again. he is the only man here that you respect. when someone mention king, the first thing that comes to mind almost certainly is crown, or sparkling jewelry or tons of servant and mistress and other stuff like that, but not this king. his highness prefers something more casual. but that doesnt mean he doesnt have the aura of autorithy around him... no... even someone who doesnt know anything about the kingdom or the king would notice that there is something... special about this man. <br/><br/>the king is rather unpredictable and easy going. he does what he wants when he wants and leaves the day to day duty of running a kingdom to people that serves him, such as the governor and the high council. but he and he alone have total sovereignty over the kingdom. and beside.. who can say no to this charismatic king?. he enjoy freedom more than anything else. hence he let the lord and lady to rule their own land. <br/><br/>{command:Page7:as time passed~}]]></description>
  </object>
  <object name="name">
    <description><![CDATA[alright... [name]. you had just started to pick up a fighting stance when an older boy rush at you with a wooden sword. you then proceed to...<br/><br/>{command:Page2:take a step back}<br/><br/>{command:Page3:try to parry the older boy}<br/><br/>{command:Page4:throw his sword towards the older boy}]]></description>
  </object>
  <object name="agility">
    <description><![CDATA[you start jogging slowly and dash for a full minute before jogging again and repeating the excercise all while doing evasive movements once in a while with using your feet and sometime your upper body movement. this is a good practice to evade incoming attack<br/><br/>you look at the middle aged man once in a while and sometime he looks at you back for a moment and smile before quickly paying attention to the courtyard again. he is the only man here that you respect. when someone mention king, the first thing that comes to mind almost certainly is crown, or sparkling jewelry or tons of servant and mistress and other stuff like that, but not this king. his highness prefers something more casual. but that doesnt mean he doesnt have the aura of autorithy around him... no... even someone who doesnt know anything about the kingdom or the king would notice that there is something... special about this man. <br/><br/>the king is rather unpredictable and easy going. he does what he wants when he wants and leaves the day to day duty of running a kingdom to people that serves him, such as the governor and the high council. but he and he alone have total sovereignty over the kingdom. and beside.. who can say no to this charismatic king?. he enjoy freedom more than anything else. hence he let the lord and lady to rule their own land. <br/><br/>{command:Page7:as time passed~}]]></description>
  </object>
</asl>

this should do.. also dont forget that its in gamebook and not text adventure :x
again im sorry if i dont get this easily.. please bear with me
and thanks a lot!!!!


Hello,

  1. I changed Page1 a little so you can collect the player's name correctly. I deleted the first line because there would be no way the game can print the player's name before the player has entered it. (Also, the link at the bottom now reads: 'Enter your name and continue...', but, by looking at your code so far, I can tell you know how to change that if you'd like to.)
  2. I added a page I labeled 'getname', which is just the script to collect the name. Once the name is entered, the player is taken to Page2.

NOTE: If you want to print the name the player entered at any time (except for on Page1) you can now use {player.alias}.


I basically just added the page called 'getname' and linked Page1 to it.

This is the script that collects the player's name then moves them to Page2:
msg ("What is your name?")
GetInput() {
player.alias = result
MovePlayer (Page2)
}

Now, anytime you put {player.alias} anywhere in text, it will print the name which was entered by the player.

Here's the altered code:

Click here to view code

<!--Saved by Quest 5.6.6108.15891-->
<asl version="550">
  <include ref="GamebookCore.aslx" />
  <game name="Last Magic">
    <gameid>63b3b463-c241-4de8-85bc-598dbb5cce13</gameid>
    <version>1.0</version>
    <firstpublished>2017</firstpublished>
    <author>Benhard Sinaga</author>
    <subtitle>the third bell</subtitle>
    <showtitle />
    <clearlastpage />
    <showborder />
    <category>Fantasy</category>
    <defaultfontsize type="int">14</defaultfontsize>
    <defaultfont>'Lucida Console', Monaco, monospace</defaultfont>
    <defaultbackground>Gray</defaultbackground>
    <defaultforeground>White</defaultforeground>
    <defaultlinkforeground>Black</defaultlinkforeground>
  </game>
  <object name="Page1">
    <inherit name="scripttext" />
    <description><![CDATA[year 217... kingdom of magicinda. a kingdom with magic so plentiful that anyone is able to do magic to some extend. woodcutters, miners, farmers, housewifes, practically anything is done by magic, from simple means of light, to the powerful spell of re-growing forrest. from heating a bath tub, to fighting a battle. magic is a day to day life for the people lives here.<br/>snow covers most of the land all year long in most part and the kingdom itself is divided into 5 provice.<br/>the northern provice with the coldest athmosphere. there is not much things here except a huge old stone tower that stands some 300m tall. the details regarding the tower has always been a mystery for the general population.<br/>the western province consist of thick forrest and rivers... which ofcourse frozen during winter. this provice are the main producer of wood and pelts. the thick forrest offers plenty of games to hunt and the river have lots of great fishing spot.<br/>the eastern provice are full of mountains and hills... people dig deeper into the mountain everyday in search of mineral such as iron and bronze and even precious gems like ruby or saphire.<br/>only lands in the southern provice that has never been covered by snow and mostly used for farming industry. because of the lack of snow, this provice produce most of the kingdom's needs of food product including the all important alcoholic bevereges such as wine or mead.<br/>and last is the central provice. where the capital city of magicinda, infinium is located. the central provice are the smallest yet most important province. library, academy of magic, the castle, just about any important things can be found in this province.<br/>every provice is governed by governor, not handpicked by the king, but is voted by lords and ladies from the province. lords and ladies are the title bestowed by the king for those who have lands to rule and pay tax to the king. a lord or lady can have as little as 10 villages but some can have as many as 50 villages even cities and castles. they have certain sovereignty over their land but answer to the king and his extension the governor.<br/>~the capital city... infinium~<br/>lies a courtyard of a soldier training barrack near the castle. and there you stand... a 14 year old boy... almost a man,<br/><br/><p style="color:blue">{command:getname:Enter your name and continue...}</p>]]></description>
    <options type="stringdictionary">
      <item>
        <key>Page2</key>
        <value></value>
      </item>
      <item>
        <key>Page3</key>
        <value></value>
      </item>
    </options>
    <script type="script">
    </script>
    <object name="player">
      <inherit name="defaultplayer" />
    </object>
  </object>
  <object name="Page2">
    <inherit name="scripttext" />
    <description><![CDATA[you takes a few steps back avoiding all the older boy barrage of attack and return with some blow of your own with almost perfect precision and timing. after a few successive thrust to the epigastrium, the older boy fell on his knees with heavy breath. <br/>you then proceed to point his wooden sword to the older boy's throat for a few second. <br/><br/>{command:Page5:ask the older boy to yield}<br/><br/>{command:Page6:prepare to hit the older boy aiming for his head} ]]></description>
    <script type="script">
    </script>
  </object>
  <object name="Page3">
    <description><![CDATA[you parries all of your opponent's blow flawlessly patiently waiting for the older boy to wears out. after a few minute parrying, the older boy grows frustrated and tries to deliver a huge blow with all his weight behind his attack. he takes a full back swing of his wooden sword all the way to the back of his head and just about to hit you with a huge downward slash when you do a quick and finesse sidestep and deliver a kick directly to the older boy's epigastrium. the older boy let go of his sword and fall to his knees holding his abdomen with both hand.. his face says a lot about the pain he had received. <br/><br/>you then proceed to point his wooden sword to the older boy's throat for a few second. <br/><br/>{command:Page5:ask the older boy to yield}<br/><br/>{command:Page6:prepare to hit the older boy aiming for his head}<br/>]]></description>
  </object>
  <object name="Page4">
    <description><![CDATA[you instinctively throw your wooden sword towards the older boy, which the later deflected with his own wooden sword at the cost of his balance. now armed with nothing but fist you ducked and deliver a punch to your opponent's epigastrium. the pain can be seen clear as day in the older boys face as he falls to his knees holding his abdomen with both hand.<br/><br/>you then take the older boy's wooden sword and placed it in his throat for a few second. <br/><br/>{command:Page5:ask the older boy to yield}<br/><br/>{command:Page6:take a stance to hit the older boy aiming for his head}]]></description>
  </object>
  <object name="Page5">
    <description><![CDATA["its my victory... do you yield?" you said. the older boy said nothing for a few moment and suddenly a clap is heard around the courtyard<br/><br/>"splendid... absolutely briliant [name]". your ability in combat is without a doubt one of the best that i have ever seen.<br/><br/>the middle aged man pats you in the head before facing the downed older boy and asked him is he able to continue with the practice.<br/>the practice goes on for several more hour until the sun is about to go down.<br/>while in practice session you foccused in honing your...<br/><br/>{command:strength:strength. afterall what is a man without his muscle}<br/><br/>{command:agility:agility. the point of a fight is to hit without getting hit}<br/><br/>{command:endurance:endurance. to take a beating and still stand is what makes a man}<br/><br/>{command:confidence:not doing anything. i dont need anymore training. confidence is key}]]></description>
  </object>
  <object name="Page6">
    <description><![CDATA[you raises your wooden sword high and about to deliver the final blow when suddenly you feels that the wooden sword is unbelieveably heavy... so heavy that it almost snapped your wrist by sheer weight. he let go of his wooden sword by instict and it falls behind his head. a big thud is followed with fresh snow scattered from the groud by the impact. "that would be enough [name]" said a middle aged man, probably in his fifties, suddenly from behind you without you noticing his presence.<br/><br/>"it is not courage to finish off your opponent... courage is to unseathe your sword once you already drew it. you should remember that boy."<br/><br/>the middle aged man pats you in the head before facing the downed older boy and asked him is he able to continue with the practice.<br/>the practice goes on for several more hour until the sun is about to go down.<br/>while in practice session you foccused on honing your...<br/><br/>{command:strength:strength. afterall what is a man without his muscle}<br/><br/>{command:agility:agility. the point of a fight is to hit without getting hit}<br/><br/>{command:endurance:endurance. to take a beating and still stand is what makes a man}<br/><br/>{command:confidence:not doing anything. i dont need anymore training. confidence is key}]]></description>
  </object>
  <object name="Page7">
    <description><![CDATA[~later that afternoon~<br/><br/>someone grab you by your shoulder just when you are about to walk away from the training ground. it was the older boy that you beat earlier. <br/>"hold it [name]" he said as he pulled your shoulder and forced you to face him. you have this urge to punch him in the face so hard but you calm your nerves and let him speak. <br/><br/>"i hope you dont think that you are better than me just because you beat me in mere swordsplay" he taunts at you. you noticed the glow in his palm that indicates magical spell is used.<br/><br/>he just as anyone else in this kingdom knows full well about your inability to harness and use magic. and by that fact alone makes you an outcast. the undesireable. the freak. most people shun at you and talks behind your back, but some people... like this older boy, they dont care if you are the prince of the kingdom. they dont care if you are the heir of the throne and that they owe their allegience to you, they just find satisfaction to bully your inability to use magic. but somewhat, somehow you actually respect people like him. he have the guts to confront you and not just talks behind your back and even spread rumors just like most people you know. <br/><br/>"i dont want any problem... its just practice anyway." you replied<br/><br/>he takes a few step back putting some distance between the both of you as he displayed his fire magic to intimidate you.<br/>"ofcourse... its just practice. but you see... its been a long time since we had magical fight practice and i just want to know how good i am  by sparring you again, with magic this time of course" he said with mocking tone.<br/><br/>you clench your fist when you heard the word magic.<br/><br/>{command:Page8:says that you are not interested in anymore spar and walks away}<br/><br/>{command:Page8:you turn your back to him and walks away without saying a word}<br/><br/><br/>]]></description>
  </object>
  <object name="Page8">
    <description><![CDATA[as you turn your back you can sense a movement behind you and you take a sidestep instinctively and feels a warm thing fly across where your head is supposed to be, had you not evade it. a firebolt spell. you grit your teeth and turn around seeing the older boy with a huge grin across his face holding fire in his palm. <br/><br/>you stood there motionless, some 10 meters away from him and glares. a second later, 2 firebolt flies to you which you can easily avoid with just your upper body movement. <br/><br/>"whats the matter? come on use your magic against me already~" he said "but oh... i forgot~ you cant!" he said again mockingly and with a big laugh <br/><br/>you dont really have any choice except to stand your groud and evade his spell. you know you cant beat a spellcaster in a close combat let alone in this range. you think for a few moment as what to do when suddenly the older guy yelps in pain with surprise, you see a beautiful young lady with a bright scarlet hair behind him with angered looks in her face. <br/><br/>"go away... NOW" she glares at the older boy while showing a blue-ish aura around her.<br/><br/>"s...sorry princess.. right away princess" he replied and quickly bows and walks backward a few step before turning around and runs<br/><br/>"nothing is too much huh?" you grins at her<br/><br/>"hhhhmph... he deserves that, anyway are you okay [name]?" she walks towards you with worried looks in her face <br/><br/>"ive been better, thanks for the help anyway, if only i can do what you did back there" <br/><br/>"aww gezzz you are the prince.. you shouldnt look so pathetic" she hits your head jokingly and grabs you by the arm "care to lead this princess to the castle?" she said in spoiled voice<br/><br/>"thats my arm that you are strangling there" you tried to push her head away from your arm gently <br/><br/>"nope... i am the princess and i claim this arm as mine" she said jokingly <br/><br/>you walk with her towards the castle. unlike you, an adopted heir, she is a princess by blood... a real royalty, flesh and blood of the king himself. she is about the only person in the kingdom -except the king- that doesnt mind about your inability to use magic. in fact she respect you because of it and think very highly of you. <br/>along the way you...<br/><br/>{command:Page9:ask her about magic}<br/><br/>{command:Page10:ask if she remember about the first time we met}<br/><br/>{command:Page12:stays quiet all the time}]]></description>
  </object>
  <object name="confidence">
    <description><![CDATA[you didnt do anything for the rest of the training session. you just watch as the other trainee practicing from the side of the courtyard thinking highly about yourself that you are twice as good as them.<br/><br/>you look at the middle aged man once in a while and sometime he looks at you back for a moment before quickly paying attention to the courtyard again. he is the only man here that you respect. when someone mention king, the first thing that comes to mind almost certainly is crown, or sparkling jewelry or tons of servant and mistress and other stuff like that, but not this king. his highness prefers something more casual. but that doesnt mean he doesnt have the aura of autorithy around him... no... even someone who doesnt know anything about the kingdom or the king would notice that there is something... special about this man. <br/><br/>the king is rather unpredictable and easy going. he does what he wants when he wants and leaves the day to day duty of running a kingdom to people that serves him, such as the governor and the high council. but he and he alone have total sovereignty over the kingdom. and beside.. who can say no to this charismatic king?. he enjoy freedom more than anything else. hence he let the lord and lady to rule their own land. <br/><br/>{command:Page7:as time passed~}]]></description>
  </object>
  <object name="endurance">
    <description><![CDATA[you walk over to the group of trainee and asked them to help you train your endurance by hitting you while you try to endure all the damage. its not the brighest thing to do but the result of this kind of training really pays off all the pain and bruise aftereffect <br/><br/>you look at the middle aged man once in a while and sometime he looks at you back for a moment and smile before quickly paying attention to the courtyard again. he is the only man here that you respect. when someone mention king, the first thing that comes to mind almost certainly is crown, or sparkling jewelry or tons of servant and mistress and other stuff like that, but not this king. his highness prefers something more casual. but that doesnt mean he doesnt have the aura of autorithy around him... no... even someone who doesnt know anything about the kingdom or the king would notice that there is something... special about this man. <br/><br/>the king is rather unpredictable and easy going. he does what he wants when he wants and leaves the day to day duty of running a kingdom to people that serves him, such as the governor and the high council. but he and he alone have total sovereignty over the kingdom. and beside.. who can say no to this charismatic king?. he enjoy freedom more than anything else. hence he let the lords and ladies to rule their own land. <br/><br/>{command:Page7:as time passed~}]]></description>
  </object>
  <object name="strength">
    <description><![CDATA[you walk over to the sets of stones and iron and try to lift them with all your might. this is certainly a good way to increase your muscle mass<br/><br/>you look at the middle aged man once in a while and sometime he looks at you back for a moment and smile before quickly paying attention to the courtyard again. he is the only man here that you respect. when someone mention king, the first thing that comes to mind almost certainly is crown, or sparkling jewelry or tons of servant and mistress and other stuff like that, but not this king. his highness prefers something more casual. but that doesnt mean he doesnt have the aura of autorithy around him... no... even someone who doesnt know anything about the kingdom or the king would notice that there is something... special about this man. <br/><br/>the king is rather unpredictable and easy going. he does what he wants when he wants and leaves the day to day duty of running a kingdom to people that serves him, such as the governor and the high council. but he and he alone have total sovereignty over the kingdom. and beside.. who can say no to this charismatic king?. he enjoy freedom more than anything else. hence he let the lord and lady to rule their own land. <br/><br/>{command:Page7:as time passed~}]]></description>
  </object>
  <object name="name">
    <description><![CDATA[alright... [name]. you had just started to pick up a fighting stance when an older boy rush at you with a wooden sword. you then proceed to...<br/><br/>{command:Page2:take a step back}<br/><br/>{command:Page3:try to parry the older boy}<br/><br/>{command:Page4:throw his sword towards the older boy}]]></description>
  </object>
  <object name="agility">
    <description><![CDATA[you start jogging slowly and dash for a full minute before jogging again and repeating the excercise all while doing evasive movements once in a while with using your feet and sometime your upper body movement. this is a good practice to evade incoming attack<br/><br/>you look at the middle aged man once in a while and sometime he looks at you back for a moment and smile before quickly paying attention to the courtyard again. he is the only man here that you respect. when someone mention king, the first thing that comes to mind almost certainly is crown, or sparkling jewelry or tons of servant and mistress and other stuff like that, but not this king. his highness prefers something more casual. but that doesnt mean he doesnt have the aura of autorithy around him... no... even someone who doesnt know anything about the kingdom or the king would notice that there is something... special about this man. <br/><br/>the king is rather unpredictable and easy going. he does what he wants when he wants and leaves the day to day duty of running a kingdom to people that serves him, such as the governor and the high council. but he and he alone have total sovereignty over the kingdom. and beside.. who can say no to this charismatic king?. he enjoy freedom more than anything else. hence he let the lord and lady to rule their own land. <br/><br/>{command:Page7:as time passed~}]]></description>
  </object>
  <object name="getname">
    <inherit name="script" />
    <script type="script">
      msg ("What is your name?")
      GetInput() {
        player.alias = result
        MovePlayer (Page2)
      }
    </script>
  </object>
</asl>

Sidenote: If we need to trade any more code in the future, we might be better off switching to the Libraries and Code Samples forum on this same site. (Just to help them keep things organized.)


Friendly advice about the content:

  • Mind the capitalization and punctuation. This type of game revolves around reading, and the player will be distracted by grammatical and typographical errors.

You'll probably look at what I've changed on the first page and say, 'oh! I see!'

From that point, I bet hegemonkhan's guide will make MUCH more sense.


Ask for help anytime you need it!


SWEET!!!
now thats naming issue down! thanks a bunch richard :D
also i noticed after returning back to page view from code view that it actually more gets more simple

{command:getname:Enter your name and continue...}

does anyone have any list of any working simple code (command) in the page view in game book? (instead of the super long super confusing code in the code view)
also thanks for the reminder about the punctuation and the capitalization... ill try to make it right next time~


@SoapyBen

Most importantly: go through and replace every instance of [name] with {player.name}. (I just now noticed you had that in there.)


One thing at a time: the only way to work. (I just learned how to write that code with you, by the way. It was like a class project)


Now, before you go clicking on these links, remember: just focus on one thing at a time. Once you get that one thing working, move on to the next. Before long, you'll have all sorts of things working together! (Of course, the laws of probability will then step in and infest your game with BUGS, but fear not! Working through those problems is what it's all about!)

I advise you to scroll back up and wrap your mind around hegemonkhan's information at this point. (He's quite knowledgeable! (Much more than I. I'm just winging it!))

Anyway, these two links list almost all of the built-in scripts and functions you can use in Quest.
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/


PS

I ported what you've got so far to Squiffy.(All I really did was copy and paste what was there already.)
(I know... I keep saying, "Squiffy, Squiffy, Squiffy!" and you've already stated your preference is not Squiffy. This is the last time I'll bring it up. You have my word.)

Check out this code. I bet you can see what's going on when the example is your own game.
(It's posted on a secret Github gist. I will immediately bring it down if you'd like, but I believe we're supposed to be doing it this way to keep the forum running smoothly.)

https://gist.githubusercontent.com/rheadkid/a369cbacc8d2a47ab0d767a863f038e9/raw/0b5f38ebd84a53bc477df86f10d70e8d457d21c6/Last_Magic.aslx

Just copy and paste that over everything in the pane on the left side of the following page and click RUN:
http://textadventures.co.uk/squiffy/editor


the 'text processor commands' are the easiest and quickest to use at least if you're not doing anything too complex (otherwise normal scripting can be easier to work with then):

http://docs.textadventures.co.uk/quest/text_processor.html (some are just for the Text Adventure only, so be aware of what you're looking at)


in code, here's an example of what it looks like:

(I don't know what it'd look like in the GUI/Editor, as I don't use it much, and never really used the Game Book much either)

using the text processor commands:

player.alias = "HegemonKhan"
player.sex = "male"
player.age_integer_attribute = 18 // I wish I was 18, lol
player.age_string_attribute = "adult"
player.race = "human"
player.class = "warrior"

msg ("{player.alias} is an {player.age_integer_attribute} year old {player.age_string_attribute} {player.sex} {player.race} {player.class}.")

// output:

HegemonKhan is an 18 year old adult male human warrior.

VS

using normal scripting:

player.alias = "HegemonKhan"
player.sex = "male"
player.age_integer_attribute = 18 // I wish I was 18, lol
player.age_string_attribute = "adult"
player.race = "human"
player.class = "warrior"

msg (player.alias + " is an " + player.age_integer_attribute + " year old " + player.age_string_attribute + " " + player.sex + " " + player.race + " " + player.class + ".")

// output:

HegemonKhan is an 18 year old adult male human warrior.

ask if you need help understanding how to use them (understanding what is the syntax is a bit confusing on what you put in vs what you keep the same)


"{command:getname:Enter your name and continue...} (soapyben)"


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

// where-ever scripting (some page, Page Type: [script] or [text+script])

msg ("{command:getname:Enter your name and continue}")

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

<command name="soapybens_getname_command">
  <pattern>getname</pattern>
  <script>
    get input {
      player.alias = result
    }
  </script>
</command>



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

Support

Forums