Hidden text to improve a game-book

I’m writting a game-book like a text-based game with dungeons, puzzles, exploration etc. Basically, each page of the book has a description of the player currently location and actions to choose. I wish the character could interact with places and things, like opening chests and doors, picking objetcs etc. In order to do this, i need to create two texts for the same place, one before and other after the character action. For example: Page1: "You are in a meadow. There is a sword on the ground. What are you going to do? TAKE SWORD or GO NORTH or GO SOUTH > TAKE SWORD > Page 2: “You are now carrying a sword. CONTINUE” > Page 1 (again): “You are in a meadow. There is nothing special here. What are you going to do? GO NORTH or GO SOUTH”. I wonder maybe there is a way to hidden the second text to page 1, so it can appear only after the character reach the page 2 and clik on “CONTINUE” hyperlink.

Sounds pretty complicated. Here is an article that may help:
https://help.libreoffice.org/latest/en-US/text/swriter/guide/hidden_text.html

I don’t understand the purpose of the question. Do you mean the document itself is part of the game and provided to the player? Assuming you have solved the problem of prompting the user, showing/hiding paragraph can be done with conditional paragraphs controlled by a variable. The consequence is a huge number of variables, each one corresponding to an action so that you can remember the global state of the game. Unfortunately I know of no way of setting a variable from an interactive user entry (no way to convert a field input to a variable value).

Since your book specification is page-based, I think Writer is not the best tool. Have you considered Impress?

1 Like

Consider using an embedded database of some kind what you want sounds too complicated for a word processor to me.

1 Like