Gamebook coding help
Jonatan6777
29 Aug 2018, 19:16Hello, I've been trying to get a stats menu to work in the form of a paper sheet which shows your stats and you have like a + and a - which you can press in order to raise or lower said stats.
Now I've been trying to do so through gamebook where + takes you to another page which then your stat is let's say STR=1 and if you click the plus again the it takes you to another specific page but now your STR=2 now I've been having difficulty doing this specific thing mainly because if I do that the player can put as many points in STR or any other stat as he wants and I want to limit that if anyone can help me understand how to do I'll be very grateful :D
Thanks!
hegemonkhan
30 Aug 2018, 06:32not sure if this can be done with the Game Book (too lazy to check):
https://textadventures.co.uk/forum/quest/topic/5089/solved-level-library-pixies
but here's a method of doing it (credit goes to Pixie and Jay Nabonne)
(if you need help with understanding it, let me know)
Pertex
30 Aug 2018, 06:57Here is another example how to do it in Gamebooks:
<!--Saved by Quest 5.7.6600.16194-->
<asl version="550">
<include ref="GamebookCore.aslx" />
<include ref="EditorDeutsch.aslx" />
<game name="testgamebookd">
<gameid>335dba88-5c21-40ae-bf4c-86fbe73dffc3</gameid>
<version>1.0</version>
<firstpublished>2018</firstpublished>
</game>
<object name="startpage">
<inherit name="scripttext" />
<description><![CDATA[<br/>{if str<3:{page:stradd:+}} Strength {if str>0:{page:strsub:-}}]]></description>
<options type="stringdictionary" />
<script type="script">
firsttime {
SetCounter ("str", 0)
}
</script>
<object name="player">
<inherit name="defaultplayer" />
</object>
</object>
<object name="stradd">
<inherit name="script" />
<description>No description needed.</description>
<script type="script">
IncreaseCounter ("str")
msg ("strengh+1 = " + game.str)
MovePlayer (startpage)
</script>
</object>
<object name="strsub">
<inherit name="script" />
<description>No description needed.</description>
<script type="script">
DecreaseCounter ("str")
msg ("strengh+1 = " + game.str)
MovePlayer (startpage)
</script>
</object>
</asl>
Jonatan6777
30 Aug 2018, 23:38Hey, thanks for trying to help me hegemonkhan & Pretex, although I'm still kind of stuck I should've mentioned that my coding experience is zero, I'll take your help if you have the patience to help me set the page up, I've tried reading the codes but I'm wondering how to exactly read this.
hegemonkhan
31 Aug 2018, 05:58-
create a new Game Book game
-
save it as whatever, and save it somewhere you can find it (the desktop for example)
-
right click on your 'XXX.aslx' Game Book game file you just created, and choose to 'open' it, and select a text editor software (notepad, wordpad, Apple: text editor, notepad++), etc --- highly recommend that you download (its free and very powerful/useful) notepad++ software: https://notepad-plus-plus.org (for quest, at the top of the notepad++ screen when you got it opened up, at the menu bar at the top, under 'languages', select 'XML', as this programming language is similar to quest's custom 'aslx' language, and the color coding and everything matches up, so using 'xml' works perfectly for quest coding)
-
upon opening up your 'XXX.aslx' Game Book game file, you'll be looking at your entire game code, the 'asl' is your GAME OBJECT, so as you can see everything is within/between the 'asl' tag block's beginning and ending tags:
<asl version="###">
<!-- YOUR MASS OF GAME CODE/CONTENT -->
</asl>
anyways, highlight all of it, and delete it!
-
highlight, copy, and paste in pertex code into your blank Game Book game file, and save your Game Book game file
-
now close out of your Game Book game file, and open it up normally (double click on it) to into the GUI/Editor, and then you can study it and play/test it as well.
-
if you got a problem... try changing this line:
<asl version="550">
to:
<asl version="580">
or whatever is the current version of pixie's quest (at the top of the screen, in the menu bar, under 'about', you can see the version of quest, input that version (its the first 2 digits, and the 3rd digit is always zero for putting it into the code line above) into the code line above
(you can see what version of quest pertex is using, as it inputs the save into the game file's code (outside of the 'asl' GAME OBJECT):
<!--Saved by Quest 5.7.6600.16194-->)
<asl version="550">
<!-- MASS OF GAME CODE/CONTENT -->
</asl>
so pertex would/could put in this instead (I think):
<asl version="570">
<!-- MASS OF GAME CODE/CONTENT -->
</asl>
// -----------------------
see how the quest version:
Saved by Quest 5.7.6600.16194
is to be converted into for the 'asl version' code line:
quest version: 5.7.6600.16194: <asl version="570">
if you want to learn more about coding directly with quest, here's how to understand quest's code structure:
http://textadventures.co.uk/forum/quest/topic/mu7itzjqv0yxrkdwgsbmzg/how-to-make-npc-confront-you-with-chioces#46cdb25b-4767-40a6-8bf4-3cd84e805781
and here's more links of guides to help with learning quest and its coding:
http://textadventures.co.uk/forum/general/topic/ljjm32av4e2t9ot49k478g/help#710be61e-eae1-4af1-8363-520cc718ba1c
ask if you need help with anything!
hegemonkhan
31 Aug 2018, 06:17P.S.
you might need to change this in pertex' code:
<include ref="EditorDeutsch.aslx" />
to (I presume, as I haven't checked, just going by the same pattern as above) this:
<include ref="EditorEnglish.aslx" />
or, whatever human language you know/use/are, lol
Pertex
31 Aug 2018, 07:05To be harsh and honest, if you don't get along with my example, you shouldn't try to use it in your game. Somehow you want to use the set values later for which you have to use scripts again. If you don't want to learn to program yourself, you won't make any progress. You won't find anyone here to program your game. Sorry!
Jonatan6777
31 Aug 2018, 12:08Thanks hegemonkhan I'll see what I can do with that info. :)
Thanks for the advice Pertex, I do want to learn myself, as I said I merely "got stuck" after trying to "play" around your code, I've searched for countless of pages to understand how to do this seemed-to-be simple stats page but I figured it's time for my last resort and just ask for help on the forum, thanks anyway.

K.V.
01 Sept 2018, 01:49Hello, all!
Fun fact:
If running the current desktop version of Quest (which is 5.8.*), the ASL version needs to be 580.
570 is not a valid ASL number. (It jumps from 550 to 580.)