Is it possible to make a locked door in a game book?

Kind of a self explanatory question. How can I make it so that there is a locked door, and in order to open it the player first has to find a key which will then add a new option on the doors page which will allow them to use said key.


I'm imagining a game where you have a page called doorpage. It has a link the player can click to try the door, which leads to a page called lockedpage, which sends them back to try something else. Once the player has the key, this should be changed to an "Unlock the door" option, which leads to a page called openpage.

So on the page where the player finds the key, you would have a script like:

if (DictionaryContains (doorpage.options, "lockedpage")) {
  dictionary remove (doorpage.options, "lockedpage")
  dictionary add (doorpage.options, "openpage", "Unlock the door")
}

Is that what you're after?


More or less, I’m guessing it’d be a lot easier to do this if this was a txt adventure instead but I just like the format of having options to select. It’s been awhile since I’ve done much programming so I guess this is as good a place as any to get back in.


Are you creating a gamebook or a Parser?

If you want using the gamebook mode, all you need is setting a flag to tell if the player has or not the key and the game may read it and redirect to the proper page.

If you want making a Parser game, I believe you already got a solution.

If you want making a Gamebook using the Parser mode... Well, the flag thing also solves the matter.


Log in to post a reply.

Support

Forums