This app lets you create your own gamebook, without the hassle of assigning the random section numbers yourself!
- Make Your Own Gamebook allows you to create your very own interactive gamebook, where readers choose how to engage with characters and events they encounter as the story unfolds.
- All you need to do is keep tabs on your section names in the section title headers and references throughout the text, and the Python code takes care of all the nitty-gritty details of assigning the numbers and sorting your document for you!
- The code even checks for spelling mistakes in the section titles and lets you know if you have duplicates.
- Importantly, it verifies that the last section can be accessed from the first section without interruption (that is to say, it checks for contiguity) and lets you know the furthest section that it is able to reach in your unsorted original document. This helps you figure out where there are issues as you are writing your work.
- Text (".txt") documents or rich text format (RTF, ".rtf") documents may be used with the code, and you can even feed the code the RTF document from the TintypeText typewriter optical character recognition application (See the TintypeText github repository: https://github.com/LPBeaulieu/Typewriter-OCR-TintypeText). As an important note, only the advanced RTF mode of TintypeText should be used, in order to maintain the justified text alignment, and the RTF command sequence "\par\par\pard" ("=par=par=pard" on the typewriter) should be avoided, as the individual sections are split by Make Your Own Gamebook based on this divider.
- Every section within the document should bear a unique name, using a “** Section” opening tag and closing asterisks ( ** ), as exemplified by the following section title header: “** Section Exploration of the Caves **”.
- The same section titles, without the opening tags or asterisks, but preceded by “turn to” and followed by a period (for example: “turn to Exploration of the Caves.”) will be used throughout the section texts to refer to the the appropriate section title headers.
- It must be emphasized that the presence of two consecutive asterisks before (within the “** Section” tag) and after the section title header is required in order to locate the section titles within the text. Furthermore, a period is needed after a section title reference, so as to indicate the end of the random index (so that “turn to 1” is not confused with “turn to 11”, for instance).
- All of the section title headers (for example: “** Section Exploration of the Caves ** ”), and section title references (for example: “turn to Exploration of the Caves.”), need to be spelled the exact same way to ensure correct random index substitutions.
- Also, you should avoid putting any text before the first section or after the last section, as this text would be lost after splitting the document into individual sections. You should instead write separate foreword and afterword documents that will not be submitted to the present code.
- It is all the more important to check for typos and omitted asterisks in the first section opening tag (“** Section”), as if the second section opening tag is correctly written, such mistakes in the first section would result in its exclusion from the list of sections.
- You should avoid non-directional double quotes ( " ) when writing your “.txt” document on your computer, as these characters are omitted in the RTF file. Documents should be redacted in a word processor that uses directional quotes and be saved in “.txt” or “.rtf” format.
Here is a link to an instructional video how to setup and use Make Your Own Gamebook: https://youtu.be/SDxXuYPVmNw.
The paths included in the code are formatted for Unix (Linux) operating systems (OS), so the following instructions are for Linux OS environments.
Step 1- Create a virtual environment (called env) in your working folder:
python3 -m venv env
Step 2- Activate the env virtual environment (you will need to do this step every time you use the Python code files) in your working folder:
source env/bin/activate
Step 3- Install the required SpellChecker module (https://pypi.org/project/pyspellchecker/) to spellcheck the section titles:
pip install pyspellchecker
Step 4- You're now ready to use Make Your Own Gamebook!
Be sure to check out the Youtube video (see link above) for instructions on how to use the Python code files. You can now easily create your very own gamebook in a few seconds, without all the hassle of assigning random section numbers yourself! 🎉📖
- 👋 Hi, I’m Louis-Philippe!
- 👀 I’m interested in natural language processing (NLP) and anything to do with words, really! 📝
- 🌱 I’m currently reading about deep learning (and reviewing the underlying math involved in coding such applications 🧮😕)
- 📫 How to reach me: By e-mail! LPBeaulieu@gmail.com 💻
- Hat tip to @kylelobo for the GitHub README template!