txt2CYOA : a "choose your own adventure" easily made with txt2tags by Farvardin (enter your own name here) %%date(%Y-%m-%d) %!includeconf: ../txt2cyoa.t2t % Vous pouvez utiliser indifféremment du code en GBL, % (voir http://redohome.hd.free.fr/gameBooks/index.php) % ou la syntaxe de txt2cyoa dans votre jeu. % Insert your logo / picture instead of this one : [sample_txt2cyoa.png] @titre Test1 @auteur Eric @licence bsd == 0 == - Start the game 1 ==1==[intro] txt2CYOA is a new way for creating "choose yourself your own adventure" books. //(c'est par ici en français : [9 #9])// Thanks to the very easy syntax of [txt2tags http://txt2tags.sf.net], you write the story with simple markup, and can convert it to html or top quality pdf //(by using LaTeX)//. You can also include some images if you wish... Just study the instructions given in the source file and you're ready to use it ! You can modify the sample.t2t file and the cyoa_A4.sty style file to make your game and customise the appearance. - look at the [txt2tags source %%infile] - admire the [pdf output sample.pdf] - download the [package ../txt2cyoa.zip] - browse the [code ../] - Read the instructions in English [8 #8] - ou ici en français : rdv au 9 - begin the story [who are you? who_are_you.html] - commencer l'histoire [un nouveau monde un_nouveau_monde_gbl.html] - or begin a basic sample story : 6 == 2 == There is nothing interesting in the boat. This sample story is quite empty yet, but you can improve it yourself ! Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. - Go to the cliff : 6 - Go to the village nearby : [3 #village] - Use the boat : 7 ==3==[village] % beware : don't use space for marks around named links % note: you may prefer to avoid named links, because if you make reference to the number elsewhere, if it's not named correctly, the link won't work You are in the village. There are some nice old houses there. wrap=[sample_village.png]=wrap Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. - Go back to the cliff : 6 - Go the beach : 5 - Go to the market place : 4 - Enter your home : 7 == 4 == There is no one here. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. - Go to the cliff : 6 - Go to beach : 5 - Go back to the entrance of the village : [3 #village] == 5 == You are on the beach. There is the sea in front of you. A boat is here. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. - Go back to the cliff : 6 - Go to the village nearby : [3 #village] - Look inside the boat : 2 == 6 == You stand on the edge of a cliff. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. - Go to the beach : 5 - Go to the village nearby : [3 #village] == 7 == Congratulation, the game is finished ! - Go study how it works : 8 - Voir la version française : 9 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. == 8 == Create Choose your own Adventure with Txt2Tags (txt2CYOA) Requirement : python and optionally tex + pdflatex (use texlive for ex.) For using this template, you just need to create your sections using for ex. : ``` == z == ``` To create a choice, use either : ``` - Description of the choice : z - Description of the choice : [z #z]. More words afterwards. ``` with z being replaced by the number of your section. You must use the syntax ``[z #z]`` if the number is followed by something and not alone at the end of the line. You can also add more descriptive links with : ``` == z ==[name_of_link] ``` and the call to this chapter would be : ``` - Go to this chapter : [z #name_of_link] ``` You can add pictures with ``[yourpicture.jpg]`` (or .png) To used wrapped pictures, use ``` wrap =[yourpicture.jpg]=wrap ``` (without space) It's also possible to expand the html game with one chapter on one html file. For the general syntax, further tips and requirement for txt2tags, please go to : http://txt2tags.sf.net For choosing between tex (pdf) and html, just comment and uncomment one of the 2 sections below beginning with "!target" and invoque the file with " txt2tags txt2cyoa.t2t ". For creating the pdf use " pdflatex txt2cyoa.tex ". You can also change your tex style and replace or modify cyoa_A4.sty or cyoa_dayromanA4.sty (see the two lines after MORE OPTIONS and / or !style(tex)) Please note in the second example you'll need the tex font dayroman It's possible to get a graph with all the chapters connected together. You need to have graphviz installed to do that, and make sure each choice starts on one individual line, with a - and ends with the number of the choice. The best is to use a Unix environment, and invoque "make all" in order to generate the html, pdf versions and the graph in svg and png as well. - Examine the organigramme : 10 == 9 == Traduction française : Créer des "livres dont vous êtes le héros" avec Txt2Tags (txt2CYOA) Outils nécessaire : python éventuellement tex + pdflatex (utiliser texlive par ex.) Pour utiliser ce modèle, il suffit de le copier dans un nouveau fichier et de créer des paragraphes avec cette syntaxe : ``` == z == ``` Pour créer un choix on peut utiliser ces 2 formules : ``` - Description du choix : z - Description du choix : [z #z]. Et quelques mots ensuite. ``` avec z symbolisant le numéro de votre paragraphe. Il est obligatoire d'utiliser la syntaxe ``[z #z]`` si le nombre est suivi de quelque chose et n'est pas tout seul à la fin de la ligne. Il est également possible d'avoir des liens plus imagés avec (sans espace): ``` ==z==[nom_du_lien] ``` et l'appel à ce paragraphe serait : ``` - Aller à ce paragraphe : [z #nom_du_lien] ``` Vous pouvez ajouter des images avec ``[votreimage.jpg]`` (ou .png) Pour utiliser des images incluses dans le texte, on peut utiliser la syntaxe ``` wrap =[votreimage.jpg]=wrap ``` (sans espace entre wrap et =) Il est également possible d'avoir un paragraphe par fichier html. Pour en apprendre plus sur les options et la syntaxe générale de txt2tags, il y a des manuels sur : http://txt2tags.sf.net Pour choisir entre tex (pdf) et html, il suffit de commenter une des deux sections commençant par "!target" et d'invoquer le fichier avec " txt2tags txt2cyoa.t2t ". Pour générer le pdf il faut utiliser : " pdflatex txt2cyoa.tex ". Vous pouvez également modifier le style tex cyoa_A4.sty ou cyoa_dayromanA4.sty (voir les deux lignes après MORE OPTIONS et/ou !style(tex)) Dans le second exemple il vous faudra installer dayroman Enfin, il est possible d'obtenir un organigramme avec tous les chapitres reliés entre eux. Il faut le programme graphviz pour cela et veuillez à bien débuter les options possibles avec un tiret et de terminer chaque ligne par le chapitre choisi. Le plus simple est d'utiliser un environnement Unix et de taper "make all" pour obtenir directement les versions html et pdf ainsi que l'organigramme en png et svg. - Examine the organigramme : 10 == 10 == The organigramme of the game : [sample_graph.png] - Now go to the last chapter (it's using the GBL syntax, but it's not working yet) : 12 % example of GBL syntax. You can't use it yet ! #11# test_chapter_eleven Nothing to do here >Back to the begining=1 >Back to the help=8 >To the end=12 #12# Twelve Another choice >Back to the begining=1 >Back to the help=8 >To eleven=11