Some questions about Gamebooks

Hexen
15 Sept 2012, 23:51
Hey there. I'm new to trying out gamebooks and have a few questions. I am trying to make a choose your own adventure that does two special things: (a) keeps track of a score to show the number of pages found (say, displaying 40 of 80, showing you've found 40 pages of the 80 total pages) and (b) change the best ending around the other endings that have been experience. I know how to do this in the text adventure, but don't know if it's possible in the gamebook mode.

Basically, if it's possible,two things could work.

Either adding functions (if, etc.) into the gamebook mode or, if that is not possible, adding links to the next pages similar to the gamebook mode in the text adventure mode (which I assume is possible because of the links for directions).

sgreig
16 Sept 2012, 14:13
It's technically possible to do this but not through the GUI. You would have to open the code editor and make the changes manually.

Hexen
16 Sept 2012, 18:17
I figured it would have to be as so.

Though I'd have to figure out the proper placement myself, would going into the text adventure mode and say setting it to add 1 point the first time you enter the room, switching to code mode, and copy pasting it (making adjustments accordingly) work? Or is the syntax different?

So, basically, could I just paste this in each room to increase the score?

<firstenter type="script">
IncreaseScore (1)
</firstenter>

sgreig
17 Sept 2012, 09:10
That code should work, yes.

Hexen
17 Sept 2012, 12:02
I couldn't get that code to work in the gamebook mode... but it turns out I couldn't get it to work in the Text Adventure mode alone either. I'm not extremely well versed in Quest's coding system... or any system for that matter. However, looking through the code I think I have a pretty good idea of the correct questions I need to ask.

1. In order to get commands from the text adventure mode to work, do I need to include the Core.aslx ref somehow? Simply including it in the code where you include refs always gets me an error but it seems like the commands are within the ref.

2. Is there a default scoring system? I looked up scoring on the wiki and saw Pixie's system but that seems to require an additional ref and is also a fair bit more complex then I need. All I'm looking for in a score is to show the pages found number versus the total pages and call an if statement on the final page (Basically, if score is = # then).

sgreig
17 Sept 2012, 18:26
I probably should have looked at it more in depth, sorry.

core.aslx is included in all games, which is likely why trying to add it to the game yourself is giving you an error. ASLX scripting doesn't change between the different modes, all that changes is the editor interface.

I don't believe there is a default scoring system, but all it is is a variable so it's really easy to add your own. Somewhere in the beginning of the game I would add the line:


game.score = 0


Then in each room, just have the line:


game.score = game.score + 1


That will increment the score variable every time you enter a room. Then if you just want to display the score at the end, you'd use something like this in the description of the final room:


msg ("Your score is " + game.score +" out of XXX")


Where XXX is the total number of rooms. You could write some code to automatically calculate the number of rooms, but if you want to keep things as simple as possible, just keeping track yourself will work fine.

Hexen
18 Sept 2012, 13:32
I can't seem to get any commands from the text mode to function in gamebook mode, even when implanted purely in code. For example, using code I can display a message in text mode but in gamebook mode, despite it being proper syntax and the game not giving me an error, it is not displayed.

I think my problem may be something to the effect of gamebook pages not having the same parameters as rooms in text adventure mode. That is to say tags like <firstenter></firstenter> do not seem to function in a way that their contents are displayed. I'm looking for a tag that could display code within the gamebook mode. Unless there is something that displays outside of the description text and links to the next page, it may not be possible.

sgreig
18 Sept 2012, 22:55
Alex would likely have to weigh in on this as he would know better than me, but I would say if the conditions you're trying to achieve work in text adventure mode and not in gamebook mode, then gamebook mode doesn't support it. It would be more work, but maybe you should create the gamebook using text adventure mode instead if you really need these features?

Or at the risk of saying something totally off the wall, maybe some other scripting language designed for interactive choose your own adventure gamebooks would be better suited to what you're trying to do? Inklewriter, ChoiceScript and Undum are a few that come to mind readily. They're not as easy as Quest, but offer more options for interactivity.