Gamebook Menus and while loops?

miryan
As it says in the title, what's the best way to present the player with a menu and capture user input?

I have investigated both the Text Adventure and Gamebook options, and find that the Gamebook offers me more of the experience I'm looking for, but certain effects have to be faked or kludged. I tried show menu(), but that throws up a flag.

Also had trouble defining a variable and then checking it against another for the while loop.

Any advice?

TinFoilMkIV
Gamebooks are more structured and a bit easier to work with once you know your way around, however the Text Adventure can literally do everything a Gamebook can and then some, the downside being you have to code it to look like a game book and more flexibility means more ways to break things.

With my own tendency to over complicate things and try to do unnecessarily fancy things, I haven't actually worked in Gamebook mode so unfortunately I can't really help too much on the specific limitations that come with it. As for the rest of the questions I'll see what I can do.

So first off, what do you mean specifically by "menu"? Do you want it as a popup or would simply creating a text page that acts as a menu be acceptable for your purposes? The built in menu system should work acceptably for what you want if your okay with how it displays, but as you said I suspect it doesn't work with the gamebook mode.

For the full text display type menu things are a bit more complicated since looping input sequences aren't anywhere near straightforwards. That being said if you understand the concept of 'functions' and think you can keep track of things while calling multiple functions across one script it's not too bad once you get how it all works together.


As for the while loop, is your variable being updated at all during the loop? ie: can the variable change during the loop so that it can end once it starts looping. or is the loop never triggering? I'll need a bit more detail, preferably the block of code itself with some context of whats supposed to be happening and such.

The Pixie
If you want to do complicated stuff, a text adventure is really the way to go, and it is better to realise that sooner rather than later.

This page gives an idea of how to fake a gamebook with a text adventure:
viewtopic.php?f=18&t=4772

There is a lot you can do in the way of menus using JavaScript. It is not trivial, but these pages might at least suggest what is possible.
viewtopic.php?f=18&t=5111
viewtopic.php?f=18&t=4822
viewtopic.php?f=18&t=5474

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

Support

Forums