View all endings

christiawi987
04 Dec 2021, 01:16

I have a game with many endings. However, I don't remember where they all are within the game. In the game editor, is there a way to track down all the places I put a game ending?


MakeJake
04 Dec 2021, 20:36

I wish you could organize stuff like that easier, but I'm not aware of any features like this >-<


DarkLizerd
04 Dec 2021, 22:38

You can open the game in notepad and do a search for "finish".
But that will also list every time you use the word finish in your text as well.
I thought about creating a program in Visual Basic that could create rooms, descriptions and connecting exits, and show that as a map.
Maybe even reading a game's map data.
I'm just not sure how many people would want/use it.
Other functions shouldn't be that hard to add.


mrangel
04 Dec 2021, 22:45

What do you mean by an "ending"?

In a text adventure, you could search the whole file for the script command finish, which displays a game over. Not sure if the editor has that function, but you can easily open the file in Notepad or your favourite text editor just to search; it will at least let you find them.

If you've got a function that calls finish, or ends the game some other way, you might have to search for that separately. It depends a lot on the structure of your game.

If you mean a gamebook, that's a bit weird… because as far as Quest is concerned, a gamebook doesn't have an ending. If a page doesn't have any links leading away from it, the player can't go anywhere because there's nothing to click on - but the game isn't aware of that and keeps waiting for input just the same.

However, you could possibly search for all the endings using a little script. If you temporarily add a 'script' page that does something like the following:

foreach (page, AllObjects()) {
  ending = true
  if (page.name = "player") {
    ending = false
  }
  if (ending and HasAttribute (page, "options")) {
    foreach (opt, page.options) {
      if (not opt = page.name) {
        ending = false
      }
    }
  }
  if (ending) {
    msg ("Page " + page.name + " looks like an ending.")
  }
}

Then you can visit that page to get a list of all the pages that don't have links.
Of course, there may be false positives if you've included links in the page text. To check for those, you would modify the script, inserting:

  if (ending and HasString (page, "description")) {
    if (IsRegexMatch("\\{(page|object|exit|command):", page.description)) {
      ending = false
    }
  }

before the final

  if (ending) {

However, this isn't perfect… it could still get confused in some cases. But it would find all the pages without exits unless you have some pretty complex scripting going on.

It's not perfect; but it might help.