Git Product home page Git Product logo

lpbeaulieu / make-your-own-gamebook Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 4.87 MB

This app lets you create your own gamebook, without the hassle of assigning the random section numbers yourself!

License: GNU Affero General Public License v3.0

Python 100.00%
gamebook gamebooks interactive-book interactive-books interactive-fiction interactive-novel interactive-novels choose-your-own-adventure make-your-own-gamebook

make-your-own-gamebook's Introduction

Make Your Own Gamebook

This app lets you create your own gamebook, without the hassle of assigning the random section numbers yourself!

Image RTF basic mode

Make Your Own Gamebook

License: AGPL-3.0 GitHub last commit GitHub issues


  • 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.

๐Ÿ“ Table of Contents

โ›“๏ธ Important Pointers

  • 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.

๐Ÿ Getting Started and Usage

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! ๐ŸŽ‰๐Ÿ“–

โœ๏ธ Authors

  • ๐Ÿ‘‹ 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! [email protected] ๐Ÿ’ป

๐ŸŽ‰ Acknowledgments

  • Hat tip to @kylelobo for the GitHub README template!

make-your-own-gamebook's People

Contributors

lpbeaulieu avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.